diff options
Diffstat (limited to 'kernel/softirq.c')
-rw-r--r-- | kernel/softirq.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/kernel/softirq.c b/kernel/softirq.c index 2a47ad9c26f5..2ae52d6b5a07 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -554,8 +554,8 @@ static void do_current_softirqs(int need_rcu_bh_qs) static void __local_bh_disable(void) { - migrate_disable(); - current->softirq_nestcnt++; + if (++current->softirq_nestcnt == 1) + migrate_disable(); } void local_bh_disable(void) @@ -581,8 +581,8 @@ static void __local_bh_enable(void) do_current_softirqs(1); local_irq_enable(); - current->softirq_nestcnt--; - migrate_enable(); + if (--current->softirq_nestcnt == 0) + migrate_enable(); } void local_bh_enable(void) @@ -606,8 +606,10 @@ EXPORT_SYMBOL(local_bh_enable_ip); void _local_bh_enable(void) { - current->softirq_nestcnt--; - migrate_enable(); + if (WARN_ON(current->softirq_nestcnt == 0)) + return; + if (--current->softirq_nestcnt == 0) + migrate_enable(); } EXPORT_SYMBOL(_local_bh_enable); |