From: Ingo Molnar <mingo@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Thomas Gleixner <tglx@linutronix.de>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC PATCH] sched/wait: Introduce new, more compact wait_event*() primitives
Date: Wed, 8 Mar 2017 18:16:19 +0100 [thread overview]
Message-ID: <20170308171619.GA3301@gmail.com> (raw)
In-Reply-To: <CA+55aFw8Py8ASo6-BqBzPOe2jmoJokeFpHEp7cpV4T9geVwBrw@mail.gmail.com>
* Linus Torvalds <torvalds@linux-foundation.org> wrote:
> 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.
Indeed it doesn't, yet.
> 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.
True!
> And we can actually *fix* the problem with it for 4.11, instead of
> adding the stupid header file includes.
Ok - I'm perfectly fine with your patch too, if you think it's v4.11 material!
Thanks,
Ingo
prev parent reply other threads:[~2017-03-08 17:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-03 1:36 [GIT PULL] sched.h split-up Ingo Molnar
2017-03-03 20:13 ` Linus Torvalds
2017-03-04 7:30 ` Ingo Molnar
2017-03-07 23:33 ` Linus Torvalds
2017-03-08 0:04 ` Linus Torvalds
2017-03-08 17:24 ` Ingo Molnar
2017-03-08 8:37 ` [RFC PATCH] sched/wait: Introduce new, more compact wait_event*() primitives Ingo Molnar
2017-03-08 9:17 ` [RFC PATCH] sched/wait: Add <linux/sched/signal.h> dependency for now Ingo Molnar
2017-03-08 10:11 ` [PATCH -v2] " Ingo Molnar
2017-03-08 11:55 ` [RFC PATCH] sched/wait: Introduce new, more compact wait_event*() primitives Ingo Molnar
2017-03-08 12:10 ` [RFC PATCH, -v2] " Ingo Molnar
2017-03-09 16:25 ` Peter Zijlstra
2017-03-08 16:37 ` [RFC PATCH] " Linus Torvalds
2017-03-08 17:16 ` Ingo Molnar [this message]
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=20170308171619.GA3301@gmail.com \
--to=mingo@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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;
as well as URLs for NNTP newsgroup(s).