man/man2/getrusage.2: clarify ru_maxrss unit as kibibytes (KiB)
PATCH 1/1 man/man2/getrusage.2: clarify ru_maxrss unit as kibibytes (KiB)
From: Alex Yang <[email protected]>
The ru_maxrss field was previously documented as using "kilobytes" as its unit. However, the value is actually in multiples of 1024 bytes, which is correctly referred to as "kibibytes" (KiB) according to the IEC standard. This change updates the documentation to use the precise term.
Reference:
https://en.wikipedia.org/wiki/Kibibyte
--- man/man2/getrusage.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man/man2/getrusage.2 +1 -1
@@ -88,7 +88,7 @@ expressed in a structure (seconds plus microseconds). .TP .IR ru_maxrss " (since Linux 2.6.32)" -This is the maximum resident set size used (in kilobytes). +This is the maximum resident set size used (in kibibytes). For .BR RUSAGE_CHILDREN , this is the resident set size of the largest child, not the maximum
Signature · 1 line
2.39.5 (Apple Git-154)
Alejandro Colomar
maintainerHi Alex,
Quoted 15 lines · Your Name
From: Alex Yang <[email protected]>
The
ru_maxrssfield was previously documented as using "kilobytes" as its unit. However, the value is actually in multiples of 1024 bytes, which is correctly referred to as "kibibytes" (KiB) according to the IEC standard. This change updates the documentation to use the precise term.Reference:
https://en.wikipedia.org/wiki/Kibibyte--- man/man2/getrusage.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)man/man2/getrusage.2 +0
-0
man/man2/getrusage.2 expressed in a · line 91
Quoted 5 lines
man/man2/getrusage.2 +1
-1@@ -88,7 +88,7 @@ expressed in a structure (seconds plus microseconds). .TP .IR ru_maxrss " (since Linux 2.6.32)" -This is the maximum resident set size used (in kilobytes). +This is the maximum resident set size used (in kibibytes).
Should we maybe say this?
(in KiB).
I personally am fine with kibibytes (it's even documented in units(7)). However, in the past, I've met many people that didn't know the term existed. KiB is more widely known.
What do you think?
Have a lovely day!
Alex
Quoted 6 lines
man/man2/getrusage.2 +0
-0For .BR RUSAGE_CHILDREN , this is the resident set size of the largest child, not the maximumSignature · 1 line
2.39.5 (Apple Git-154)
Signature · 1 line
<https://www.alejandro-colomar.es/>
Quoted 6 lines · Alejandro Colomar
man/man2/getrusage.2 expressed in a · line 91
Quoted 2 lines
man/man2/getrusage.2 +1
-1-This is the maximum resident set size used (in kilobytes). +This is the maximum resident set size used (in kibibytes).Should we maybe say this?
(in KiB).
This sounds better to me based on it's use elsewhere:
$ grep --exclude-dir=.git -rl 'KiB'
man/man2/ioctl_fsmap.2
man/man2/process_vm_readv.2
man/man2/readv.2
man/man2/alloc_hugepages.2
man/man3/btree.3
man/man4/fd.4
man/man5/proc_kcore.5
man/man5/proc_sys_vm.5
man/man7/units.7Writing out the full name of the IEC unit is much less common:
$ grep --exclude-dir=.git -rl 'kibi'
man/man2/msgctl.2
man/man5/tmpfs.5
man/man7/units.7Collin
Alejandro Colomar
maintainerHi Collin, Alex,
Quoted 4 lines · Collin Funk
Quoted 2 lines · Alejandro Colomar
man/man2/getrusage.2 expressed in a · line 91
Quoted 2 lines
man/man2/getrusage.2 +1
-1-This is the maximum resident set size used (in kilobytes). +This is the maximum resident set size used (in kibibytes).
BTW, Alex, could you show a link to the relevant source code? Or maybe a small test program that demonstrates this? How do you know it's in KiB and not in KB?
Quoted 9 lines
Quoted 4 lines
Should we maybe say this?
(in KiB).This sounds better to me based on it's use elsewhere:
$ grep --exclude-dir=.git -rl 'KiB'
I often use 'grep regex *' as a simpler way to avoid '.git'. Also, the build system's temporary files are created under .tmp, where I also don't want to search.
Quoted 10 lines
man/man2/ioctl_fsmap.2
man/man2/process_vm_readv.2
man/man2/readv.2
man/man2/alloc_hugepages.2
man/man3/btree.3
man/man4/fd.4
man/man5/proc_kcore.5
man/man5/proc_sys_vm.5
man/man7/units.7Quoted 6 lines
Writing out the full name of the IEC unit is much less common:
$ grep --exclude-dir=.git -rl 'kibi' man/man2/msgctl.2 man/man5/tmpfs.5 man/man7/units.7
Thanks!
Have a lovely day!
Alex
Signature · 1 line
<https://www.alejandro-colomar.es/>
PATCH 1/1 man/man2/getrusage.2: clarify ru_maxrss unit as KiB
The ru_maxrss field was previously documented as using "kilobytes" as its unit. However, the value is actually in multiples of 1024 bytes, which is correctly referred to as "kibibytes" (KiB) according to the IEC standard. This change updates the documentation to use the precise term.
--- man/man2/getrusage.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man/man2/getrusage.2 +1 -1
@@ -88,7 +88,7 @@ expressed in a structure (seconds plus microseconds). .TP .IR ru_maxrss " (since Linux 2.6.32)" -This is the maximum resident set size used (in kilobytes). +This is the maximum resident set size used (in KiB). For .BR RUSAGE_CHILDREN , this is the resident set size of the largest child, not the maximum
Signature · 1 line
2.50.1
Alejandro Colomar
maintainerRe: [PATCH] man/man2/getrusage.2: clarify ru_maxrss unit as KiB
Hi Alex,
Quoted 1 line · Alex Yang
The
ru_maxrssfield was previously documented as using "kilobytes" as its unit. However, the value is actually in multiples of 1024 bytes, which is correctly referred to as "kibibytes" (KiB) according to the IEC standard. This change updates the documentation to use the precise term.
Thanks! I have applied the patch.
Have a lovely day!
Alex
Quoted 21 lines
--- man/man2/getrusage.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)man/man2/getrusage.2 +1
-1@@ -88,7 +88,7 @@ expressed in a structure (seconds plus microseconds). .TP .IR ru_maxrss " (since Linux 2.6.32)" -This is the maximum resident set size used (in kilobytes). +This is the maximum resident set size used (in KiB). For .BR RUSAGE_CHILDREN , this is the resident set size of the largest child, not the maximumSignature · 1 line
2.50.1
Signature · 1 line
<https://www.alejandro-colomar.es/>
Re: [PATCH] man/man2/getrusage.2: clarify ru_maxrss unit as KiB
In reply to Alejandro ColomarYes, I think the related code is from getrusage in sys.c:
https://github.com/torvalds/linux/blob/c17b750b3ad9f45f2b6f7e6f7f4679844244f0b9/kernel/sys.c#L1911
This code shows that ru_maxrss is reported in units of 1024 bytes, which means it is in kibibytes (KiB), not kilobytes (KB).