diff options
-rw-r--r-- | include/linux/sched.h | 2 | ||||
-rw-r--r-- | include/linux/topology.h | 2 | ||||
-rw-r--r-- | kernel/sched_fair.c | 7 |
3 files changed, 8 insertions, 3 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index ee1f88993097..b4a39bb2b4a4 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -805,7 +805,7 @@ enum cpu_idle_type { | |||
805 | #define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ | 805 | #define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ |
806 | #define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */ | 806 | #define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */ |
807 | #define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ | 807 | #define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ |
808 | 808 | #define SD_PREFER_LOCAL 0x0040 /* Prefer to keep tasks local to this domain */ | |
809 | #define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */ | 809 | #define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */ |
810 | #define SD_POWERSAVINGS_BALANCE 0x0100 /* Balance for power savings */ | 810 | #define SD_POWERSAVINGS_BALANCE 0x0100 /* Balance for power savings */ |
811 | #define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ | 811 | #define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ |
diff --git a/include/linux/topology.h b/include/linux/topology.h index 936ab2b37683..a6614b0242a9 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -129,6 +129,7 @@ int arch_update_cpu_topology(void); | |||
129 | | 1*SD_BALANCE_FORK \ | 129 | | 1*SD_BALANCE_FORK \ |
130 | | 1*SD_BALANCE_WAKE \ | 130 | | 1*SD_BALANCE_WAKE \ |
131 | | 1*SD_WAKE_AFFINE \ | 131 | | 1*SD_WAKE_AFFINE \ |
132 | | 1*SD_PREFER_LOCAL \ | ||
132 | | 0*SD_SHARE_CPUPOWER \ | 133 | | 0*SD_SHARE_CPUPOWER \ |
133 | | 1*SD_SHARE_PKG_RESOURCES \ | 134 | | 1*SD_SHARE_PKG_RESOURCES \ |
134 | | 0*SD_SERIALIZE \ | 135 | | 0*SD_SERIALIZE \ |
@@ -161,6 +162,7 @@ int arch_update_cpu_topology(void); | |||
161 | | 1*SD_BALANCE_FORK \ | 162 | | 1*SD_BALANCE_FORK \ |
162 | | 1*SD_BALANCE_WAKE \ | 163 | | 1*SD_BALANCE_WAKE \ |
163 | | 1*SD_WAKE_AFFINE \ | 164 | | 1*SD_WAKE_AFFINE \ |
165 | | 1*SD_PREFER_LOCAL \ | ||
164 | | 0*SD_SHARE_CPUPOWER \ | 166 | | 0*SD_SHARE_CPUPOWER \ |
165 | | 0*SD_SHARE_PKG_RESOURCES \ | 167 | | 0*SD_SHARE_PKG_RESOURCES \ |
166 | | 0*SD_SERIALIZE \ | 168 | | 0*SD_SERIALIZE \ |
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 280892e9d85e..a37f311f436e 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -1360,7 +1360,7 @@ static int select_task_rq_fair(struct task_struct *p, int sd_flag, int flags) | |||
1360 | * If power savings logic is enabled for a domain, see if we | 1360 | * If power savings logic is enabled for a domain, see if we |
1361 | * are not overloaded, if so, don't balance wider. | 1361 | * are not overloaded, if so, don't balance wider. |
1362 | */ | 1362 | */ |
1363 | if (tmp->flags & SD_POWERSAVINGS_BALANCE) { | 1363 | if (tmp->flags & (SD_POWERSAVINGS_BALANCE|SD_PREFER_LOCAL)) { |
1364 | unsigned long power = 0; | 1364 | unsigned long power = 0; |
1365 | unsigned long nr_running = 0; | 1365 | unsigned long nr_running = 0; |
1366 | unsigned long capacity; | 1366 | unsigned long capacity; |
@@ -1373,7 +1373,10 @@ static int select_task_rq_fair(struct task_struct *p, int sd_flag, int flags) | |||
1373 | 1373 | ||
1374 | capacity = DIV_ROUND_CLOSEST(power, SCHED_LOAD_SCALE); | 1374 | capacity = DIV_ROUND_CLOSEST(power, SCHED_LOAD_SCALE); |
1375 | 1375 | ||
1376 | if (nr_running/2 < capacity) | 1376 | if (tmp->flags & SD_POWERSAVINGS_BALANCE) |
1377 | nr_running /= 2; | ||
1378 | |||
1379 | if (nr_running < capacity) | ||
1377 | break; | 1380 | break; |
1378 | } | 1381 | } |
1379 | 1382 | ||