From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Johannes Berg <johannes@sipsolutions.net>,
linux-wireless@vger.kernel.org
Cc: Jiri Kosina <jikos@kernel.org>, Aaron Hill <aa1ronham@gmail.com>,
Lukas Redlinger <rel+kernel@agilox.net>,
Oleksii Shevchuk <alxchk@gmail.com>
Subject: Re: [PATCH] mac80211: keep BHs disabled while calling drv_tx_wake_queue()
Date: Tue, 01 Oct 2019 13:12:33 +0200 [thread overview]
Message-ID: <87wodou3by.fsf@toke.dk> (raw)
In-Reply-To: <bb98e67fd47effce9eada17bdf24a9d0b7102f31.camel@sipsolutions.net>
Johannes Berg <johannes@sipsolutions.net> writes:
> On Tue, 2019-10-01 at 12:53 +0200, Toke Høiland-Jørgensen wrote:
>>
>> > - spin_unlock_bh(&fq->lock);
>> > + spin_unlock(&fq->lock);
>> > drv_wake_tx_queue(local, txqi);
>> > - spin_lock_bh(&fq->lock);
>> > + spin_lock(&fq->lock);
>>
>> Okay, so this will mean that the drv_wake_tx_queue() entry point will be
>> called with bhs disabled.
>
> Right.
>
>> But there are lots of uses of
>> spin_{,un}lock_bh() in tx.c:
>
> [snip]
>
>> so won't that mean that the driver still gets bhs re-enabled after (for
>> instance) the first call to ieee80211_tx_dequeue()?
>
> No, local_bh_disable()/local_bh_enable() is re-entrant and nests fine.
Ah, right, gotcha. Hmm, in that case, would it be more clear to just add
an outer local_bh_disable()/local_bh_enable() to
___ieee80211_wake_txqs(). With this patch we're relying on the
mismatched use of _bh/non-_bh variants of the locking to ensure the bhs
stay off. Isn't that prone to breaking in the future?
Oh, and also, with just this patch, the additional drv_wake_tx_queue()
call for the vif TXQ at the bottom of __ieee80211_wake_txqs() will still
happen without bhs disabled, won't it?
-Toke
next prev parent reply other threads:[~2019-10-01 11:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-01 10:08 [PATCH] mac80211: keep BHs disabled while calling drv_tx_wake_queue() Johannes Berg
2019-10-01 10:53 ` Toke Høiland-Jørgensen
2019-10-01 10:56 ` Johannes Berg
2019-10-01 11:12 ` Toke Høiland-Jørgensen [this message]
2019-10-01 10:56 ` Jiri Kosina
2019-10-01 11:01 ` Johannes Berg
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=87wodou3by.fsf@toke.dk \
--to=toke@redhat.com \
--cc=aa1ronham@gmail.com \
--cc=alxchk@gmail.com \
--cc=jikos@kernel.org \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=rel+kernel@agilox.net \
/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.