linuxlinux-kernelschedulingnicerenice

Nice and Renice commands


I am interested in knowing what are the kernel side methods that get called when you issue the nice and renice commands? I found the set_user_nice() in the kernel side. However it's arguments are not pid and nice value, which we use when we issue the command renice(a taskstruct & nice value). Dose anyone know what functions gets called when you issue nice & renice commands?


Solution

  • The nice and renice commands invoke the setpriority syscall. (You can discover this with strace.)

    The setpriority function invokes the sys_setpriority function in the kernel (though you won't find that name in the kernel source directly; it's generated from the macro-expansion of SYSCALL_DEFINE3(setpriority, ...)).