From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C038F367 for ; Tue, 23 Apr 2024 23:46:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713915994; cv=none; b=YKOcNVnQmg1r/LwihjRzHDiezzF7CheLbmEiez8hpSY5hqT+s+hvz86aCtpXUkNuqWkMB7IM2FVltDEfVTcqJ9apHA8tqwQmuC6p3vgS918TOMdiXdh4w939/gkC2nGqfR/j05dntC8xAWss1MG7qAbDwFgw6CvCjaLlh8equXw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713915994; c=relaxed/simple; bh=r3z0f5VRljAgVa6KEF3iteXDoruMEAW4XCz+p9DzvZg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=X/0G47u+IPLxIQrvEDTkmZ+kLPpUa9rgzSeRkJfhr9DuCMcJmcDcdPiDpWze/sKjQPc+fr9dx1av/vthyFF09H8N3F/yIRpjL3S4r97Ju4JBT8fhAwac5nZpVVL04bQPVkuw0gbwwGE5qkH3oneUFcnho9PjU68fWsbvRYPJRzg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uuBPoRBF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uuBPoRBF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45EAEC4AF07; Tue, 23 Apr 2024 23:46:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713915994; bh=r3z0f5VRljAgVa6KEF3iteXDoruMEAW4XCz+p9DzvZg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uuBPoRBFyckElBiLBU9W6rCDesfQbpmRVlXqKGi1RMmOvGgJH2axSZptgQYyPzwM4 AGcBBuhmaqVEoBUSZYOMdc3dqnclV+8vcQpntI3YUB0hktqBz8Q2RbV4yHR6WrgEmq p1Nr45ixlD4HSeUswGWUTNNAXQ4SHL0EJKFdmhODM6xxINYL9PJfFbTLUKQjc+yNr5 nS4aMozy5HDrFr6QB5j747EZgNPApU7e2df5q2bjf6xwhHvcjwBcwPAqqGtT3rlCUL YVDpQKlEVay1BvjCttWGFIQSa149U54bptV/IGY+UqIT+jFBWx1HwIybqdppnYJQYq pDCUodRlLbOlw== Date: Wed, 24 Apr 2024 01:46:30 +0200 From: Alejandro Colomar To: Svetly Todorov Cc: linux-man@vger.kernel.org, gregory.price@memverge.com, ying.huang@intel.com Subject: Re: [PATCH v7] man2: add MPOL_WEIGHTED_INTERLEAVE documentation Message-ID: References: <20240423-weighted_interleave-v7-1-0d91158a4eea@memverge.com> Precedence: bulk X-Mailing-List: linux-man@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="FluRoNx+P1SWza9W" Content-Disposition: inline In-Reply-To: <20240423-weighted_interleave-v7-1-0d91158a4eea@memverge.com> --FluRoNx+P1SWza9W Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Wed, 24 Apr 2024 01:46:30 +0200 From: Alejandro Colomar To: Svetly Todorov Cc: linux-man@vger.kernel.org, gregory.price@memverge.com, ying.huang@intel.com Subject: Re: [PATCH v7] man2: add MPOL_WEIGHTED_INTERLEAVE documentation Hi Svetly, On Tue, Apr 23, 2024 at 11:28:31PM +0000, Svetly Todorov wrote: > Hi Alex, > > Surprised I missed this message. Better late than never, I hope... No problem! :-) On Tue, Apr 23, 2024 at 04:36:56PM -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). >=20 > Descriptions were based on the changes introduced in this patch:=20 > https://lore.kernel.org/all/20240202170238.90004-4-gregory.price@memverge= =2Ecom/ >=20 > Which was upstreamed to 6.9 here: > https://lore.kernel.org/linux-mm/20240313200532.34e4cff216acd3db8def4637@= linux-foundation.org/ >=20 > To: alx@kernel.org > Cc: linux-man@vger.kernel.org > Cc: gregory.price@memverge.com > Cc: ying.huang@intel.com > Reviewed-by: "Huang, Ying" > Signed-off-by: Svetly Todorov Minor inconvenience: I'd prefer if the above was inside the commit message. Anyway, I've pasted it in; not a big problem. Patch applied. Have a lovely night! Alex > Changes in v7: > - raised -> set > - Link to v6: https://lore.kernel.org/r/20240402-weighted_interleave-v6-1= -4c2891901352@memverge.com >=20 > Changes in v6: > - either/or -> neither/nor > - remove version parentheticals in get_mempolicy.2 > - Link to v5: https://lore.kernel.org/r/20240318-weighted_interleave-v5-1= -c821a46d5beb@memverge.com >=20 > Changes in v5: > - document kernel version where WEIGHTED_INTERLEAVE was added > - Link to v4: https://lore.kernel.org/r/20240316-weighted_interleave-v4-1= -6ab516f12ced@memverge.com >=20 > Changes in v4: > - BR -> B in get_mempolicy > - use roman for ellipses; format using \| > - Link to v3: https://lore.kernel.org/r/20240315-weighted_interleave-v3-1= -416a1ab01524@memverge.com >=20 > Changes in v3: > - italicize paths > - Link to v2: https://lore.kernel.org/r/20240315-weighted_interleave-v2-1= -b742a48750b0@memverge.com >=20 > 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 | 10 +++++++--- > man2/mbind.2 | 18 ++++++++++++++++++ > man2/set_mempolicy.2 | 18 ++++++++++++++++++ > 3 files changed, 43 insertions(+), 3 deletions(-) >=20 > diff --git a/man2/get_mempolicy.2 b/man2/get_mempolicy.2 > index 5248f04ba..f6f80ab3e 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 , > +.B MPOL_INTERLEAVE > +or > +.BR MPOL_WEIGHTED_INTERLEAVE , > then > .BR get_mempolicy () > will return in the location pointed to by a non-NULL > @@ -205,8 +207,10 @@ specified > .B MPOL_F_NODE > but not > .B MPOL_F_ADDR > -and the current thread policy is not > -.BR MPOL_INTERLEAVE . > +and the current thread policy is neither > +.B MPOL_INTERLEAVE > +nor > +.BR MPOL_WEIGHTED_INTERLEAVE . > Or, > .I flags > specified > diff --git a/man2/mbind.2 b/man2/mbind.2 > index b0e961f9c..96264ce81 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,23 @@ at least 1\ MB or bigger with a fairly uniform acces= s pattern. > Accesses to a single page of the area will still be limited to > the memory bandwidth of a single node. > .TP > +.BR MPOL_WEIGHTED_INTERLEAVE " (since Linux 6.9)" > +.\" commit fa3bea4e1f8202d787709b7e3654eb0a99aed758 > +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 set in > +.IR nodemask , > +and the contents of > +.IR /sys/kernel/mm/mempolicy/weighted_interleave/node0 , > +.IR /sys/ .\|.\|. /node2 , > +and > +.IR /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..f1f225e32 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,23 @@ the memory bandwidth of a single node. > .\" To be effective the memory area should be fairly large, > .\" at least 1 MB or bigger. > .TP > +.BR MPOL_WEIGHTED_INTERLEAVE " (since Linux 6.9)" > +.\" commit fa3bea4e1f8202d787709b7e3654eb0a99aed758 > +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 set in > +.IR nodemask , > +and the contents of > +.IR /sys/kernel/mm/mempolicy/weighted_interleave/node0 , > +.IR /sys/ .\|.\|. /node2 , > +and > +.IR /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 >=20 > --- > base-commit: a4ea5f76215dcf1d8d017eb65ab12919ccf09f3f > change-id: 20240313-weighted_interleave-e8141ed754f9 >=20 > Best regards, > --=20 > Svetly Todorov >=20 --=20 --FluRoNx+P1SWza9W Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE6jqH8KTroDDkXfJAnowa+77/2zIFAmYoSFYACgkQnowa+77/ 2zJAow//eBzY0nzcGDlEDS0kPSB6a4a6R76ZhbEQIr9/6s7jsSXEel4mk7RjtOao NEUfh0WIG2KT4aov5r9bUONbr6PxfcOJSTDsCT+hutHMHYDPDzeJub3Te6wFDpSS AVH1P7YbETJvSA5gi8pHVUof4AgU/TVW8HG4dumMJWYWTFSQyP7FrNpmYo1SHxzM awTseABKLr+dFoQUWpsz9/ElIJyuRALp3BtraQOR4pAZhRLTMx6G8+Aqf4hYnpGe 69o8lNOTGiBsm4dbyoOmYUPlhMs0RgnU5yt24nPClIxoujHXNJKeRVxC8Aq/JQYO ssSzFlTQTm0EgG6Z5ZCz7A9S1CmI58Ujew+7A+5KWIvvtTb3QbCoqMxuOyN30Emv knJUH3NFuWLI4PhLill4lUdeJ2y6iAK7igR+G3j027n/k/uRX1koLvdo7t1eQxP+ 7+MMGsX4i8EsTaN2PanxgY++7lARBQ6YfxCq2P9KRDIaE8KN86q222aDSUx3coo8 St5+WGmHpQ52QXxhdFp6bAYnoqIUWWabbz7zi8valMb1SjrHs6FZ2PTgyek5mg89 3In9WwlepR6ulflRRUCg3D8YlM932B+54q/Wu6+7rcqIRe9wUvnwA7oFCMgtg89N GWDPq9UdPGw35Ymc64XeVwuaYgZQpDsdDXgqoSkp6xwOTZfH3fM= =9YRz -----END PGP SIGNATURE----- --FluRoNx+P1SWza9W--