From: Alejandro Colomar <alx@kernel.org>
To: Svetly Todorov <svetly.todorov@memverge.com>
Cc: linux-man@vger.kernel.org, gregory.price@memverge.com,
ying.huang@intel.com
Subject: Re: [PATCH v3] man2: add MPOL_WEIGHTED_INTERLEAVE documentation
Date: Sat, 16 Mar 2024 00:52:47 +0100 [thread overview]
Message-ID: <ZfTfUMG-LGPnhqHe@debian> (raw)
In-Reply-To: <20240315-weighted_interleave-v3-1-416a1ab01524@memverge.com>
[-- Attachment #1: Type: text/plain, Size: 5248 bytes --]
Hi Svetly,
On Fri, Mar 15, 2024 at 04:43:36PM -0700, Svetly Todorov wrote:
>
>
> ---
> Adding documentation for the new MPOL_WEIGHTED_INTERLEAVE mode in the same
> manpages that mention MPOL_INTERLEAVE; namely, mbind(2), set_mempolicy(2),
> and get_mempolicy(2).
>
> Descriptions were based on the changes introduced in this patch:
> https://lore.kernel.org/all/20240202170238.90004-4-gregory.price@memverge.com/
>
> Which was upstreamed to 6.9 here:
> https://lore.kernel.org/linux-mm/20240313200532.34e4cff216acd3db8def4637@linux-foundation.org/
>
> To: alx@kernel.org
> Cc: linux-man@vger.kernel.org
> Cc: gregory.price@memverge.com
> Cc: ying.huang@intel.com
Please add those to the commit message.
Content-wise, the patch LGTM. I have some comments about formatting.
Please see below.
Have a lovely night!
Alex
> Signed-off-by: Svetly Todorov <svetly.todorov@memverge.com>
>
> Changes in v3:
> - italicize paths
> - Link to v2: https://lore.kernel.org/r/20240315-weighted_interleave-v2-1-b742a48750b0@memverge.com
>
> Changes in v2:
> - make flag documentation implementation-agnostic
> - Link to v1: https://lore.kernel.org/r/20240314-weighted_interleave-v1-1-ce85d64db0d4@memverge.com
> ---
> man2/get_mempolicy.2 | 8 ++++++--
> man2/mbind.2 | 17 +++++++++++++++++
> man2/set_mempolicy.2 | 17 +++++++++++++++++
> 3 files changed, 40 insertions(+), 2 deletions(-)
>
> diff --git a/man2/get_mempolicy.2 b/man2/get_mempolicy.2
> index 5248f04ba..03550331d 100644
> --- a/man2/get_mempolicy.2
> +++ b/man2/get_mempolicy.2
> @@ -137,7 +137,9 @@ specifies
> but not
> .BR MPOL_F_ADDR ,
> and the thread's current policy is
> -.BR MPOL_INTERLEAVE ,
> +.BR MPOL_INTERLEAVE
This should be B, not BR (BR is for alternating Bold and Roman).
> +or
> +.BR MPOL_WEIGHTED_INTERLEAVE ,
> then
> .BR get_mempolicy ()
> will return in the location pointed to by a non-NULL
> @@ -206,7 +208,9 @@ specified
> but not
> .B MPOL_F_ADDR
> and the current thread policy is not
> -.BR MPOL_INTERLEAVE .
> +.BR MPOL_INTERLEAVE
> +or
> +.BR MPOL_WEIGHTED_INTERLEAVE .
> Or,
> .I flags
> specified
> diff --git a/man2/mbind.2 b/man2/mbind.2
> index b0e961f9c..6f85dec0e 100644
> --- a/man2/mbind.2
> +++ b/man2/mbind.2
> @@ -105,6 +105,7 @@ argument must specify one of
> .BR MPOL_DEFAULT ,
> .BR MPOL_BIND ,
> .BR MPOL_INTERLEAVE ,
> +.BR MPOL_WEIGHTED_INTERLEAVE ,
> .BR MPOL_PREFERRED ,
> or
> .B MPOL_LOCAL
> @@ -243,6 +244,22 @@ at least 1\ MB or bigger with a fairly uniform access pattern.
> Accesses to a single page of the area will still be limited to
> the memory bandwidth of a single node.
> .TP
> +.B MPOL_WEIGHTED_INTERLEAVE
> +This mode interleaves page allocations across the nodes specified in
> +.I nodemask
> +according to the weights in
> +.IR /sys/kernel/mm/mempolicy/weighted_interleave .
> +For example, if bits 0, 2, and 5 are raised in
> +.IR nodemask ,
> +and the contents of
> +.IR /sys/kernel/mm/mempolicy/weighted_interleave/node0 ,
> +.IR /sys/.../node2 ,
Since ... is variable stuff inside an italicised word, according to the
groff_man_style(7) paragraph I quoted, it should be in Roman. So,
.IR /sys/ ... /node2 ,
Also, for better formatting of the '...', we use \| between the dots,
which on proportional fonts (in PDF, or HTML, for example) will produce
nicer elipses. So,
.IR /sys/ .\|.\|. /node2 ,
> +and
> +.I /sys/.../node5
> +are 4, 7, and 9, respectively,
> +then pages in this region will be allocated on nodes 0, 2, and 5
> +in a 4:7:9 ratio.
> +.TP
> .B MPOL_PREFERRED
> This mode sets the preferred node for allocation.
> The kernel will try to allocate pages from this
> diff --git a/man2/set_mempolicy.2 b/man2/set_mempolicy.2
> index fc3ad9df8..6b51cb376 100644
> --- a/man2/set_mempolicy.2
> +++ b/man2/set_mempolicy.2
> @@ -63,6 +63,7 @@ argument must specify one of
> .BR MPOL_DEFAULT ,
> .BR MPOL_BIND ,
> .BR MPOL_INTERLEAVE ,
> +.BR MPOL_WEIGHTED_INTERLEAVE ,
> .BR MPOL_PREFERRED ,
> or
> .B MPOL_LOCAL
> @@ -199,6 +200,22 @@ the memory bandwidth of a single node.
> .\" To be effective the memory area should be fairly large,
> .\" at least 1 MB or bigger.
> .TP
> +.B MPOL_WEIGHTED_INTERLEAVE
> +This mode interleaves page allocations across the nodes specified in
> +.I nodemask
> +according to the weights in
> +.IR /sys/kernel/mm/mempolicy/weighted_interleave .
> +For example, if bits 0, 2, and 5 are raised in
> +.IR nodemask ,
> +and the contents of
> +.IR /sys/kernel/mm/mempolicy/weighted_interleave/node0 ,
> +.IR /sys/.../node2 ,
> +and
> +.I /sys/.../node5
> +are 4, 7, and 9, respectively,
> +then pages in this region will be allocated on nodes 0, 2, and 5
> +in a 4:7:9 ratio.
> +.TP
> .B MPOL_PREFERRED
> This mode sets the preferred node for allocation.
> The kernel will try to allocate pages from this node first
>
> ---
> base-commit: a4ea5f76215dcf1d8d017eb65ab12919ccf09f3f
> change-id: 20240313-weighted_interleave-e8141ed754f9
>
> Best regards,
> --
> Svetly Todorov <svetly.todorov@memverge.com>
>
>
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-03-15 23:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-15 23:43 [PATCH v3] man2: add MPOL_WEIGHTED_INTERLEAVE documentation Svetly Todorov
2024-03-15 23:52 ` Alejandro Colomar [this message]
2024-03-16 19:21 ` Svetly Todorov
2024-03-16 19:36 ` Alejandro Colomar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZfTfUMG-LGPnhqHe@debian \
--to=alx@kernel.org \
--cc=gregory.price@memverge.com \
--cc=linux-man@vger.kernel.org \
--cc=svetly.todorov@memverge.com \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox