summaryrefslogtreecommitdiff
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorTim Chen <tim.c.chen@linux.intel.com>2014-07-31 21:29:48 +0400
committerHerbert Xu <herbert@gondor.apana.org.au>2014-08-25 16:32:23 +0400
commit2ee507c472939db4b146d545352b8a7c79ef47f8 (patch)
treed7c7034b23517f10340a8622cd9e9921d5f0b196 /include/linux/sched.h
parentbbb9a7dd7fd1ec076b034e6f5bce3fb5a215f050 (diff)
downloadlinux-2ee507c472939db4b146d545352b8a7c79ef47f8.tar.xz
sched: Add function single_task_running to let a task check if it is the only task running on a cpu
This function will help an async task processing batched jobs from workqueue decide if it wants to keep processing on more chunks of batched work that can be delayed, or to accumulate more work for more efficient batched processing later. If no other tasks are running on the cpu, the batching process can take advantgae of the available cpu cycles to a make decision to continue processing the existing accumulated work to minimize delay, otherwise it will yield. Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 5c2c885ee52b..e6d2c056d8e0 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -167,6 +167,7 @@ extern int nr_threads;
DECLARE_PER_CPU(unsigned long, process_counts);
extern int nr_processes(void);
extern unsigned long nr_running(void);
+extern bool single_task_running(void);
extern unsigned long nr_iowait(void);
extern unsigned long nr_iowait_cpu(int cpu);
extern void get_iowait_load(unsigned long *nr_waiters, unsigned long *load);