lkml.org 
[lkml]   [2022]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] btrfs: zstd: use spin_lock in timer function
David Sterba <dsterba@suse.cz> writes:

> On Sat, Apr 09, 2022 at 02:15:23AM +0800, Schspa Shi wrote:
>> timer callback was running on bh, and there is no need to disable bh again.
>
> Why do you think so? There was a specific fix fee13fe96529 ("btrfs:
> correct zstd workspace manager lock to use spin_lock_bh()") that
> actually added the _bh, so either you need to explain why exactly it's
> not needed anymore and verify that the reported lockdep warning from the
> fix does not happen.

Yes, I've seen this fix, and wsm.lru_list is protected by wsm.lock.
This patch will not remove all changes that were fixed. Just a little
improvement
to remove the unnecessary bh disabling. Like
static inline void red_adaptative_timer(struct timer_list *t)
in net/sched/sch_red.c.

Because the critical section is only used by the process context and
the softirq context,
it is safe to remove bh_disable in the softirq context since it will
not be preempted by the softirq.

BRs
Schspa Shi

\
 
 \ /
  Last update: 2022-04-09 09:39    [W:0.101 / U:1.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site