lkml.org 
[lkml]   [2013]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 00/16] sched/wait: Collapse __wait_event macros -v5
On Sat, Oct 05, 2013 at 10:04:16AM +0200, Ingo Molnar wrote:
>
> * Peter Zijlstra <peterz@infradead.org> wrote:
>
> > On Fri, Oct 04, 2013 at 10:44:05PM +0200, Peter Zijlstra wrote:
> > >
> > > slightly related; do we want to do something like the following two
> > > patches?
> >
> > and
>
> Yeah, both look good to me - but I'd move them into
> kernel/sched/completion.c and kernel/sched/wait.c if no-one objects.

Do you also want to suck in semaphore.c mutex.c rwsem.c spinlock.c etc?
Or do you want to create something like kernel/locking/ for all that.

I don't really mind too much either way except that I think that wait.c
and completion.c on their own make for a somewhat random split or
primitives.

> > --- /dev/null
> > +++ b/kernel/completion.c
> > @@ -0,0 +1,287 @@
> > +
> > +#include <linux/sched.h>
> > +#include <linux/completion.h>
>
> Also, mind adding a small blurb at the top explaining what it's all about?
> Just one sentence or two.

It got a bit longer:

+/*
+ * Generic wait-for-completion handler;
+ *
+ * It differs from semaphores in that their default case is the opposite,
+ * wait_for_completion default blocks whereas semaphore default non-block. The
+ * interface also makes it easy to 'complete' multiple waiting threads,
+ * something which isn't entirely natural for semaphores.
+ *
+ * But more importantly, the primitive documents the usage. Semaphores would
+ * typically be used for exclusion which gives rise to priority inversion.
+ * Waiting for completion is a typically sync point, but not an exclusion point.
+ */


\
 
 \ /
  Last update: 2013-10-08 12:21    [W:0.115 / U:5.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site