diff options
author | Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> | 2009-11-30 06:16:48 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-09 04:04:02 -0500 |
commit | acb4a848da821a095ae9e4d8b22ae2d9633ba5cd (patch) | |
tree | 152efff68841e554eb71c82a97d3ed9571352581 /kernel/sysctl.c | |
parent | 1983a922a1bc843806b9a36cf3a370b242783140 (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/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index d10406e5fdfe..b9e5a45f1e28 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -253,6 +253,8 @@ static int min_wakeup_granularity_ns; /* 0 usecs */ | |||
253 | static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ | 253 | static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ |
254 | static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE; | 254 | static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE; |
255 | static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1; | 255 | static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1; |
256 | static int min_sched_shares_ratelimit = 100000; /* 100 usec */ | ||
257 | static int max_sched_shares_ratelimit = NSEC_PER_SEC; /* 1 second */ | ||
256 | #endif | 258 | #endif |
257 | 259 | ||
258 | static struct ctl_table kern_table[] = { | 260 | static struct ctl_table kern_table[] = { |
@@ -271,7 +273,7 @@ static struct ctl_table kern_table[] = { | |||
271 | .data = &sysctl_sched_min_granularity, | 273 | .data = &sysctl_sched_min_granularity, |
272 | .maxlen = sizeof(unsigned int), | 274 | .maxlen = sizeof(unsigned int), |
273 | .mode = 0644, | 275 | .mode = 0644, |
274 | .proc_handler = &sched_nr_latency_handler, | 276 | .proc_handler = &sched_proc_update_handler, |
275 | .strategy = &sysctl_intvec, | 277 | .strategy = &sysctl_intvec, |
276 | .extra1 = &min_sched_granularity_ns, | 278 | .extra1 = &min_sched_granularity_ns, |
277 | .extra2 = &max_sched_granularity_ns, | 279 | .extra2 = &max_sched_granularity_ns, |
@@ -282,7 +284,7 @@ static struct ctl_table kern_table[] = { | |||
282 | .data = &sysctl_sched_latency, | 284 | .data = &sysctl_sched_latency, |
283 | .maxlen = sizeof(unsigned int), | 285 | .maxlen = sizeof(unsigned int), |
284 | .mode = 0644, | 286 | .mode = 0644, |
285 | .proc_handler = &sched_nr_latency_handler, | 287 | .proc_handler = &sched_proc_update_handler, |
286 | .strategy = &sysctl_intvec, | 288 | .strategy = &sysctl_intvec, |
287 | .extra1 = &min_sched_granularity_ns, | 289 | .extra1 = &min_sched_granularity_ns, |
288 | .extra2 = &max_sched_granularity_ns, | 290 | .extra2 = &max_sched_granularity_ns, |
@@ -293,7 +295,7 @@ static struct ctl_table kern_table[] = { | |||
293 | .data = &sysctl_sched_wakeup_granularity, | 295 | .data = &sysctl_sched_wakeup_granularity, |
294 | .maxlen = sizeof(unsigned int), | 296 | .maxlen = sizeof(unsigned int), |
295 | .mode = 0644, | 297 | .mode = 0644, |
296 | .proc_handler = &proc_dointvec_minmax, | 298 | .proc_handler = &sched_proc_update_handler, |
297 | .strategy = &sysctl_intvec, | 299 | .strategy = &sysctl_intvec, |
298 | .extra1 = &min_wakeup_granularity_ns, | 300 | .extra1 = &min_wakeup_granularity_ns, |
299 | .extra2 = &max_wakeup_granularity_ns, | 301 | .extra2 = &max_wakeup_granularity_ns, |
@@ -304,7 +306,9 @@ static struct ctl_table kern_table[] = { | |||
304 | .data = &sysctl_sched_shares_ratelimit, | 306 | .data = &sysctl_sched_shares_ratelimit, |
305 | .maxlen = sizeof(unsigned int), | 307 | .maxlen = sizeof(unsigned int), |
306 | .mode = 0644, | 308 | .mode = 0644, |
307 | .proc_handler = &proc_dointvec, | 309 | .proc_handler = &sched_proc_update_handler, |
310 | .extra1 = &min_sched_shares_ratelimit, | ||
311 | .extra2 = &max_sched_shares_ratelimit, | ||
308 | }, | 312 | }, |
309 | { | 313 | { |
310 | .ctl_name = CTL_UNNUMBERED, | 314 | .ctl_name = CTL_UNNUMBERED, |
@@ -312,7 +316,7 @@ static struct ctl_table kern_table[] = { | |||
312 | .data = &sysctl_sched_tunable_scaling, | 316 | .data = &sysctl_sched_tunable_scaling, |
313 | .maxlen = sizeof(enum sched_tunable_scaling), | 317 | .maxlen = sizeof(enum sched_tunable_scaling), |
314 | .mode = 0644, | 318 | .mode = 0644, |
315 | .proc_handler = &proc_dointvec_minmax, | 319 | .proc_handler = &sched_proc_update_handler, |
316 | .strategy = &sysctl_intvec, | 320 | .strategy = &sysctl_intvec, |
317 | .extra1 = &min_sched_tunable_scaling, | 321 | .extra1 = &min_sched_tunable_scaling, |
318 | .extra2 = &max_sched_tunable_scaling, | 322 | .extra2 = &max_sched_tunable_scaling, |