blkcg: have bh disable for 32bit UP system reading 64bit stats
Subsystems (2)
PATCH 1/1 blkcg: have bh disable for 32bit UP system reading 64bit stats
From: Hong Zhiguo <[email protected]>
Update of blkg_stat and blkg_rwstat may happen in bh context. While u64_stats_fetch_retry is only preempt_disable on 32bit UP system. This is not enough to avoid preemption by bh and may read strange 64 bit value.
--- block/blk-cgroup.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
block/blk-cgroup.h +4 -4
@@ -430,9 +430,9 @@ static inline uint64_t blkg_stat_read(struct blkg_stat *stat)uint64_t v;do { - start =u64_stats_fetch_begin (&stat->syncp); + start =u64_stats_fetch_begin_bh (&stat->syncp); v = stat->cnt; - }while (u64_stats_fetch_retry (&stat->syncp, start)); + }while (u64_stats_fetch_retry_bh (&stat->syncp, start));return v; }
@@ -498,9 +498,9 @@ static inline struct blkg_rwstat blkg_rwstat_read(struct blkg_rwstat *rwstat)struct blkg_rwstat tmp;do { - start =u64_stats_fetch_begin (&rwstat->syncp); + start =u64_stats_fetch_begin_bh (&rwstat->syncp); tmp = *rwstat; - }while (u64_stats_fetch_retry (&rwstat->syncp, start)); + }while (u64_stats_fetch_retry_bh (&rwstat->syncp, start));return tmp; }
Signature · 1 line
1.8.1.2
Quoted 8 lines · Hong Zhiguo
From: Hong Zhiguo <[email protected]>
Update of
blkg_statandblkg_rwstatmay happen in bh context. Whileu64_stats_fetch_retryis onlypreempt_disableon 32bit UP system. This is not enough to avoid preemption by bh and may read strange 64 bit value.Signed-off-by Hong Zhiguo <[email protected]>
Jens, can you please pick this one up? This probably needs to be tagged for stable too.
Thanks!
Signature · 1 line
tejun
Jens Axboe
maintainerQuoted 8 lines · Tejun Heo
Quoted 7 lines · Hong Zhiguo
From: Hong Zhiguo <[email protected]>
Update of
blkg_statandblkg_rwstatmay happen in bh context. Whileu64_stats_fetch_retryis onlypreempt_disableon 32bit UP system. This is not enough to avoid preemption by bh and may read strange 64 bit value.
Quoted 6 lines
Quoted 1 line
Signed-off-by Hong Zhiguo <[email protected]>Acked-by Tejun Heo <[email protected]>Jens, can you please pick this one up? This probably needs to be tagged for stable too.
Yeah will do, thanks.
Signature · 1 line
Jens Axboe