Re: [PATCH 16/19] workqueue: reimplement workqueue flushing usingcolor coded works

From: Peter Zijlstra
Date: Mon Dec 07 2009 - 03:47:52 EST


On Sat, 2009-12-05 at 04:42 +0900, Tejun Heo wrote:
> Hello,
>
> On 12/04/2009 08:46 PM, Peter Zijlstra wrote:
> > Hmm, a long while back I did a PI aware workqueue implementation, that
> > used nested work-lists to implement barriers and flushing.
> >
> > This colour thing seems very prone to starvation when you want to extend
> > worklets with priority.
>
> Can you elaborate how it would be prone to starvation? I was assuming
> flat-priority while designing and implementing this as that was the
> current behavior and never really thought about priority.

A sudden influx of high prio worklets would hold back the completion of
existing worklets, so simply waiting for a particular colour to deplete
is going to last a long while.

The barrier semantics I implemented ensured worklets couldn't cross a
barrier, so if a high prio item got stuck behind a barrier it would
simply elevate the priority of everything before the barrier, and would
complete everything before that barrier before running itself.

This insures progress and thereby guarantees completion of flushes.

--
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/