]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: use non-bh spin_lock in zstd timer callback
authorSchspa Shi <schspa@gmail.com>
Mon, 11 Apr 2022 15:55:41 +0000 (23:55 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 16 May 2022 15:03:13 +0000 (17:03 +0200)
commit3d5d3b9832e232da5afa4ffedabbc42c40921e41
treea31c682821b6d1c66101fd2a71ca2f1237411906
parentc548fa347bdaca9946fa0a6332e53ffd4360c453
btrfs: use non-bh spin_lock in zstd timer callback

This is an optimization for fix e18812fb16d9 ("btrfs: correct zstd
workspace manager lock to use spin_lock_bh()")

The critical region for wsm.lock is only accessed by the process context and
the softirq context.

Because in the soft interrupt, the critical section will not be
preempted by the soft interrupt again, there is no need to call
spin_lock_bh(&wsm.lock) to turn off the soft interrupt,
spin_lock(&wsm.lock) is enough for this situation.

Signed-off-by: Schspa Shi <schspa@gmail.com>
[ minor comment update ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/zstd.c