* [PATCH 4/5] ceph: fix improper use of smp_mb__before_atomic() [not found] <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com> @ 2019-04-29 20:15 ` Andrea Parri 2019-04-30 8:23 ` Peter Zijlstra 0 siblings, 1 reply; 6+ 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] 6+ 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: fix improper use of smp_mb__before_atomic() Andrea Parri @ 2019-04-30 8:23 ` Peter Zijlstra 2019-04-30 9:08 ` Yan, Zheng 0 siblings, 1 reply; 6+ 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] 6+ 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 2019-05-09 20:55 ` Andrea Parri 0 siblings, 1 reply; 6+ 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] 6+ messages in thread
* Re: [PATCH 4/5] ceph: fix improper use of smp_mb__before_atomic() 2019-04-30 9:08 ` Yan, Zheng @ 2019-05-09 20:55 ` Andrea Parri 2019-05-13 13:04 ` Yan, Zheng 0 siblings, 1 reply; 6+ messages in thread From: Andrea Parri @ 2019-05-09 20:55 UTC (permalink / raw) To: Yan, Zheng Cc: Linux Kernel Mailing List, Yan, Zheng, Sage Weil, Ilya Dryomov, ceph-devel, Paul E. McKenney, Peter Zijlstra On Tue, Apr 30, 2019 at 05:08:43PM +0800, Yan, Zheng wrote: > 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. Thanks for the suggestion, Yan. To be clear: would you like me to integrate your comment and resend? any other suggestions? Thanx, Andrea > > > > + 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] 6+ messages in thread
* Re: [PATCH 4/5] ceph: fix improper use of smp_mb__before_atomic() 2019-05-09 20:55 ` Andrea Parri @ 2019-05-13 13:04 ` Yan, Zheng 2019-05-13 22:47 ` Andrea Parri 0 siblings, 1 reply; 6+ messages in thread From: Yan, Zheng @ 2019-05-13 13:04 UTC (permalink / raw) To: Andrea Parri, Yan, Zheng Cc: Linux Kernel Mailing List, Sage Weil, Ilya Dryomov, ceph-devel, Paul E. McKenney, Peter Zijlstra On 5/10/19 4:55 AM, Andrea Parri wrote: > On Tue, Apr 30, 2019 at 05:08:43PM +0800, Yan, Zheng wrote: >> 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. > > Thanks for the suggestion, Yan. > > To be clear: would you like me to integrate your comment and resend? > any other suggestions? > Yes, please Regards Yan, Zheng > Thanx, > Andrea > > >> >>>> + 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] 6+ messages in thread
* Re: [PATCH 4/5] ceph: fix improper use of smp_mb__before_atomic() 2019-05-13 13:04 ` Yan, Zheng @ 2019-05-13 22:47 ` Andrea Parri 0 siblings, 0 replies; 6+ messages in thread From: Andrea Parri @ 2019-05-13 22:47 UTC (permalink / raw) To: Yan, Zheng Cc: Yan, Zheng, Linux Kernel Mailing List, Sage Weil, Ilya Dryomov, ceph-devel, Paul E. McKenney, Peter Zijlstra > >>> /* > >>> * 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. > > > >Thanks for the suggestion, Yan. > > > >To be clear: would you like me to integrate your comment and resend? > >any other suggestions? > > > > Yes, please Will do: I'll let the merge window close and send v2 on top of -rc1. Thanks, Andrea ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-05-13 22:47 UTC | newest]
Thread overview: 6+ 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:15 ` [PATCH 4/5] ceph: fix improper use of smp_mb__before_atomic() Andrea Parri
2019-04-30 8:23 ` Peter Zijlstra
2019-04-30 9:08 ` Yan, Zheng
2019-05-09 20:55 ` Andrea Parri
2019-05-13 13:04 ` Yan, Zheng
2019-05-13 22:47 ` Andrea Parri
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox