Re: [patch] Workqueue Abstraction, 2.5.40-H7

Jeff Garzik
2002-10-01T18:01:22Z

Ingo,

Looking real good.

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]

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.

Further, schedule_work(wq,data) is conceptually very close to
my_work_func(data) and makes the code easier to trace through: it
becomes more obvious what is the value of the my_work_func arg, at the
place in the code where schedule_work() is called. I see passing the
void* cookie as covering one common case, while adding void* arg to
schedule_work() would cover all cases...

[IMO the same argument can be applied to the existing timer API as well,
but timers are less often one-shot in kernel code, so it matter less...]

That said, I don't feel strongly about this, so can be convinced
otherwise fairly easily :) I would not complain if Linus applied your
patch as-is.

Jeff