Re: [patch] Workqueue Abstraction, 2.5.40-H7

From: Jeff Garzik (jgarzik@pobox.com)
Date: Tue Oct 01 2002 - 13:04:48 EST


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

-
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:27 EST