aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorChristian Ehrhardt <ehrhardt@linux.vnet.ibm.com>2009-11-30 06:16:48 -0500
committerIngo Molnar <mingo@elte.hu>2009-12-09 04:04:02 -0500
commitacb4a848da821a095ae9e4d8b22ae2d9633ba5cd (patch)
tree152efff68841e554eb71c82a97d3ed9571352581 /kernel/sched.c
parent1983a922a1bc843806b9a36cf3a370b242783140 (diff)
sched: Update normalized values on user updates via proc
The normalized values are also recalculated in case the scaling factor changes. This patch updates the internally used scheduler tuning values that are normalized to one cpu in case a user sets new values via sysfs. Together with patch 2 of this series this allows to let user configured values scale (or not) to cpu add/remove events taking place later. Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <1259579808-11357-4-git-send-email-ehrhardt@linux.vnet.ibm.com> [ v2: fix warning ] Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 116efed962c6..0a60e8e9b094 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1816,6 +1816,7 @@ static void cfs_rq_set_shares(struct cfs_rq *cfs_rq, unsigned long shares)
1816 1816
1817static void calc_load_account_active(struct rq *this_rq); 1817static void calc_load_account_active(struct rq *this_rq);
1818static void update_sysctl(void); 1818static void update_sysctl(void);
1819static int get_update_sysctl_factor(void);
1819 1820
1820static inline void __set_task_cpu(struct task_struct *p, unsigned int cpu) 1821static inline void __set_task_cpu(struct task_struct *p, unsigned int cpu)
1821{ 1822{
@@ -7030,9 +7031,9 @@ cpumask_var_t nohz_cpu_mask;
7030 * 7031 *
7031 * This idea comes from the SD scheduler of Con Kolivas: 7032 * This idea comes from the SD scheduler of Con Kolivas:
7032 */ 7033 */
7033static void update_sysctl(void) 7034static int get_update_sysctl_factor(void)
7034{ 7035{
7035 unsigned int cpus = min(num_online_cpus(), 8U); 7036 unsigned int cpus = min(num_online_cpus(), 8);
7036 unsigned int factor; 7037 unsigned int factor;
7037 7038
7038 switch (sysctl_sched_tunable_scaling) { 7039 switch (sysctl_sched_tunable_scaling) {
@@ -7048,6 +7049,13 @@ static void update_sysctl(void)
7048 break; 7049 break;
7049 } 7050 }
7050 7051
7052 return factor;
7053}
7054
7055static void update_sysctl(void)
7056{
7057 unsigned int factor = get_update_sysctl_factor();
7058
7051#define SET_SYSCTL(name) \ 7059#define SET_SYSCTL(name) \
7052 (sysctl_##name = (factor) * normalized_sysctl_##name) 7060 (sysctl_##name = (factor) * normalized_sysctl_##name)
7053 SET_SYSCTL(sched_min_granularity); 7061 SET_SYSCTL(sched_min_granularity);