lkml.org 
[lkml]   [2017]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH] sched/wait: Introduce new, more compact wait_event*() primitives
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

\
 
 \ /
  Last update: 2017-03-08 17:40    [W:0.128 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site