Re: [patch] Workqueue Abstraction, 2.5.40-H7

Ingo Molnar
2002-10-01T18:37:52Z

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