]> git.openpandora.org Git - pandora-kernel.git/commitdiff
sched: Update normalized values on user updates via proc
authorChristian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Mon, 30 Nov 2009 11:16:48 +0000 (12:16 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 9 Dec 2009 09:04:02 +0000 (10:04 +0100)
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>
kernel/sched.c
kernel/sched_fair.c
kernel/sysctl.c

index 116efed962c6e4bb747b17a955915758f636040c..0a60e8e9b094cf8b0a195d43d0ab22030ff72628 100644 (file)
@@ -1816,6 +1816,7 @@ static void cfs_rq_set_shares(struct cfs_rq *cfs_rq, unsigned long shares)
 
 static void calc_load_account_active(struct rq *this_rq);
 static void update_sysctl(void);
+static int get_update_sysctl_factor(void);
 
 static inline void __set_task_cpu(struct task_struct *p, unsigned int cpu)
 {
@@ -7030,9 +7031,9 @@ cpumask_var_t nohz_cpu_mask;
  *
  * This idea comes from the SD scheduler of Con Kolivas:
  */
-static void update_sysctl(void)
+static int get_update_sysctl_factor(void)
 {
-       unsigned int cpus = min(num_online_cpus(), 8U);
+       unsigned int cpus = min(num_online_cpus(), 8);
        unsigned int factor;
 
        switch (sysctl_sched_tunable_scaling) {
@@ -7048,6 +7049,13 @@ static void update_sysctl(void)
                break;
        }
 
+       return factor;
+}
+
+static void update_sysctl(void)
+{
+       unsigned int factor = get_update_sysctl_factor();
+
 #define SET_SYSCTL(name) \
        (sysctl_##name = (factor) * normalized_sysctl_##name)
        SET_SYSCTL(sched_min_granularity);
Simple merge
diff --cc kernel/sysctl.c
Simple merge