* [PATCH] man/man2/getrusage.2: clarify ru_maxrss unit as kibibytes (KiB)
@ 2025-08-18 6:12 Your Name
2025-08-18 6:30 ` Alejandro Colomar
0 siblings, 1 reply; 7+ messages in thread
From: Your Name @ 2025-08-18 6:12 UTC (permalink / raw)
To: alx; +Cc: linux-man, Alex Yang
From: Alex Yang <himself65@outlook.com>
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(-)
diff --git a/man/man2/getrusage.2 b/man/man2/getrusage.2
index 34e81f540..13c405d0e 100644
--- a/man/man2/getrusage.2
+++ b/man/man2/getrusage.2
@@ -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
--
2.39.5 (Apple Git-154)
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] man/man2/getrusage.2: clarify ru_maxrss unit as kibibytes (KiB)
2025-08-18 6:12 [PATCH] man/man2/getrusage.2: clarify ru_maxrss unit as kibibytes (KiB) Your Name
@ 2025-08-18 6:30 ` Alejandro Colomar
2025-08-18 6:52 ` Collin Funk
0 siblings, 1 reply; 7+ messages in thread
From: Alejandro Colomar @ 2025-08-18 6:30 UTC (permalink / raw)
To: Alex Yang; +Cc: linux-man, Alex Yang
[-- Attachment #1: Type: text/plain, Size: 1438 bytes --]
Hi Alex,
On Sun, Aug 17, 2025 at 11:12:03PM -0700, Your Name wrote:
> From: Alex Yang <himself65@outlook.com>
>
> 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(-)
>
> diff --git a/man/man2/getrusage.2 b/man/man2/getrusage.2
> index 34e81f540..13c405d0e 100644
> --- a/man/man2/getrusage.2
> +++ b/man/man2/getrusage.2
> @@ -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
> For
> .BR RUSAGE_CHILDREN ,
> this is the resident set size of the largest child, not the maximum
> --
> 2.39.5 (Apple Git-154)
>
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] man/man2/getrusage.2: clarify ru_maxrss unit as kibibytes (KiB)
2025-08-18 6:30 ` Alejandro Colomar
@ 2025-08-18 6:52 ` Collin Funk
2025-08-18 6:58 ` Alejandro Colomar
0 siblings, 1 reply; 7+ messages in thread
From: Collin Funk @ 2025-08-18 6:52 UTC (permalink / raw)
To: Alejandro Colomar; +Cc: Alex Yang, linux-man, Alex Yang
[-- Attachment #1: Type: text/plain, Size: 716 bytes --]
Alejandro Colomar <alx@kernel.org> writes:
>> -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.7
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
Collin
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] man/man2/getrusage.2: clarify ru_maxrss unit as kibibytes (KiB)
2025-08-18 6:52 ` Collin Funk
@ 2025-08-18 6:58 ` Alejandro Colomar
2025-08-18 7:59 ` [PATCH] man/man2/getrusage.2: clarify ru_maxrss unit as KiB Alex Yang
2025-08-18 8:19 ` Alex Yang
0 siblings, 2 replies; 7+ messages in thread
From: Alejandro Colomar @ 2025-08-18 6:58 UTC (permalink / raw)
To: Collin Funk; +Cc: Alex Yang, linux-man, Alex Yang
[-- Attachment #1: Type: text/plain, Size: 1297 bytes --]
Hi Collin, Alex,
On Sun, Aug 17, 2025 at 11:52:39PM -0700, Collin Funk wrote:
> Alejandro Colomar <alx@kernel.org> writes:
>
> >> -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?
> >
> > 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.
> 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.7
>
> 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
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] man/man2/getrusage.2: clarify ru_maxrss unit as KiB
2025-08-18 6:58 ` Alejandro Colomar
@ 2025-08-18 7:59 ` Alex Yang
2025-08-18 9:36 ` Alejandro Colomar
2025-08-18 8:19 ` Alex Yang
1 sibling, 1 reply; 7+ messages in thread
From: Alex Yang @ 2025-08-18 7:59 UTC (permalink / raw)
To: alx; +Cc: linux-man, Alex Yang
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(-)
diff --git a/man/man2/getrusage.2 b/man/man2/getrusage.2
index 34e81f540..a1b30e5b5 100644
--- a/man/man2/getrusage.2
+++ b/man/man2/getrusage.2
@@ -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
--
2.50.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] man/man2/getrusage.2: clarify ru_maxrss unit as KiB
2025-08-18 7:59 ` [PATCH] man/man2/getrusage.2: clarify ru_maxrss unit as KiB Alex Yang
@ 2025-08-18 9:36 ` Alejandro Colomar
0 siblings, 0 replies; 7+ messages in thread
From: Alejandro Colomar @ 2025-08-18 9:36 UTC (permalink / raw)
To: Alex Yang; +Cc: linux-man
[-- Attachment #1: Type: text/plain, Size: 1104 bytes --]
Hi Alex,
On Mon, Aug 18, 2025 at 12:59:05AM -0700, Alex Yang wrote:
> 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.
Thanks! I have applied the patch.
Have a lovely day!
Alex
> ---
> man/man2/getrusage.2 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/man/man2/getrusage.2 b/man/man2/getrusage.2
> index 34e81f540..a1b30e5b5 100644
> --- a/man/man2/getrusage.2
> +++ b/man/man2/getrusage.2
> @@ -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
> --
> 2.50.1
>
>
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] man/man2/getrusage.2: clarify ru_maxrss unit as KiB
2025-08-18 6:58 ` Alejandro Colomar
2025-08-18 7:59 ` [PATCH] man/man2/getrusage.2: clarify ru_maxrss unit as KiB Alex Yang
@ 2025-08-18 8:19 ` Alex Yang
1 sibling, 0 replies; 7+ messages in thread
From: Alex Yang @ 2025-08-18 8:19 UTC (permalink / raw)
To: alx; +Cc: collin.funk1, himself6565, himself65, linux-man
Yes, 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).
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-08-18 9:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18 6:12 [PATCH] man/man2/getrusage.2: clarify ru_maxrss unit as kibibytes (KiB) Your Name
2025-08-18 6:30 ` Alejandro Colomar
2025-08-18 6:52 ` Collin Funk
2025-08-18 6:58 ` Alejandro Colomar
2025-08-18 7:59 ` [PATCH] man/man2/getrusage.2: clarify ru_maxrss unit as KiB Alex Yang
2025-08-18 9:36 ` Alejandro Colomar
2025-08-18 8:19 ` Alex Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox