Re: [patch] Workqueue Abstraction, 2.5.40-H7

From: Ingo Molnar (mingo@elte.hu)
Date: Tue Oct 01 2002 - 13:52:07 EST


On Tue, 1 Oct 2002, Jeff Garzik wrote:

> I still think that schedule_work() should have void* cookie passed to it
> directly, instead of at INIT_WORK time [and possibly changing it by hand
> in the driver, immediately before schedule_work() is called]

i dont think this is a good idea, this pretty much forces the argument
passing upon every user of the interface - which argument would be put
into the worqueue-entry struct anyway.

the code behaves just right when only PREPARE_WORK() is used - the
completion code leaves the entry in a restartable state. A full
INIT_WORK() is only needed at init time. (or if DECLARE_WORK() was used
then no INIT_WORK() is needed.) And this is all intentional.

> For drivers that pass an interface pointer like struct net_device*,
> INIT_WORK-time, the current scheme is fine, but when the cookie
> fluctuates more, it makes a lot more sense to pass void* to
> schedule_work() itself.

these places should use PREPARE_WORK().

        Ingo

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Oct 07 2002 - 22:00:28 EST