mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>, Al Viro <viro@ZenIV.linux.org.uk>,
	Bart Van Assche <bvanassche@acm.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Neil Brown <neilb@suse.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] sched/wait: abort_exclusive_wait() should pass TASK_NORMAL to wake_up()
Date: Thu, 1 Sep 2016 20:09:02 +0200	[thread overview]
Message-ID: <20160901180902.GD10153@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20160901172658.GA14456@redhat.com>

On Thu, Sep 01, 2016 at 07:26:58PM +0200, Oleg Nesterov wrote:
> On 09/01, Peter Zijlstra wrote:
> >
> > So mixing INTERRUPTIBLE and UNINTERRUPTIBLE and then not using
> > TASK_NORMAL for wakeups is a mis-feature/abuse of waitqueues IMO.
> 
> Heh, agreed. When I was doing this fix I suddenly realize that I do
> not understand why do we have, say, wake_up_interruptible().
> 
> I mean, I can't imagine the "real" use-case when you actually want
> to wake up only the INTERRUPTIBLE tasks and leave the UNINTERRUPTIBLE
> sleeping. Exclusive or not.
> 
> It seems that wake_up_interruptible() is mostly used simply because
> the caller knows that UNINTERRUPTIBLE waiters are not possible, this
> is often the case.

I suspect the same.

> Actually, I think that TASK_NORMAL should be used even if wq mixes
> UNINTERRUPTIBLE and KILLABLE waiters. The fact that TASK_KILLABLE
> includes TASK_UNINTERRUPTIBLE is just "implementation detail" even
> if I do not think this will be ever changed.

I think its a fairly fundamental thing, its part of the semantics of
TASK_KILLABLE. Namely its UNINTERRUPTIBLE, except you can interrupt it
with fatal. A TASK_NORMAL wake should very much wake a TASK_KILLABLE
sleep, and for that to happen they need to share a bit, namely
UNINTERRUPTIBLE.

But I agree with you, all waitqueue wakeups _should_ simply be
TASK_NORMAL. Like said, I don't see it ever makes sense to play games
with it.

Now, let me try and get back to making sense of your abort abortion ;-)

  reply	other threads:[~2016-09-01 22:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-26 12:44 [PATCH 0/2] " Oleg Nesterov
2016-08-26 12:45 ` [PATCH 1/2] " Oleg Nesterov
2016-09-01 11:39   ` Peter Zijlstra
2016-09-01 17:26     ` Oleg Nesterov
2016-09-01 18:09       ` Peter Zijlstra [this message]
2016-08-26 12:45 ` [PATCH 2/2] sched/wait: avoid abort_exclusive_wait() in __wait_on_bit_lock() Oleg Nesterov
2016-08-26 12:47   ` Oleg Nesterov
2016-09-01 19:01   ` Peter Zijlstra
2016-09-01 19:08     ` Peter Zijlstra
2016-09-02 12:06       ` Oleg Nesterov
2016-09-01 22:17     ` Peter Zijlstra
2016-09-02 12:06       ` Oleg Nesterov
2016-09-02 13:20         ` Peter Zijlstra
2016-09-02 12:06     ` Oleg Nesterov
2016-09-01 11:03 ` [PATCH 0/2] sched/wait: abort_exclusive_wait() should pass TASK_NORMAL to wake_up() Peter Zijlstra

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=20160901180902.GD10153@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bvanassche@acm.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=neilb@suse.de \
    --cc=oleg@redhat.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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

Powered by JetHome