lkml.org 
[lkml]   [2020]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch V2 4/9] softirq: Make softirq control and processing RT aware
On Fri, Dec 04, 2020 at 06:01:55PM +0100, Thomas Gleixner wrote:
> +static void __local_bh_enable(unsigned int cnt, bool unlock)
> +{
> + unsigned long flags;
> + int newcnt;
> +
> + DEBUG_LOCKS_WARN_ON(current->softirq_disable_cnt !=
> + this_cpu_read(softirq_ctrl.cnt));

Less important since it's debug code, but still can be __this_cpu_read().

> +
> + if (IS_ENABLED(CONFIG_TRACE_IRQFLAGS) && softirq_count() == cnt) {
> + raw_local_irq_save(flags);
> + lockdep_softirqs_on(_RET_IP_);
> + raw_local_irq_restore(flags);
> + }
> +
> + newcnt = __this_cpu_sub_return(softirq_ctrl.cnt, cnt);
> + current->softirq_disable_cnt = newcnt;
> +
> + if (!newcnt && unlock) {
> + rcu_read_unlock();
> + local_unlock(&softirq_ctrl.lock);
> + }
> +}
> +
> +static inline bool should_wake_ksoftirqd(void)
> +{
> + return !this_cpu_read(softirq_ctrl.cnt);

And that too.

Other than these boring details:

Reviewed-by: Frederic Weisbecker <frederic@kernel.org>

Thanks.

\
 
 \ /
  Last update: 2020-12-08 01:10    [W:0.230 / U:0.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site