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


Groups > linux.kernel > #1595364

Re: [RFC PATCH] sched/wait: Introduce new, more compact wait_event*() primitives

From Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [RFC PATCH] sched/wait: Introduce new, more compact wait_event*() primitives
Date 2017-03-08 17:40 +0100
Message-ID <tiMN4-GJ-27@gated-at.bofh.it> (permalink)
References <tgKZ3-2I4-3@gated-at.bofh.it> <th1Qe-6jM-9@gated-at.bofh.it> <tix1E-6vP-9@gated-at.bofh.it> <tiFsd-3Rn-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Mar 8, 2017 at 12:37 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> The idea is to allow call sites to supply the 'condition' function as free-form C
> code, while pushing everything else into non-macro form: there's a 'struct
> wait_event_state' on stack, and a state machine. The waiting logic is converted
> from procedural form to a state machine, because we have to call out into the
> 'condition' code in different circumstances.

Ok, I think the concept is fine, but you don't actually fix the
problem with the locked version that needs to unlock (with irq
versions etc) around the schedule.

And using "bool" in a struct is disgusting and wrong, and hides the
fact that the compiler will just turn it into "char" (or even "int"
for platforms where "char'" is slow, like alpha).

So it would be better with a "state" variable that just has fields, I suspect.

.. and as mentioned, it doesn't actually fix the case that hit the
signal_pending() problem.

Honestly, I think my "pass in a waiter function" model was both less
subtle and indirect, and more generic.

And we can actually *fix* the problem with it for 4.11, instead of
adding the stupid header file includes.

                     Linus

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


Thread

Re: [GIT PULL] sched.h split-up Linus Torvalds <torvalds@linux-foundation.org> - 2017-03-03 21:20 +0100
  Re: [GIT PULL] sched.h split-up Ingo Molnar <mingo@kernel.org> - 2017-03-04 08:40 +0100
  Re: [GIT PULL] sched.h split-up Linus Torvalds <torvalds@linux-foundation.org> - 2017-03-08 00:50 +0100
    Re: [GIT PULL] sched.h split-up Linus Torvalds <torvalds@linux-foundation.org> - 2017-03-08 01:20 +0100
      Re: [GIT PULL] sched.h split-up Ingo Molnar <mingo@kernel.org> - 2017-03-08 18:30 +0100
    [RFC PATCH] sched/wait: Introduce new, more compact wait_event*()  primitives Ingo Molnar <mingo@kernel.org> - 2017-03-08 09:50 +0100
      [RFC PATCH] sched/wait: Add <linux/sched/signal.h> dependency for now Ingo Molnar <mingo@kernel.org> - 2017-03-08 10:30 +0100
        [PATCH -v2] sched/wait: Add <linux/sched/signal.h> dependency for now Ingo Molnar <mingo@kernel.org> - 2017-03-08 11:20 +0100
      [RFC PATCH, -v2] sched/wait: Introduce new, more compact  wait_event*() primitives Ingo Molnar <mingo@kernel.org> - 2017-03-08 13:30 +0100
        Re: [RFC PATCH, -v2] sched/wait: Introduce new, more compact  wait_event*() primitives Peter Zijlstra <peterz@infradead.org> - 2017-03-09 17:30 +0100
      Re: [RFC PATCH] sched/wait: Introduce new, more compact  wait_event*() primitives Ingo Molnar <mingo@kernel.org> - 2017-03-08 14:20 +0100
      Re: [RFC PATCH] sched/wait: Introduce new, more compact wait_event*() primitives Linus Torvalds <torvalds@linux-foundation.org> - 2017-03-08 17:40 +0100
        Re: [RFC PATCH] sched/wait: Introduce new, more compact  wait_event*() primitives Ingo Molnar <mingo@kernel.org> - 2017-03-08 18:20 +0100

csiph-web