Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Why do I get an error message when I try to increase the values of these two parameters:

#cat /proc/sys/kernel/sched_latency_ns
1000000000
#echo 2000000000 > /proc/sys/kernel/sched_latency_ns
bash: echo: write error: Invalid argument
#

I get the same error when I replace sched_latency_ns by sched_min_granularity_ns.

Can someone tell me the correct way to increase these parameters.

share|improve this question
add comment

1 Answer

One second is the absolute maximum accepted value for that setting. Values more than 1000000000 are not valid (the number of nanoseconds in one second).

See the kernel source code

262 static int max_sched_granularity_ns = NSEC_PER_SEC;     /* 1 second */

and

line 294

294         {
295                 .procname       = "sched_latency_ns",
296                 .data           = &sysctl_sched_latency,
297                 .maxlen         = sizeof(unsigned int),
298                 .mode           = 0644,
299                 .proc_handler   = sched_proc_update_handler,
300                 .extra1         = &min_sched_granularity_ns,
301                 .extra2         = &max_sched_granularity_ns,
302         },

Larger and larger values have a diminishing improvement on performance. Excessively high values can cause issues. One second is already an extremely high setting.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.