All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@transmeta.com>, linux-kernel@vger.kernel.org
Subject: Re: [patch] Workqueue Abstraction, 2.5.40-H7
Date: Tue, 01 Oct 2002 14:04:48 -0400	[thread overview]
Message-ID: <3D99E3C0.5010604@pobox.com> (raw)
In-Reply-To: Pine.LNX.4.44.0210011653370.28821-102000@localhost.localdomain

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




  parent reply	other threads:[~2002-10-01 18:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-01 16:24 [patch] Workqueue Abstraction, 2.5.40-H7 Ingo Molnar
2002-10-01 17:55 ` Kai Germaschewski
2002-10-01 21:27   ` Ingo Molnar
2002-10-01 18:04 ` Jeff Garzik [this message]
2002-10-01 18:52   ` Ingo Molnar
2002-10-01 21:06     ` Jeff Garzik
2002-10-01 21:30       ` Ingo Molnar
2002-10-01 19:16 ` Linus Torvalds
2002-10-01 19:53   ` Linus Torvalds
2002-10-01 21:32 ` Kristian Hogsberg
2002-10-03 18:44   ` Ingo Molnar
2002-10-04 23:20     ` Kristian Hogsberg
2002-10-02  4:22 ` Christoph Hellwig
2002-10-01 21:31   ` Ingo Molnar
2002-10-02  8:22 ` Oleg Drokin
2002-10-08  3:50   ` Jeff Dike
  -- strict thread matches above, loose matches on Subject: below --
2002-10-01 18:52 Marc-Christian Petersen
2002-10-02  3:58 ` Christoph Hellwig
2002-10-01 20:29 Ingo Molnar
2002-10-01 20:49 ` Linus Torvalds
2002-10-01 21:21   ` Ingo Molnar
2002-10-02  3:23     ` Miles Bader
2002-10-02 19:18     ` Randy.Dunlap
2002-10-01 21:09 ` Jes Sorensen
2002-10-01 21:35   ` Ingo Molnar
2002-10-03  1:38 ` Kevin O'Connor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D99E3C0.5010604@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.