aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVenkatesh Pallipadi <venki@google.com>2011-04-13 21:21:09 -0400
committerIngo Molnar <mingo@elte.hu>2011-04-19 04:08:37 -0400
commit69c80f3e9d3c569f8a3cee94ba1a324b5a7fa6b9 (patch)
treed802b0ade642dcad187384da9b5312d90e47ea45
parent6ddafdaab3f809b110ada253d2f2d4910ebd3ac5 (diff)
sched: Make set_*_buddy() work on non-task entities
Make set_*_buddy() work on non-task sched_entity, to facilitate the use of next_buddy to cache a group entity in cases where one of the tasks within that entity sleeps or gets preempted. set_skip_buddy() was incorrectly comparing the policy of task that is yielding to be not equal to SCHED_IDLE. Yielding should happen even when task yielding is SCHED_IDLE. This change removes the policy check on the yielding task. Signed-off-by: Venkatesh Pallipadi <venki@google.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1302744070-30079-2-git-send-email-venki@google.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/sched_fair.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 87445931a179..501ab637b94b 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1846,26 +1846,26 @@ wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se)
1846 1846
1847static void set_last_buddy(struct sched_entity *se) 1847static void set_last_buddy(struct sched_entity *se)
1848{ 1848{
1849 if (likely(task_of(se)->policy != SCHED_IDLE)) { 1849 if (entity_is_task(se) && unlikely(task_of(se)->policy == SCHED_IDLE))
1850 for_each_sched_entity(se) 1850 return;
1851 cfs_rq_of(se)->last = se; 1851
1852 } 1852 for_each_sched_entity(se)
1853 cfs_rq_of(se)->last = se;
1853} 1854}
1854 1855
1855static void set_next_buddy(struct sched_entity *se) 1856static void set_next_buddy(struct sched_entity *se)
1856{ 1857{
1857 if (likely(task_of(se)->policy != SCHED_IDLE)) { 1858 if (entity_is_task(se) && unlikely(task_of(se)->policy == SCHED_IDLE))
1858 for_each_sched_entity(se) 1859 return;
1859 cfs_rq_of(se)->next = se; 1860
1860 } 1861 for_each_sched_entity(se)
1862 cfs_rq_of(se)->next = se;
1861} 1863}
1862 1864
1863static void set_skip_buddy(struct sched_entity *se) 1865static void set_skip_buddy(struct sched_entity *se)
1864{ 1866{
1865 if (likely(task_of(se)->policy != SCHED_IDLE)) { 1867 for_each_sched_entity(se)
1866 for_each_sched_entity(se) 1868 cfs_rq_of(se)->skip = se;
1867 cfs_rq_of(se)->skip = se;
1868 }
1869} 1869}
1870 1870
1871/* 1871/*