public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Peng Tao <bergwolf@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Oleg Drokin <oleg.drokin@intel.com>,
	Andreas Dilger <andreas.dilger@intel.com>,
	Oleg Nesterov <oleg@redhat.com>
Subject: Re: [PATCH RFC] sched: introduce add_wait_queue_exclusive_head
Date: Tue, 18 Mar 2014 15:05:04 +0100	[thread overview]
Message-ID: <20140318140504.GD23193@laptop.programming.kicks-ass.net> (raw)
In-Reply-To: <CA+a=Yy74V9_N4L8DoG=6iLnjGyOb6=ifraAqs5jW7ZsCG0t7jw@mail.gmail.com>

On Tue, Mar 18, 2014 at 09:51:04PM +0800, Peng Tao wrote:
> > Firstly I think the _head postfix for LIFO is a bad name,
> Do you have any preference on the name? add_wait_queue_exclusive_lifo()?

I think we can avoid the entire function if we add
WQ_FLAG_LIFO and make prepare_to_wait_event() DTRT.

Then we only need to teach ___wait() about this; and I suppose we could
make .exclusive=-1 be the LIFO flag.

Unless you cannot use ___wait() and really need to open-code the
wait_event() stuff.

> > If you don't mix exclusive and !exclusive tasks on the same waitqueue
> > this isn't a problem, but I'm sure people will eventually do this and
> > get a nasty surprise.
> >
> Yes, Lustre takes care not to mix exclusive and !exclusive tasks in this case.

Right; I saw you had a comment to that effect after I wrote this email.

> > I'm not sure what the best way around this would be; but I can see two
> > options:
> >
> >  - add enough debugging bits to detect this fail case.
> >  - extend wait_queue_head_t to keep a pointer to the first !exclusive

s/!//

> >    element and insert exclusive LIFO tasks there -- thereby keeping
> >    !exclusive tasks at the front.
> >
> Thank you for the suggestions. Personally I am in favor of the second
> one but I'll wait others to comment first.

Oleg, Ingo, any preferences?

  reply	other threads:[~2014-03-18 14:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-18 13:10 [PATCH RFC] sched: introduce add_wait_queue_exclusive_head Peng Tao
2014-03-18 13:33 ` Peter Zijlstra
2014-03-18 13:51   ` Peng Tao
2014-03-18 14:05     ` Peter Zijlstra [this message]
2014-03-18 14:44       ` Peng Tao
2014-03-18 16:23         ` Oleg Nesterov
2014-03-19  2:22           ` Peng Tao
2014-03-19 17:33             ` Oleg Nesterov
2014-03-19 19:44               ` Dilger, Andreas
2014-03-19 19:55                 ` Peter Zijlstra
2014-03-20  7:06                   ` Dilger, Andreas
2014-03-20 18:49                   ` Oleg Nesterov
2014-03-18 15:47       ` Oleg Nesterov
2014-03-19  2:17         ` Peng Tao
     [not found]           ` <20140319164907.GA10113@redhat.com>
2014-03-19 16:57             ` Peter Zijlstra
2014-03-19 17:19               ` Oleg Nesterov
2014-03-20 17:51                 ` [PATCH 0/2] wait: introduce WQ_FLAG_EXCLUSIVE_HEAD Oleg Nesterov
2014-03-20 17:51                   ` [PATCH 1/2] wait: turn "bool exclusive" arg of __wait_event() into wflags Oleg Nesterov
2014-03-20 17:51                   ` [PATCH 2/2] wait: introduce WQ_FLAG_EXCLUSIVE_HEAD Oleg Nesterov
2014-03-21  2:45                   ` [PATCH 0/2] " Dilger, Andreas
2014-03-21 18:49                     ` Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140318140504.GD23193@laptop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=andreas.dilger@intel.com \
    --cc=bergwolf@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=oleg.drokin@intel.com \
    --cc=oleg@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox