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?

有帮助吗?

解决方案

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, ...)).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top