OSDN Git Service

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

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