diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2015-06-01 18:45:37 +0900 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2016-12-14 13:46:29 +0900 |
commit | 9f7af769ccd9993b39e26fa8d8a074d59322b703 (patch) | |
tree | 1b5528207ec783fd28f086b3ee674a7a48278cc6 /kernel | |
parent | 70f66d69c519ddad9dece9ea5bc61fe8e5ed1a68 (diff) |
LOCAL / sched: Add nr_running_cpumask() to get the number of running tasks of per-cluster
This patch adds the nr_running_cpumask() function to get the number of runing
tasks of per-cluster.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/core.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 6240d0b7838c..6b28458eec3c 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2403,6 +2403,16 @@ unsigned long nr_running(void) return sum; } +unsigned long nr_running_cpumask(cpumask_var_t cpus) +{ + unsigned long i, sum = 0; + + for_each_cpu(i, cpus) + sum += cpu_rq(i)->nr_running; + + return sum; +} + /* * Check if only the current task is running on the cpu. * |