Re: [PATCH] sched: allow preempt notifiers to self-unregister.

From: Pierre Habouzit
Date: Mon Dec 19 2011 - 05:26:10 EST


On Sun, Dec 18, 2011 at 11:10:09AM +0200, Avi Kivity wrote:
> On 12/16/2011 06:15 PM, Pierre Habouzit wrote:
> > As a background, this need is because I have some kind of module
> > code that uses this facility to evaluate how many of a group of
> > threads are concurrently running (to regulate a pool of threads).
> >
>
> That's what's cmwq is supposed to be doing (and that too should be
> using preempt notifiers, IMO).

It doesn't (use preempt notifiers) because it calls schedule directly
and can have its own processing before and after schedule() on his own.

Indeed, my goal is to have something like kernel/workqueues.c, kind of,
but for *userland*. The goal is to support things like Apple
pthread_workqueue_* stuff[1], and similar concepts of load-regulated
userland thread pools.


[1] http://people.freebsd.org/~sson/thrworkq/pthread_workqueue.3.txt
--
Intersec <http://www.intersec.com>
Pierre Habouzit <pierre.habouzit@xxxxxxxxxxxx> | Chief Software Architect
TÃl : +33 (0)1 5570 3346
Mob : +33 (0)6 1636 8131
Fax : +33 (0)1 5570 3332
37 Rue Pierre Lhomme
92400 Courbevoie
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/