diff options
author | Pavankumar Kondeti <pkondeti@codeaurora.org> | 2017-06-28 12:00:31 +0530 |
---|---|---|
committer | Pavankumar Kondeti <pkondeti@codeaurora.org> | 2017-08-07 16:08:23 +0530 |
commit | a66b3eb5aff1536bc32e5e5eb60393610a21dd06 (patch) | |
tree | 863007cd12e7f421e6854355d0ffd8b244deadf5 /kernel/sched/cpupri.c | |
parent | ca652b3d74c674ee4847ce56199889fd247106e6 (diff) |
softirq: defer softirq processing to ksoftirqd if CPU is busy with RT
Defer the softirq processing to ksoftirqd if a RT task is running
or queued on the current CPU. This complements the RT task placement
algorithm which tries to find a CPU that is not currently busy with
softirqs.
Currently NET_TX, NET_RX, BLOCK and TASKLET softirqs are only deferred
as they can potentially run for long time.
Change-Id: Id7665244af6bbd5a96d9e591cf26154e9eaa860c
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Diffstat (limited to 'kernel/sched/cpupri.c')
-rw-r--r-- | kernel/sched/cpupri.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/sched/cpupri.c b/kernel/sched/cpupri.c index 1d00cf8c00fa..14225d5d8617 100644 --- a/kernel/sched/cpupri.c +++ b/kernel/sched/cpupri.c @@ -279,3 +279,14 @@ void cpupri_cleanup(struct cpupri *cp) for (i = 0; i < CPUPRI_NR_PRIORITIES; i++) free_cpumask_var(cp->pri_to_cpu[i].mask); } + +/* + * cpupri_check_rt - check if CPU has a RT task + * should be called from rcu-sched read section. + */ +bool cpupri_check_rt(void) +{ + int cpu = raw_smp_processor_id(); + + return cpu_rq(cpu)->rd->cpupri.cpu_to_pri[cpu] > CPUPRI_NORMAL; +} |