Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: peterz@infradead.org
Cc: Christoph Hellwig <hch@infradead.org>,
Jacob Wen <jian.w.wen@oracle.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] block: insert a general SMP memory barrier before wake_up_bit()
Date: Thu, 13 Aug 2020 13:00:17 +0100 [thread overview]
Message-ID: <20200813120017.GH17456@casper.infradead.org> (raw)
In-Reply-To: <20200813114050.GW2674@hirez.programming.kicks-ass.net>
On Thu, Aug 13, 2020 at 01:40:50PM +0200, peterz@infradead.org wrote:
> On Thu, Aug 13, 2020 at 08:31:15AM +0100, Christoph Hellwig wrote:
> > On Thu, Aug 13, 2020 at 10:44:38AM +0800, Jacob Wen wrote:
> > > wake_up_bit() uses waitqueue_active() that needs the explicit smp_mb().
> >
> > Sounds like the barrier should go into wake_up_bit then..
>
> Oh, thanks for reminding me..
>
> https://lkml.kernel.org/r/20190624165012.GH3436@hirez.programming.kicks-ass.net
>
> I'll try and get back to that.
+++ b/drivers/bluetooth/btmtkuart.c
@@ -340,11 +340,8 @@ static int btmtkuart_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
if (hdr->evt == HCI_EV_VENDOR) {
if (test_and_clear_bit(BTMTKUART_TX_WAIT_VND_EVT,
- &bdev->tx_state)) {
- /* Barrier to sync with other CPUs */
- smp_mb__after_atomic();
+ &bdev->tx_state))
wake_up_bit(&bdev->tx_state, BTMTKUART_TX_WAIT_VND_EVT);
- }
}
return 0;
It'd be nice to be able to write:
if (hdr->evt == HCI_EV_VENDOR)
test_clear_and_wake_up_bit(&bdev->tx_state,
BTMTKUART_TX_WAIT_VND_EVT);
... maybe with a better name.
prev parent reply other threads:[~2020-08-13 12:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-13 2:44 Jacob Wen
2020-08-13 3:00 ` Chaitanya Kulkarni
2020-08-13 7:31 ` Christoph Hellwig
2020-08-13 7:46 ` Jacob Wen
2020-08-13 11:40 ` peterz
2020-08-13 12:00 ` Matthew Wilcox [this message]
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=20200813120017.GH17456@casper.infradead.org \
--to=willy@infradead.org \
--cc=hch@infradead.org \
--cc=jian.w.wen@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--subject='Re: [PATCH] block: insert a general SMP memory barrier before wake_up_bit()' \
/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
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).