From 9c6e5a362adab32f36133e83a4e69e0c6c4a26d0 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 26 Jul 2007 13:40:43 +0200 Subject: [PATCH] --- yaml --- r: 63014 b: refs/heads/master c: d02c7a8cf208eb80a3ccbff40a6bebe8902af35a h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/sched.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index ab025eacf27c..08a1a1369a13 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b762f3ffb797c1281a38a1c82194534055fba5ec +refs/heads/master: d02c7a8cf208eb80a3ccbff40a6bebe8902af35a diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 7a4de8768748..2e490271acf6 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -786,6 +786,22 @@ extern int partition_sched_domains(cpumask_t *partition1, #endif /* CONFIG_SMP */ +/* + * A runqueue laden with a single nice 0 task scores a weighted_cpuload of + * SCHED_LOAD_SCALE. This function returns 1 if any cpu is laden with a + * task of nice 0 or enough lower priority tasks to bring up the + * weighted_cpuload + */ +static inline int above_background_load(void) +{ + unsigned long cpu; + + for_each_online_cpu(cpu) { + if (weighted_cpuload(cpu) >= SCHED_LOAD_SCALE) + return 1; + } + return 0; +} struct io_context; /* See blkdev.h */ struct cpuset;