* [PATCH] rbd: optimize barrier usage for Rmw atomic bitops
@ 2020-01-29 18:12 Davidlohr Bueso
2020-01-30 12:52 ` Ilya Dryomov
0 siblings, 1 reply; 3+ messages in thread
From: Davidlohr Bueso @ 2020-01-29 18:12 UTC (permalink / raw)
To: idryomov; +Cc: ceph-devel, linux-kernel, dave, Davidlohr Bueso
For both set and clear_bit, we can avoid the unnecessary barrier
on non LL/SC architectures, such as x86. Instead, use the
smp_mb__{before,after}_atomic() calls.
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
---
drivers/block/rbd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 2b184563cd32..7bc79b2b8f65 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1371,13 +1371,13 @@ static void rbd_osd_submit(struct ceph_osd_request *osd_req)
static void img_request_layered_set(struct rbd_img_request *img_request)
{
set_bit(IMG_REQ_LAYERED, &img_request->flags);
- smp_mb();
+ smp_mb__after_atomic();
}
static void img_request_layered_clear(struct rbd_img_request *img_request)
{
clear_bit(IMG_REQ_LAYERED, &img_request->flags);
- smp_mb();
+ smp_mb__after_atomic();
}
static bool img_request_layered_test(struct rbd_img_request *img_request)
--
2.16.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rbd: optimize barrier usage for Rmw atomic bitops
2020-01-29 18:12 [PATCH] rbd: optimize barrier usage for Rmw atomic bitops Davidlohr Bueso
@ 2020-01-30 12:52 ` Ilya Dryomov
2020-01-30 15:02 ` Davidlohr Bueso
0 siblings, 1 reply; 3+ messages in thread
From: Ilya Dryomov @ 2020-01-30 12:52 UTC (permalink / raw)
To: Davidlohr Bueso; +Cc: Ceph Development, LKML, Davidlohr Bueso
On Wed, Jan 29, 2020 at 7:23 PM Davidlohr Bueso <dave@stgolabs.net> wrote:
>
> For both set and clear_bit, we can avoid the unnecessary barrier
> on non LL/SC architectures, such as x86. Instead, use the
> smp_mb__{before,after}_atomic() calls.
>
> Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
> ---
> drivers/block/rbd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index 2b184563cd32..7bc79b2b8f65 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -1371,13 +1371,13 @@ static void rbd_osd_submit(struct ceph_osd_request *osd_req)
> static void img_request_layered_set(struct rbd_img_request *img_request)
> {
> set_bit(IMG_REQ_LAYERED, &img_request->flags);
> - smp_mb();
> + smp_mb__after_atomic();
> }
>
> static void img_request_layered_clear(struct rbd_img_request *img_request)
> {
> clear_bit(IMG_REQ_LAYERED, &img_request->flags);
> - smp_mb();
> + smp_mb__after_atomic();
> }
>
> static bool img_request_layered_test(struct rbd_img_request *img_request)
Hi Davidlohr,
I don't think these barriers are needed at all. I'll remove them.
Thanks,
Ilya
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rbd: optimize barrier usage for Rmw atomic bitops
2020-01-30 12:52 ` Ilya Dryomov
@ 2020-01-30 15:02 ` Davidlohr Bueso
0 siblings, 0 replies; 3+ messages in thread
From: Davidlohr Bueso @ 2020-01-30 15:02 UTC (permalink / raw)
To: Ilya Dryomov; +Cc: Ceph Development, LKML, Davidlohr Bueso
On Thu, 30 Jan 2020, Ilya Dryomov wrote:
>I don't think these barriers are needed at all. I'll remove them.
Even better, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-01-30 15:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-29 18:12 [PATCH] rbd: optimize barrier usage for Rmw atomic bitops Davidlohr Bueso
2020-01-30 12:52 ` Ilya Dryomov
2020-01-30 15:02 ` Davidlohr Bueso
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).