Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1474782

Re: [PATCH 1/2] sched/wait: abort_exclusive_wait() should pass TASK_NORMAL to wake_up()

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] sched/wait: abort_exclusive_wait() should pass TASK_NORMAL to wake_up()
Date 2016-09-02 00:50 +0200
Message-ID <scIY1-7U6-9@gated-at.bofh.it> (permalink)
References <saoK6-6YC-21@gated-at.bofh.it> <saoTM-7aM-39@gated-at.bofh.it> <scyvE-1dR-27@gated-at.bofh.it> <scHph-70l-87@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 ;-)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] sched/wait: abort_exclusive_wait() should pass  TASK_NORMAL to wake_up() Oleg Nesterov <oleg@redhat.com> - 2016-08-26 15:00 +0200
  [PATCH 2/2] sched/wait: avoid abort_exclusive_wait() in  __wait_on_bit_lock() Oleg Nesterov <oleg@redhat.com> - 2016-08-26 15:00 +0200
    Re: [PATCH 2/2] sched/wait: avoid abort_exclusive_wait() in  __wait_on_bit_lock() Peter Zijlstra <peterz@infradead.org> - 2016-09-01 23:10 +0200
      Re: [PATCH 2/2] sched/wait: avoid abort_exclusive_wait() in         __wait_on_bit_lock() Oleg Nesterov <oleg@redhat.com> - 2016-09-02 14:10 +0200
    Re: [PATCH 2/2] sched/wait: avoid abort_exclusive_wait() in  __wait_on_bit_lock() Peter Zijlstra <peterz@infradead.org> - 2016-09-01 23:20 +0200
      Re: [PATCH 2/2] sched/wait: avoid abort_exclusive_wait() in  __wait_on_bit_lock() Peter Zijlstra <peterz@infradead.org> - 2016-09-02 00:20 +0200
        Re: [PATCH 2/2] sched/wait: avoid abort_exclusive_wait() in         __wait_on_bit_lock() Oleg Nesterov <oleg@redhat.com> - 2016-09-02 14:10 +0200
          Re: [PATCH 2/2] sched/wait: avoid abort_exclusive_wait() in  __wait_on_bit_lock() Peter Zijlstra <peterz@infradead.org> - 2016-09-02 15:30 +0200
      Re: [PATCH 2/2] sched/wait: avoid abort_exclusive_wait() in         __wait_on_bit_lock() Oleg Nesterov <oleg@redhat.com> - 2016-09-02 14:10 +0200
  [PATCH 1/2] sched/wait: abort_exclusive_wait() should pass  TASK_NORMAL to wake_up() Oleg Nesterov <oleg@redhat.com> - 2016-08-26 15:00 +0200
    Re: [PATCH 1/2] sched/wait: abort_exclusive_wait() should pass  TASK_NORMAL to wake_up() Peter Zijlstra <peterz@infradead.org> - 2016-09-01 13:40 +0200
      Re: [PATCH 1/2] sched/wait: abort_exclusive_wait() should pass         TASK_NORMAL to wake_up() Oleg Nesterov <oleg@redhat.com> - 2016-09-01 23:10 +0200
        Re: [PATCH 1/2] sched/wait: abort_exclusive_wait() should pass  TASK_NORMAL to wake_up() Peter Zijlstra <peterz@infradead.org> - 2016-09-02 00:50 +0200
  Re: [PATCH 0/2] sched/wait: abort_exclusive_wait() should pass  TASK_NORMAL to wake_up() Peter Zijlstra <peterz@infradead.org> - 2016-09-01 13:10 +0200

csiph-web