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

From: Linus Torvalds
Date: Thu Oct 01 2009 - 13:05:35 EST




On Thu, 1 Oct 2009, Tejun Heo wrote:
>
> Reimplement workqueue flushing using color coded works. There are two
> colors and each cwq has the current color which is painted on the
> works being issued via the cwq. Flushing a workqueue is achieved by
> flipping the current colors of each cwq and wait for the works which
> have the old color to drain.

Is there any reason for the "two colors" choice? I could imagine that it
could end up being a limitation (and possible deadlock?) to allow just a
single flush pending at any time.

Could the color be an 8-bit counter or something like that instead?

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