diff options
author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-06-22 14:00:21 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-06-22 14:00:20 -0700 |
commit | af39cfe11e2cf56d668c441f0836b5a2085ee7ab (patch) | |
tree | f2bd34275fb5e7d979d7082f0f60993e1f4ae5a9 /kernel/softirq.c | |
parent | 47f3f671143084f82bc5cf2bafc3784aa233d0a8 (diff) | |
parent | 25e8ecf9daca3078043039ab56d4cb9e1a08bbbb (diff) |
Merge "sched: avoid migrating when softint on tgt cpu should be short"
Diffstat (limited to 'kernel/softirq.c')
-rw-r--r-- | kernel/softirq.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/softirq.c b/kernel/softirq.c index 479e4436f787..39ffd41594ce 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -57,6 +57,13 @@ static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp DEFINE_PER_CPU(struct task_struct *, ksoftirqd); +/* + * active_softirqs -- per cpu, a mask of softirqs that are being handled, + * with the expectation that approximate answers are acceptable and therefore + * no synchronization. + */ +DEFINE_PER_CPU(__u32, active_softirqs); + const char * const softirq_to_name[NR_SOFTIRQS] = { "HI", "TIMER", "NET_TX", "NET_RX", "BLOCK", "BLOCK_IOPOLL", "TASKLET", "SCHED", "HRTIMER", "RCU" @@ -253,6 +260,7 @@ asmlinkage __visible void __do_softirq(void) restart: /* Reset the pending bitmask before enabling irqs */ set_softirq_pending(0); + __this_cpu_write(active_softirqs, pending); local_irq_enable(); @@ -282,6 +290,7 @@ restart: pending >>= softirq_bit; } + __this_cpu_write(active_softirqs, 0); rcu_bh_qs(); local_irq_disable(); |