erofs: use raw_smp_processor_id() to get buffer from global buffer pool
Sandeep Dhavale
reviewerPATCH 1/1 erofs: use raw_smp_processor_id() to get buffer from global buffer pool
erofs will decompress in the preemptible context (kworker or per cpu thread). As smp_processor_id() cannot be used in preemptible contexts, use raw_smp_processor_id() instead to index into global buffer pool.
--- fs/erofs/zutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/erofs/zutil.c +1 -1
@@ -30,7 +30,7 @@ static struct shrinker *erofs_shrinker_info;static unsigned int z_erofs_gbuf_id (void ) { -return smp_processor_id () % z_erofs_gbuf_count; +return raw_smp_processor_id () % z_erofs_gbuf_count; }void *z_erofs_get_gbuf (unsigned int requiredpages)
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Hi Sandeep,
Quoted 7 lines · Sandeep Dhavale
erofs will decompress in the preemptible context (kworker or per cpu thread). As
smp_processor_id()cannot be used in preemptible contexts, useraw_smp_processor_id()instead to index into global buffer pool.Reported-by [email protected]Fixes 7a7513292cc6 ("erofs: rename per-CPU buffers to global buffer pool and make it configurable")Signed-off-by Sandeep Dhavale <[email protected]>
Thanks for catching this, since the original patch is for next upstream cycle, may I fold this fix in the original patch?
I will add your credit into the original patch.
Thanks,
Gao Xiang
Quoted 17 lines
--- fs/erofs/zutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/erofs/zutil.c +1
-1@@ -30,7 +30,7 @@ static struct shrinker *erofs_shrinker_info;static unsigned int z_erofs_gbuf_id (void ) { -return smp_processor_id () % z_erofs_gbuf_count; +return raw_smp_processor_id () % z_erofs_gbuf_count; }void *z_erofs_get_gbuf (unsigned int requiredpages)
Sandeep Dhavale
reviewerQuoted 5 lines
Thanks for catching this, since the original patch is for next upstream cycle, may I fold this fix in the original patch?
Hi Gao,
Sounds good. As the fix is simple, it makes sense to fold it into the original one.
Thanks,
Sandeep.
Quoted 11 lines · Sandeep Dhavale
Quoted 5 lines
Thanks for catching this, since the original patch is for next upstream cycle, may I fold this fix in the original patch?
Hi Gao,
Sounds good. As the fix is simple, it makes sense to fold it into the original one.Thanks,
Sandeep.
Thanks, folded.
Thanks,
Gao Xiang