]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sched: add schedule_timeout_idle()
authorAndrew Morton <akpm@linux-foundation.org>
Tue, 9 Feb 2016 23:12:31 +0000 (10:12 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 9 Feb 2016 23:12:31 +0000 (10:12 +1100)
This will be needed in the patch "mm, oom: introduce oom reaper".

Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/sched.h
kernel/time/timer.c

index a10494a94cc30f24d65ab866771833883c6f886d..8a175f6b92731ab7e3a6ae30fc103b44c82fc615 100644 (file)
@@ -427,6 +427,7 @@ extern signed long schedule_timeout(signed long timeout);
 extern signed long schedule_timeout_interruptible(signed long timeout);
 extern signed long schedule_timeout_killable(signed long timeout);
 extern signed long schedule_timeout_uninterruptible(signed long timeout);
+extern signed long schedule_timeout_idle(signed long timeout);
 asmlinkage void schedule(void);
 extern void schedule_preempt_disabled(void);
 
index bbc5d1114583b21f1ab489cd40a98f3aa5ebd61d..2c4034761c7fefc84d748bf90c7d6eed601837f6 100644 (file)
@@ -1566,6 +1566,17 @@ signed long __sched schedule_timeout_uninterruptible(signed long timeout)
 }
 EXPORT_SYMBOL(schedule_timeout_uninterruptible);
 
+/*
+ * Like schedule_timeout_uninterruptible(), except this task will not contribute
+ * to load average.
+ */
+signed long __sched schedule_timeout_idle(signed long timeout)
+{
+       __set_current_state(TASK_IDLE);
+       return schedule_timeout(timeout);
+}
+EXPORT_SYMBOL(schedule_timeout_idle);
+
 #ifdef CONFIG_HOTPLUG_CPU
 static void migrate_timer_list(struct tvec_base *new_base, struct hlist_head *head)
 {