* [PATCH 1/5] drm/msm: Fix improper uses of smp_mb__{before,after}_atomic()
[not found] <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com>
@ 2019-04-29 20:14 ` Andrea Parri
2019-04-29 20:14 ` [PATCH 2/5] bio: fix improper use of smp_mb__before_atomic() Andrea Parri
` (3 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Andrea Parri @ 2019-04-29 20:14 UTC (permalink / raw)
To: linux-kernel
Cc: Andrea Parri, stable, Rob Clark, Sean Paul, David Airlie,
Daniel Vetter, Jordan Crouse, linux-arm-msm, dri-devel, freedreno
These barriers only apply to the read-modify-write operations; in
particular, they do not apply to the atomic_set() primitive.
Replace the barriers with smp_mb()s.
Fixes: b1fc2839d2f92 ("drm/msm: Implement preemption for A5XX targets")
Cc: stable@vger.kernel.org
Reported-by: "Paul E. McKenney" <paulmck@linux.ibm.com>
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Sean Paul <sean@poorly.run>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Jordan Crouse <jcrouse@codeaurora.org>
Cc: linux-arm-msm@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: freedreno@lists.freedesktop.org
---
drivers/gpu/drm/msm/adreno/a5xx_preempt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_preempt.c b/drivers/gpu/drm/msm/adreno/a5xx_preempt.c
index 3d62310a535fb..ee0820ee0c664 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_preempt.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_preempt.c
@@ -39,10 +39,10 @@ static inline void set_preempt_state(struct a5xx_gpu *gpu,
* preemption or in the interrupt handler so barriers are needed
* before...
*/
- smp_mb__before_atomic();
+ smp_mb();
atomic_set(&gpu->preempt_state, new);
/* ... and after*/
- smp_mb__after_atomic();
+ smp_mb();
}
/* Write the most recent wptr for the given ring into the hardware */
--
2.7.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/5] bio: fix improper use of smp_mb__before_atomic()
[not found] <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com>
2019-04-29 20:14 ` [PATCH 1/5] drm/msm: Fix improper uses of smp_mb__{before,after}_atomic() Andrea Parri
@ 2019-04-29 20:14 ` Andrea Parri
2019-04-30 8:21 ` Peter Zijlstra
2019-05-10 3:40 ` Ming Lei
2019-04-29 20:14 ` [PATCH 3/5] sbitmap: " Andrea Parri
` (2 subsequent siblings)
4 siblings, 2 replies; 12+ messages in thread
From: Andrea Parri @ 2019-04-29 20:14 UTC (permalink / raw)
To: linux-kernel; +Cc: Andrea Parri, stable, Jens Axboe, linux-block
This barrier only applies to the read-modify-write operations; in
particular, it does not apply to the atomic_set() primitive.
Replace the barrier with an smp_mb().
Fixes: dac56212e8127 ("bio: skip atomic inc/dec of ->bi_cnt for most use cases")
Cc: stable@vger.kernel.org
Reported-by: "Paul E. McKenney" <paulmck@linux.ibm.com>
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org
---
include/linux/bio.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/bio.h b/include/linux/bio.h
index e584673c18814..5becbafb84e8a 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -224,7 +224,7 @@ static inline void bio_cnt_set(struct bio *bio, unsigned int count)
{
if (count != 1) {
bio->bi_flags |= (1 << BIO_REFFED);
- smp_mb__before_atomic();
+ smp_mb();
}
atomic_set(&bio->__bi_cnt, count);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/5] sbitmap: fix improper use of smp_mb__before_atomic()
[not found] <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com>
2019-04-29 20:14 ` [PATCH 1/5] drm/msm: Fix improper uses of smp_mb__{before,after}_atomic() Andrea Parri
2019-04-29 20:14 ` [PATCH 2/5] bio: fix improper use of smp_mb__before_atomic() Andrea Parri
@ 2019-04-29 20:14 ` Andrea Parri
2019-05-10 3:41 ` Ming Lei
2019-04-29 20:15 ` [PATCH 4/5] ceph: " Andrea Parri
2019-04-29 20:15 ` [PATCH 5/5] IB/hfi1: Fix improper uses " Andrea Parri
4 siblings, 1 reply; 12+ messages in thread
From: Andrea Parri @ 2019-04-29 20:14 UTC (permalink / raw)
To: linux-kernel; +Cc: Andrea Parri, stable, Jens Axboe, Omar Sandoval, linux-block
This barrier only applies to the read-modify-write operations; in
particular, it does not apply to the atomic_set() primitive.
Replace the barrier with an smp_mb().
Fixes: 6c0ca7ae292ad ("sbitmap: fix wakeup hang after sbq resize")
Cc: stable@vger.kernel.org
Reported-by: "Paul E. McKenney" <paulmck@linux.ibm.com>
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Omar Sandoval <osandov@fb.com>
Cc: linux-block@vger.kernel.org
---
lib/sbitmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sbitmap.c b/lib/sbitmap.c
index 155fe38756ecf..4a7fc4915dfc6 100644
--- a/lib/sbitmap.c
+++ b/lib/sbitmap.c
@@ -435,7 +435,7 @@ static void sbitmap_queue_update_wake_batch(struct sbitmap_queue *sbq,
* to ensure that the batch size is updated before the wait
* counts.
*/
- smp_mb__before_atomic();
+ smp_mb();
for (i = 0; i < SBQ_WAIT_QUEUES; i++)
atomic_set(&sbq->ws[i].wait_cnt, 1);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 4/5] ceph: fix improper use of smp_mb__before_atomic()
[not found] <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com>
` (2 preceding siblings ...)
2019-04-29 20:14 ` [PATCH 3/5] sbitmap: " Andrea Parri
@ 2019-04-29 20:15 ` Andrea Parri
2019-04-30 8:23 ` Peter Zijlstra
2019-04-29 20:15 ` [PATCH 5/5] IB/hfi1: Fix improper uses " Andrea Parri
4 siblings, 1 reply; 12+ messages in thread
From: Andrea Parri @ 2019-04-29 20:15 UTC (permalink / raw)
To: linux-kernel
Cc: Andrea Parri, stable, Yan, Zheng, Sage Weil, Ilya Dryomov,
ceph-devel
This barrier only applies to the read-modify-write operations; in
particular, it does not apply to the atomic64_set() primitive.
Replace the barrier with an smp_mb().
Fixes: fdd4e15838e59 ("ceph: rework dcache readdir")
Cc: stable@vger.kernel.org
Reported-by: "Paul E. McKenney" <paulmck@linux.ibm.com>
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
Cc: "Yan, Zheng" <zyan@redhat.com>
Cc: Sage Weil <sage@redhat.com>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: ceph-devel@vger.kernel.org
---
fs/ceph/super.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 16c03188578ea..b5c782e6d62f1 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -541,7 +541,7 @@ static inline void __ceph_dir_set_complete(struct ceph_inode_info *ci,
long long release_count,
long long ordered_count)
{
- smp_mb__before_atomic();
+ smp_mb();
atomic64_set(&ci->i_complete_seq[0], release_count);
atomic64_set(&ci->i_complete_seq[1], ordered_count);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 5/5] IB/hfi1: Fix improper uses of smp_mb__before_atomic()
[not found] <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com>
` (3 preceding siblings ...)
2019-04-29 20:15 ` [PATCH 4/5] ceph: " Andrea Parri
@ 2019-04-29 20:15 ` Andrea Parri
2019-04-29 21:24 ` Ruhl, Michael J
2019-04-30 8:28 ` Peter Zijlstra
4 siblings, 2 replies; 12+ messages in thread
From: Andrea Parri @ 2019-04-29 20:15 UTC (permalink / raw)
To: linux-kernel
Cc: Andrea Parri, stable, Dennis Dalessandro, Mike Marciniszyn,
Doug Ledford, Jason Gunthorpe, linux-rdma
This barrier only applies to the read-modify-write operations; in
particular, it does not apply to the atomic_read() primitive.
Replace the barrier with an smp_mb().
Fixes: 856cc4c237add ("IB/hfi1: Add the capability for reserved operations")
Cc: stable@vger.kernel.org
Reported-by: "Paul E. McKenney" <paulmck@linux.ibm.com>
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>
Cc: Doug Ledford <dledford@redhat.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: linux-rdma@vger.kernel.org
---
drivers/infiniband/sw/rdmavt/qp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index a34b9a2a32b60..b64fd151d31fb 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -1863,11 +1863,11 @@ static inline int rvt_qp_is_avail(
u32 reserved_used;
/* see rvt_qp_wqe_unreserve() */
- smp_mb__before_atomic();
+ smp_mb();
reserved_used = atomic_read(&qp->s_reserved_used);
if (unlikely(reserved_op)) {
/* see rvt_qp_wqe_unreserve() */
- smp_mb__before_atomic();
+ smp_mb();
if (reserved_used >= rdi->dparms.reserved_operations)
return -ENOMEM;
return 0;
@@ -1882,7 +1882,7 @@ static inline int rvt_qp_is_avail(
avail = slast - qp->s_head;
/* see rvt_qp_wqe_unreserve() */
- smp_mb__before_atomic();
+ smp_mb();
reserved_used = atomic_read(&qp->s_reserved_used);
avail = avail - 1 -
(rdi->dparms.reserved_operations - reserved_used);
--
2.7.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* RE: [PATCH 5/5] IB/hfi1: Fix improper uses of smp_mb__before_atomic()
2019-04-29 20:15 ` [PATCH 5/5] IB/hfi1: Fix improper uses " Andrea Parri
@ 2019-04-29 21:24 ` Ruhl, Michael J
2019-04-30 8:28 ` Peter Zijlstra
1 sibling, 0 replies; 12+ messages in thread
From: Ruhl, Michael J @ 2019-04-29 21:24 UTC (permalink / raw)
To: Andrea Parri, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org, Dalessandro, Dennis, Marciniszyn, Mike,
Doug Ledford, Jason Gunthorpe, linux-rdma@vger.kernel.org
>-----Original Message-----
>From: linux-rdma-owner@vger.kernel.org [mailto:linux-rdma-
>owner@vger.kernel.org] On Behalf Of Andrea Parri
>Sent: Monday, April 29, 2019 4:15 PM
>To: linux-kernel@vger.kernel.org
>Cc: Andrea Parri <andrea.parri@amarulasolutions.com>;
>stable@vger.kernel.org; Dalessandro, Dennis
><dennis.dalessandro@intel.com>; Marciniszyn, Mike
><mike.marciniszyn@intel.com>; Doug Ledford <dledford@redhat.com>;
>Jason Gunthorpe <jgg@ziepe.ca>; linux-rdma@vger.kernel.org
>Subject: [PATCH 5/5] IB/hfi1: Fix improper uses of smp_mb__before_atomic()
>
>This barrier only applies to the read-modify-write operations; in
>particular, it does not apply to the atomic_read() primitive.
>
>Replace the barrier with an smp_mb().
This is one of a couple of barrier issues that we are currently looking into.
See:
[PATCH for-next 6/9] IB/rdmavt: Add new completion inline
We will take a look at this one as well.
Thanks,
Mike
>Fixes: 856cc4c237add ("IB/hfi1: Add the capability for reserved operations")
>Cc: stable@vger.kernel.org
>Reported-by: "Paul E. McKenney" <paulmck@linux.ibm.com>
>Reported-by: Peter Zijlstra <peterz@infradead.org>
>Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
>Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
>Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>
>Cc: Doug Ledford <dledford@redhat.com>
>Cc: Jason Gunthorpe <jgg@ziepe.ca>
>Cc: linux-rdma@vger.kernel.org
>---
> drivers/infiniband/sw/rdmavt/qp.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/infiniband/sw/rdmavt/qp.c
>b/drivers/infiniband/sw/rdmavt/qp.c
>index a34b9a2a32b60..b64fd151d31fb 100644
>--- a/drivers/infiniband/sw/rdmavt/qp.c
>+++ b/drivers/infiniband/sw/rdmavt/qp.c
>@@ -1863,11 +1863,11 @@ static inline int rvt_qp_is_avail(
> u32 reserved_used;
>
> /* see rvt_qp_wqe_unreserve() */
>- smp_mb__before_atomic();
>+ smp_mb();
> reserved_used = atomic_read(&qp->s_reserved_used);
> if (unlikely(reserved_op)) {
> /* see rvt_qp_wqe_unreserve() */
>- smp_mb__before_atomic();
>+ smp_mb();
> if (reserved_used >= rdi->dparms.reserved_operations)
> return -ENOMEM;
> return 0;
>@@ -1882,7 +1882,7 @@ static inline int rvt_qp_is_avail(
> avail = slast - qp->s_head;
>
> /* see rvt_qp_wqe_unreserve() */
>- smp_mb__before_atomic();
>+ smp_mb();
> reserved_used = atomic_read(&qp->s_reserved_used);
> avail = avail - 1 -
> (rdi->dparms.reserved_operations - reserved_used);
>--
>2.7.4
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/5] bio: fix improper use of smp_mb__before_atomic()
2019-04-29 20:14 ` [PATCH 2/5] bio: fix improper use of smp_mb__before_atomic() Andrea Parri
@ 2019-04-30 8:21 ` Peter Zijlstra
2019-05-10 3:40 ` Ming Lei
1 sibling, 0 replies; 12+ messages in thread
From: Peter Zijlstra @ 2019-04-30 8:21 UTC (permalink / raw)
To: Andrea Parri; +Cc: linux-kernel, stable, Jens Axboe, linux-block
On Mon, Apr 29, 2019 at 10:14:58PM +0200, Andrea Parri wrote:
> This barrier only applies to the read-modify-write operations; in
> particular, it does not apply to the atomic_set() primitive.
>
> Replace the barrier with an smp_mb().
> @@ -224,7 +224,7 @@ static inline void bio_cnt_set(struct bio *bio, unsigned int count)
> {
> if (count != 1) {
> bio->bi_flags |= (1 << BIO_REFFED);
> - smp_mb__before_atomic();
Maybe also add:
/*
* XXX the comment that explain this barrier goes here
*/
> + smp_mb();
> }
> atomic_set(&bio->__bi_cnt, count);
> }
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 4/5] ceph: fix improper use of smp_mb__before_atomic()
2019-04-29 20:15 ` [PATCH 4/5] ceph: " Andrea Parri
@ 2019-04-30 8:23 ` Peter Zijlstra
2019-04-30 9:08 ` Yan, Zheng
0 siblings, 1 reply; 12+ messages in thread
From: Peter Zijlstra @ 2019-04-30 8:23 UTC (permalink / raw)
To: Andrea Parri
Cc: linux-kernel, stable, Yan, Zheng, Sage Weil, Ilya Dryomov,
ceph-devel
On Mon, Apr 29, 2019 at 10:15:00PM +0200, Andrea Parri wrote:
> This barrier only applies to the read-modify-write operations; in
> particular, it does not apply to the atomic64_set() primitive.
>
> Replace the barrier with an smp_mb().
>
> @@ -541,7 +541,7 @@ static inline void __ceph_dir_set_complete(struct ceph_inode_info *ci,
> long long release_count,
> long long ordered_count)
> {
> - smp_mb__before_atomic();
same
/*
* XXX: the comment that explain this barrier goes here.
*/
> + smp_mb();
> atomic64_set(&ci->i_complete_seq[0], release_count);
> atomic64_set(&ci->i_complete_seq[1], ordered_count);
> }
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 5/5] IB/hfi1: Fix improper uses of smp_mb__before_atomic()
2019-04-29 20:15 ` [PATCH 5/5] IB/hfi1: Fix improper uses " Andrea Parri
2019-04-29 21:24 ` Ruhl, Michael J
@ 2019-04-30 8:28 ` Peter Zijlstra
1 sibling, 0 replies; 12+ messages in thread
From: Peter Zijlstra @ 2019-04-30 8:28 UTC (permalink / raw)
To: Andrea Parri
Cc: linux-kernel, stable, Dennis Dalessandro, Mike Marciniszyn,
Doug Ledford, Jason Gunthorpe, linux-rdma
On Mon, Apr 29, 2019 at 10:15:01PM +0200, Andrea Parri wrote:
> This barrier only applies to the read-modify-write operations; in
> particular, it does not apply to the atomic_read() primitive.
>
> Replace the barrier with an smp_mb().
>
> Fixes: 856cc4c237add ("IB/hfi1: Add the capability for reserved operations")
> Cc: stable@vger.kernel.org
> Reported-by: "Paul E. McKenney" <paulmck@linux.ibm.com>
> Reported-by: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
> Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
> Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>
> Cc: Doug Ledford <dledford@redhat.com>
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Cc: linux-rdma@vger.kernel.org
> ---
> drivers/infiniband/sw/rdmavt/qp.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
> index a34b9a2a32b60..b64fd151d31fb 100644
> --- a/drivers/infiniband/sw/rdmavt/qp.c
> +++ b/drivers/infiniband/sw/rdmavt/qp.c
> @@ -1863,11 +1863,11 @@ static inline int rvt_qp_is_avail(
> u32 reserved_used;
>
> /* see rvt_qp_wqe_unreserve() */
I see a completely bogus comment in rvf_op_wqe_unreserve(), referring to
bogus comments makes this barrier bogus too.
> - smp_mb__before_atomic();
> + smp_mb();
> reserved_used = atomic_read(&qp->s_reserved_used);
> if (unlikely(reserved_op)) {
> /* see rvt_qp_wqe_unreserve() */
> - smp_mb__before_atomic();
This was before, but there is nothing _after_ this. Which means this
barrier was complete garbage anyway.
> + smp_mb();
> if (reserved_used >= rdi->dparms.reserved_operations)
> return -ENOMEM;
> return 0;
> @@ -1882,7 +1882,7 @@ static inline int rvt_qp_is_avail(
> avail = slast - qp->s_head;
>
> /* see rvt_qp_wqe_unreserve() */
> - smp_mb__before_atomic();
> + smp_mb();
Same as the first.
> reserved_used = atomic_read(&qp->s_reserved_used);
> avail = avail - 1 -
> (rdi->dparms.reserved_operations - reserved_used);
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 4/5] ceph: fix improper use of smp_mb__before_atomic()
2019-04-30 8:23 ` Peter Zijlstra
@ 2019-04-30 9:08 ` Yan, Zheng
0 siblings, 0 replies; 12+ messages in thread
From: Yan, Zheng @ 2019-04-30 9:08 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Andrea Parri, Linux Kernel Mailing List, stable, Yan, Zheng,
Sage Weil, Ilya Dryomov, ceph-devel
On Tue, Apr 30, 2019 at 4:26 PM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Mon, Apr 29, 2019 at 10:15:00PM +0200, Andrea Parri wrote:
> > This barrier only applies to the read-modify-write operations; in
> > particular, it does not apply to the atomic64_set() primitive.
> >
> > Replace the barrier with an smp_mb().
> >
>
> > @@ -541,7 +541,7 @@ static inline void __ceph_dir_set_complete(struct ceph_inode_info *ci,
> > long long release_count,
> > long long ordered_count)
> > {
> > - smp_mb__before_atomic();
>
> same
> /*
> * XXX: the comment that explain this barrier goes here.
> */
>
makes sure operations that setup readdir cache (update page cache and
i_size) are strongly ordered with following atomic64_set.
> > + smp_mb();
>
> > atomic64_set(&ci->i_complete_seq[0], release_count);
> > atomic64_set(&ci->i_complete_seq[1], ordered_count);
> > }
> > --
> > 2.7.4
> >
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/5] bio: fix improper use of smp_mb__before_atomic()
2019-04-29 20:14 ` [PATCH 2/5] bio: fix improper use of smp_mb__before_atomic() Andrea Parri
2019-04-30 8:21 ` Peter Zijlstra
@ 2019-05-10 3:40 ` Ming Lei
1 sibling, 0 replies; 12+ messages in thread
From: Ming Lei @ 2019-05-10 3:40 UTC (permalink / raw)
To: Andrea Parri; +Cc: linux-kernel, stable, Jens Axboe, linux-block
On Mon, Apr 29, 2019 at 10:14:58PM +0200, Andrea Parri wrote:
> This barrier only applies to the read-modify-write operations; in
> particular, it does not apply to the atomic_set() primitive.
>
> Replace the barrier with an smp_mb().
>
> Fixes: dac56212e8127 ("bio: skip atomic inc/dec of ->bi_cnt for most use cases")
> Cc: stable@vger.kernel.org
> Reported-by: "Paul E. McKenney" <paulmck@linux.ibm.com>
> Reported-by: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: linux-block@vger.kernel.org
> ---
> include/linux/bio.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/bio.h b/include/linux/bio.h
> index e584673c18814..5becbafb84e8a 100644
> --- a/include/linux/bio.h
> +++ b/include/linux/bio.h
> @@ -224,7 +224,7 @@ static inline void bio_cnt_set(struct bio *bio, unsigned int count)
> {
> if (count != 1) {
> bio->bi_flags |= (1 << BIO_REFFED);
> - smp_mb__before_atomic();
> + smp_mb();
> }
> atomic_set(&bio->__bi_cnt, count);
> }
> --
> 2.7.4
>
Looks fine,
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Thanks,
Ming
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/5] sbitmap: fix improper use of smp_mb__before_atomic()
2019-04-29 20:14 ` [PATCH 3/5] sbitmap: " Andrea Parri
@ 2019-05-10 3:41 ` Ming Lei
0 siblings, 0 replies; 12+ messages in thread
From: Ming Lei @ 2019-05-10 3:41 UTC (permalink / raw)
To: Andrea Parri; +Cc: linux-kernel, stable, Jens Axboe, Omar Sandoval, linux-block
On Mon, Apr 29, 2019 at 10:14:59PM +0200, Andrea Parri wrote:
> This barrier only applies to the read-modify-write operations; in
> particular, it does not apply to the atomic_set() primitive.
>
> Replace the barrier with an smp_mb().
>
> Fixes: 6c0ca7ae292ad ("sbitmap: fix wakeup hang after sbq resize")
> Cc: stable@vger.kernel.org
> Reported-by: "Paul E. McKenney" <paulmck@linux.ibm.com>
> Reported-by: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: Omar Sandoval <osandov@fb.com>
> Cc: linux-block@vger.kernel.org
> ---
> lib/sbitmap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/sbitmap.c b/lib/sbitmap.c
> index 155fe38756ecf..4a7fc4915dfc6 100644
> --- a/lib/sbitmap.c
> +++ b/lib/sbitmap.c
> @@ -435,7 +435,7 @@ static void sbitmap_queue_update_wake_batch(struct sbitmap_queue *sbq,
> * to ensure that the batch size is updated before the wait
> * counts.
> */
> - smp_mb__before_atomic();
> + smp_mb();
> for (i = 0; i < SBQ_WAIT_QUEUES; i++)
> atomic_set(&sbq->ws[i].wait_cnt, 1);
> }
> --
> 2.7.4
>
sbitmap_queue_update_wake_batch() won't be called in fast path, and
the fix is correct too, so:
Reviewed-by: Ming Lei <ming.lei@redhat.com>
thanks,
Ming
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2019-05-10 3:41 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com>
2019-04-29 20:14 ` [PATCH 1/5] drm/msm: Fix improper uses of smp_mb__{before,after}_atomic() Andrea Parri
2019-04-29 20:14 ` [PATCH 2/5] bio: fix improper use of smp_mb__before_atomic() Andrea Parri
2019-04-30 8:21 ` Peter Zijlstra
2019-05-10 3:40 ` Ming Lei
2019-04-29 20:14 ` [PATCH 3/5] sbitmap: " Andrea Parri
2019-05-10 3:41 ` Ming Lei
2019-04-29 20:15 ` [PATCH 4/5] ceph: " Andrea Parri
2019-04-30 8:23 ` Peter Zijlstra
2019-04-30 9:08 ` Yan, Zheng
2019-04-29 20:15 ` [PATCH 5/5] IB/hfi1: Fix improper uses " Andrea Parri
2019-04-29 21:24 ` Ruhl, Michael J
2019-04-30 8:28 ` Peter Zijlstra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox