aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/topology.h1
-rw-r--r--include/linux/topology.h4
-rw-r--r--kernel/sched_fair.c27
3 files changed, 16 insertions, 16 deletions
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index 25a92842dd99..d823c245f63b 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -143,6 +143,7 @@ extern unsigned long node_remap_size[];
143 | 1*SD_BALANCE_FORK \ 143 | 1*SD_BALANCE_FORK \
144 | 0*SD_BALANCE_WAKE \ 144 | 0*SD_BALANCE_WAKE \
145 | 1*SD_WAKE_AFFINE \ 145 | 1*SD_WAKE_AFFINE \
146 | 1*SD_PREFER_LOCAL \
146 | 0*SD_SHARE_CPUPOWER \ 147 | 0*SD_SHARE_CPUPOWER \
147 | 0*SD_POWERSAVINGS_BALANCE \ 148 | 0*SD_POWERSAVINGS_BALANCE \
148 | 0*SD_SHARE_PKG_RESOURCES \ 149 | 0*SD_SHARE_PKG_RESOURCES \
diff --git a/include/linux/topology.h b/include/linux/topology.h
index fc0bf3edeb67..57e63579bfdd 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -129,7 +129,7 @@ int arch_update_cpu_topology(void);
129 | 1*SD_BALANCE_FORK \ 129 | 1*SD_BALANCE_FORK \
130 | 0*SD_BALANCE_WAKE \ 130 | 0*SD_BALANCE_WAKE \
131 | 1*SD_WAKE_AFFINE \ 131 | 1*SD_WAKE_AFFINE \
132 | 1*SD_PREFER_LOCAL \ 132 | 0*SD_PREFER_LOCAL \
133 | 0*SD_SHARE_CPUPOWER \ 133 | 0*SD_SHARE_CPUPOWER \
134 | 1*SD_SHARE_PKG_RESOURCES \ 134 | 1*SD_SHARE_PKG_RESOURCES \
135 | 0*SD_SERIALIZE \ 135 | 0*SD_SERIALIZE \
@@ -162,7 +162,7 @@ int arch_update_cpu_topology(void);
162 | 1*SD_BALANCE_FORK \ 162 | 1*SD_BALANCE_FORK \
163 | 0*SD_BALANCE_WAKE \ 163 | 0*SD_BALANCE_WAKE \
164 | 1*SD_WAKE_AFFINE \ 164 | 1*SD_WAKE_AFFINE \
165 | 1*SD_PREFER_LOCAL \ 165 | 0*SD_PREFER_LOCAL \
166 | 0*SD_SHARE_CPUPOWER \ 166 | 0*SD_SHARE_CPUPOWER \
167 | 0*SD_SHARE_PKG_RESOURCES \ 167 | 0*SD_SHARE_PKG_RESOURCES \
168 | 0*SD_SERIALIZE \ 168 | 0*SD_SERIALIZE \
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 4e777b47eeda..c32c3e643daa 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -861,12 +861,21 @@ wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se);
861static struct sched_entity *pick_next_entity(struct cfs_rq *cfs_rq) 861static struct sched_entity *pick_next_entity(struct cfs_rq *cfs_rq)
862{ 862{
863 struct sched_entity *se = __pick_next_entity(cfs_rq); 863 struct sched_entity *se = __pick_next_entity(cfs_rq);
864 struct sched_entity *buddy;
864 865
865 if (cfs_rq->next && wakeup_preempt_entity(cfs_rq->next, se) < 1) 866 if (cfs_rq->next) {
866 return cfs_rq->next; 867 buddy = cfs_rq->next;
868 cfs_rq->next = NULL;
869 if (wakeup_preempt_entity(buddy, se) < 1)
870 return buddy;
871 }
867 872
868 if (cfs_rq->last && wakeup_preempt_entity(cfs_rq->last, se) < 1) 873 if (cfs_rq->last) {
869 return cfs_rq->last; 874 buddy = cfs_rq->last;
875 cfs_rq->last = NULL;
876 if (wakeup_preempt_entity(buddy, se) < 1)
877 return buddy;
878 }
870 879
871 return se; 880 return se;
872} 881}
@@ -1654,16 +1663,6 @@ static struct task_struct *pick_next_task_fair(struct rq *rq)
1654 1663
1655 do { 1664 do {
1656 se = pick_next_entity(cfs_rq); 1665 se = pick_next_entity(cfs_rq);
1657 /*
1658 * If se was a buddy, clear it so that it will have to earn
1659 * the favour again.
1660 *
1661 * If se was not a buddy, clear the buddies because neither
1662 * was elegible to run, let them earn it again.
1663 *
1664 * IOW. unconditionally clear buddies.
1665 */
1666 __clear_buddies(cfs_rq, NULL);
1667 set_next_entity(cfs_rq, se); 1666 set_next_entity(cfs_rq, se);
1668 cfs_rq = group_cfs_rq(se); 1667 cfs_rq = group_cfs_rq(se);
1669 } while (cfs_rq); 1668 } while (cfs_rq);