From: Jason Gunthorpe <jgg@nvidia.com>
To: "Håkon Bugge" <haakon.bugge@oracle.com>
Cc: Doug Ledford <dledford@redhat.com>,
Leon Romanovsky <leon@kernel.org>,
linux-rdma@vger.kernel.org
Subject: Re: [PATCH for-next] RDMA/cma: Replace RMW with atomic bit-ops
Date: Mon, 21 Jun 2021 11:35:16 -0300 [thread overview]
Message-ID: <20210621143516.GO1002214@nvidia.com> (raw)
In-Reply-To: <1623854153-19147-1-git-send-email-haakon.bugge@oracle.com>
On Wed, Jun 16, 2021 at 04:35:53PM +0200, Håkon Bugge wrote:
> +#define BIT_ACCESS_FUNCTIONS(b) \
> + static inline void set_##b(unsigned long flags) \
> + { \
> + /* set_bit() does not imply a memory barrier */ \
> + smp_mb__before_atomic(); \
> + set_bit(b, &flags); \
> + /* set_bit() does not imply a memory barrier */ \
> + smp_mb__after_atomic(); \
> + }
This isn't needed, set_bit/test_bit are already atomic with
themselves, we should not need to introduce release semantics.
Please split this to one patch per variable
Every variable should be evalulated to decide if we should hold the
spinlock instead of relying on atomics.
Jason
next prev parent reply other threads:[~2021-06-21 14:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-16 14:35 [PATCH for-next] RDMA/cma: Replace RMW with atomic bit-ops Håkon Bugge
2021-06-16 15:02 ` Stefan Metzmacher
2021-06-16 16:03 ` Haakon Bugge
2021-06-17 6:51 ` Leon Romanovsky
2021-06-17 6:56 ` Haakon Bugge
2021-06-17 7:38 ` Leon Romanovsky
2021-06-17 9:19 ` Haakon Bugge
2021-06-17 12:49 ` Leon Romanovsky
2021-06-18 13:57 ` Haakon Bugge
2021-06-21 14:35 ` Jason Gunthorpe [this message]
2021-06-21 15:30 ` Haakon Bugge
2021-06-21 15:32 ` Jason Gunthorpe
2021-06-21 15:37 ` Haakon Bugge
2021-06-21 23:29 ` Jason Gunthorpe
2021-06-22 7:34 ` Haakon Bugge
2021-06-22 7:44 ` Haakon Bugge
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=20210621143516.GO1002214@nvidia.com \
--to=jgg@nvidia.com \
--cc=dledford@redhat.com \
--cc=haakon.bugge@oracle.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
/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