]> 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)
commit2f5d9f51d778f5208b509c606efa756caef132aa
treea31c682821b6d1c66101fd2a71ca2f1237411906
parentb9673507f73349d3e89cdf28e99d247636d92d89
btrfs: use non-bh spin_lock in zstd timer callback

This is an optimization for fix d59e39096001 ("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