aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/core.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index ec1a286684a5..59965ec0b7de 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2366,6 +2366,18 @@ unsigned long nr_running(void)
2366 return sum; 2366 return sum;
2367} 2367}
2368 2368
2369/*
2370 * Check if only the current task is running on the cpu.
2371 */
2372bool single_task_running(void)
2373{
2374 if (cpu_rq(smp_processor_id())->nr_running == 1)
2375 return true;
2376 else
2377 return false;
2378}
2379EXPORT_SYMBOL(single_task_running);
2380
2369unsigned long long nr_context_switches(void) 2381unsigned long long nr_context_switches(void)
2370{ 2382{
2371 int i; 2383 int i;