From: Andi Kleen <ak@linux.intel.com>
To: Gregory Price <gourry.memverge@gmail.com>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org
Subject: Re: [PATCH v6 00/12] mempolicy2, mbind2, and weighted interleave
Date: Wed, 10 Jan 2024 19:41:11 -0800 [thread overview]
Message-ID: <87mstclep4.fsf@linux.intel.com> (raw)
In-Reply-To: <20240103224209.2541-1-gregory.price@memverge.com> (Gregory Price's message of "Wed, 3 Jan 2024 17:41:57 -0500")
[sorry for the resend, fixed mailing list address]
Gregory Price <gourry.memverge-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
writes:
> Weighted interleave is a new interleave policy intended to make
> use of heterogeneous memory environments appearing with CXL.
>
> To implement weighted interleave with task-local weights, we
> need new syscalls capable of passing a weight array. This is
> the justification for mempolicy2/mbind2 - which are designed
> to be extensible to capture future policies as well.
I might be late to the party here, but it's not clear to me you really
need the redesigned system calls. set_mempolicy has one argument left
so it can be enhanced with a new pointer dependending on a bit in mode.
For mbind() it already uses all arguments, but it has a flags argument.
But it's unclear to me if a fully flexible weight array is really needed
here anyways. Can some common combinations be encoded in flags instead?
I assume it's mainly about some nodes getting preference depending on some attribute
So if you add such a attribute, perhaps configurable in sysfs, and then
have flags like give weight + 1 on attribute, give weight + 2 on attribute
give weight + 4 on attribute. If more are needed there are more bits.
That would be a much more compact and simpler interface.
For set_mempolicy either add a flags argument or encode in mode.
It would also shrink the whole patchkit dramatically and be less risky.
You perhaps underestimate the cost and risk of designing complex kernel
interfaces, it all has to be hardened audited fuzzed deployed etc.
-Andi
prev parent reply other threads:[~2024-01-11 3:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-03 22:41 Gregory Price
2024-01-03 22:41 ` [PATCH v6 01/12] mm/mempolicy: implement the sysfs-based weighted_interleave interface Gregory Price
2024-01-03 22:41 ` [PATCH v6 02/12] mm/mempolicy: refactor a read-once mechanism into a function for re-use Gregory Price
2024-01-03 22:42 ` [PATCH v6 06/12] mm/mempolicy: refactor kernel_get_mempolicy for code re-use Gregory Price
2024-01-03 22:42 ` [PATCH v6 08/12] mm/mempolicy: add userland mempolicy arg structure Gregory Price
2024-01-04 0:19 ` Randy Dunlap
2024-01-04 2:03 ` Gregory Price
2024-01-10 20:11 ` [PATCH v6 00/12] mempolicy2, mbind2, and weighted interleave Gregory Price
2024-01-03 22:42 ` [PATCH v6 10/12] mm/mempolicy: add get_mempolicy2 syscall Gregory Price
2024-01-03 22:42 ` [PATCH v6 11/12] mm/mempolicy: add the mbind2 syscall Gregory Price
2024-01-03 22:42 ` [PATCH v6 12/12] mm/mempolicy: extend mempolicy2 and mbind2 to support weighted interleave Gregory Price
2024-01-11 3:41 ` Andi Kleen [this message]
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=87mstclep4.fsf@linux.intel.com \
--to=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=gourry.memverge@gmail.com \
--cc=linux-mm@kvack.org \
/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