Re: [patch] nice.2: wfix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jakub!

On 12/14/22 16:28, Jakub Wilk wrote:
* Alejandro Colomar <alx.manpages@xxxxxxxxx>, 2022-12-11 18:33:
-to the nice value for the calling thread.
+to the nice value for the calling process.

nice() affecting the whole process, not just the calling thread, is what POSIX requires, and what glibc documents, but it's not actually how it works on Linux at the moment[*].

This is documented in the setpriority(2) man page:

"According to POSIX, the nice value is a per-process setting. However, under the current Linux/NPTL implementation of POSIX threads, the nice value is a per-thread attribute: different threads in the same process can have different nice values. Portable applications should avoid relying on the Linux behavior, which may be made standards conformant in the future."

It would be prudent to document this bug in the nice(2) man page too.


[*] I've tested this with Linux 6.0 + glibc 2.36.
See the attached test program.

I think that patch would be a great example for the page. Would you mind sending it as a patch?

Thanks,

Alex



--
<http://www.alejandro-colomar.es/>

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux