From: James Ketrenos <jketreno@linux.intel.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: Michael Wu <flamingice@sourmilk.net>,
"John W. Linville" <linville@tuxdriver.com>,
linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] Add iwlwifi wireless drivers
Date: Wed, 23 May 2007 11:17:28 -0700 [thread overview]
Message-ID: <46548538.9080002@linux.intel.com> (raw)
In-Reply-To: <465391A5.4090608@garzik.org>
Jeff Garzik wrote:
> James Ketrenos wrote:
>> Jeff Garzik wrote:
>>> James Ketrenos wrote:
>>>> Jeff Garzik wrote:
>>>>> James Ketrenos wrote:
>>>>>> That said -- if the driver can execute in parallel to the stack
>>>>>> for some operations, shouldn't they remain on their own workqueues
>>>>>> so the work can be divided up vs. having *everything* routed
>>>>>> through one singlethread workqueue?
>>>>>
>>>>> Just because it -can-, does not mean it should.
>>>>>
>>>>> Unless there is a -proven- need for the operations to be parallel,
>>>>> you should avoid the burden of such complexity.
>>>>
>>>> There is no additional complexity by having the driver create its
>>>> own workqueue; it just calls create_workqueue during probe and
>>>> destroy_workqueue during remove.
>>>
>>> That is obviously false. Ignoring the additional code and memory
>>> usage, you must additionally evaluate the potential for deadlocks and
>>> races.
>>
>> So you're saying that by using mac80211's workqueue a driver no longer
>> has to worry about any deadlocks or race conditions? That is
>> obviously false.
>
> Don't be dense. If two operations are guaranteed to go down the same
> pipeline, then there is a clear sequence guarantee that is not present
> if operations are [needlessly] parallel.
Being on ifsta->work doesn't guarantee any sequence--it just means ieee80211_sta_work can't process management frames at the same time the driver is doing things on that workqueue. ieee80211_sta_work does make some driver callbacks, however those callbacks are also be made from ioctls and cfg80211. Additionally there is other work that ieee80211_sta_work does that does not make any callbacks or state transitions into the driver.
There is no guarantee that driver callbacks from mac80211 will not occur in parallel or in different contexts.
The driver has to protect access to memory shared across those contexts regardless of which workqueue it happens to use.
>> I didn't say we can't use mac80211's workqueue if it was
>> created/destroyed during alloc/free vs. hw register. I asked a
>> question about if work can execute in parallel, shouldn't we let it
>
> Without justification for the additional complexity, the answer is no.
Can you show me how the complexity is reduced?
"Ignoring the additional code and memory usage, you must additionally evaluate the potential for deadlocks and races."
Given the API mac80211 exposes, and how the stack operates, I don't see how using ifsta->work as the workqueue allows the driver to no longer evaluate the potential for deadlocks and races.
The second argument you made:
"And then there is the Linus mantra: do what you must, and no more. No need for additional workqueues has been demonstrated."
To make the most use of the processing and power resources available, you must execute in parallel.
I haven't seen a need, or benefit, to serialize unrelated work onto a single workqueue.
James
next prev parent reply other threads:[~2007-05-23 19:45 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-16 21:45 [PATCH] Add iwlwifi wireless drivers James Ketrenos
2007-05-17 1:27 ` Randy Dunlap
2007-05-17 4:28 ` James Ketrenos
2007-05-17 5:57 ` Jeff Garzik
2007-05-22 21:38 ` James Ketrenos
2007-05-18 19:01 ` James Ketrenos
2007-05-18 20:57 ` Jeff Garzik
2007-05-18 20:54 ` James Ketrenos
2007-05-18 21:06 ` Randy Dunlap
2007-05-22 18:39 ` John W. Linville
2007-05-22 18:29 ` James Ketrenos
2007-05-17 1:51 ` Michael Wu
2007-05-17 2:56 ` Jeff Garzik
2007-05-17 3:55 ` Michael Wu
2007-05-17 8:52 ` Christoph Hellwig
2007-05-22 19:16 ` James Ketrenos
2007-05-22 23:00 ` Jeff Garzik
2007-05-22 21:49 ` James Ketrenos
2007-05-22 23:41 ` Jeff Garzik
2007-05-22 22:56 ` James Ketrenos
2007-05-23 0:58 ` Jeff Garzik
2007-05-23 18:17 ` James Ketrenos [this message]
2007-05-23 19:59 ` Jeff Garzik
2007-05-23 19:30 ` James Ketrenos
2007-05-23 1:06 ` Michael Wu
2007-05-23 1:46 ` Jeff Garzik
2007-05-17 3:35 ` [PATCH] Add iwlwifi wireless drivers [part 2/2] Randy Dunlap
2007-05-17 15:03 ` Stephen Hemminger
2007-05-17 15:05 ` Stephen Hemminger
2007-05-18 7:04 ` Johannes Berg
2007-05-18 20:33 ` James Ketrenos
2007-05-18 22:05 ` Jeff Garzik
2007-05-18 21:31 ` James Ketrenos
2007-05-18 22:50 ` Jeff Garzik
2007-05-18 23:04 ` Christoph Hellwig
2007-05-21 14:56 ` James Ketrenos
2007-05-21 16:26 ` Christoph Hellwig
2007-05-21 16:48 ` James Ketrenos
2007-05-21 18:15 ` Christoph Hellwig
2007-05-21 20:12 ` Cohen, Guy
2007-05-21 21:02 ` Jeff Garzik
2007-05-21 21:10 ` Randy Dunlap
2007-05-21 21:43 ` Cohen, Guy
2007-05-21 22:15 ` Jeff Garzik
2007-05-21 21:22 ` Joerg Mayer
2007-05-21 21:46 ` Cohen, Guy
2007-05-18 22:13 ` Randy Dunlap
2007-05-18 23:05 ` [PATCH] Add iwlwifi wireless drivers Christoph Hellwig
2007-05-18 23:22 ` Michael Wu
2007-05-22 21:50 ` [PATCH v3] " James Ketrenos
2007-05-23 1:06 ` Jeff Garzik
2007-05-23 15:16 ` James Ketrenos
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=46548538.9080002@linux.intel.com \
--to=jketreno@linux.intel.com \
--cc=flamingice@sourmilk.net \
--cc=jeff@garzik.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).