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
#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.

1 Answer 1


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 */


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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