Re: [PATCH] mm/mempolicy: add sysfs interface to override NUMA node bandwidth

From: Joshua Hahn

Date: Thu Mar 12 2026 - 11:08:54 EST


On Thu, 12 Mar 2026 17:12:07 +0800 YeeLi <seven.yi.lee@xxxxxxxxx> wrote:

Hello YeeLi,

I hope you are doing well! Thank you for the patch, I think it is an
interesting and helpful debugging tool.

> Automatic tuning for weighted interleaving [1] provides real benefits on
> systems with CXL support. However, platforms that lack HMAT or CDAT
> information cannot make use of this feature.

Thank you for the kind words : -) I'm also CCing Gregory Price, who
is the original author of the weighted interleave mempolicy.

> If the bandwidth reported by firmware or the device deviates from the
> actual measured bandwidth, administrators also lack a clear way to adjust
> the per-node weight values.

I just wanted to touch on this. Is this true? Weighted interleave already
exposes sysfs that lets the user set the weights they want. On one hand
I think it would be helpful for there to be a tool to see what the
effects of setting bandwidth information on a system could be, if it
had other side effects. I'm not sure if there is a strong case to do this
purely for weighted interleave auto-tuning, which already has a manual
weight override and pretty simple calculations : -)

> This patch introduces an optional Kconfig option,
> CONFIG_NUMA_BW_MANUAL_OVERRIDE (default n), which exposes node bandwidth
> R/W sysfs attributes under:
>
> /sys/kernel/mm/mempolicy/weighted_interleave/bw_nodeN
>
> The sysfs files are created and removed dynamically on node hotplug
> events, in sync with the existing weighted_interleave/nodeN attributes.
>
> Userspace can write a single bandwidth value (in MB/s) to override both
> read_bandwidth and write_bandwidth for the corresponding NUMA node. The
> value is then propagated to the internal node_bw_table via
> mempolicy_set_node_perf().
>
> This interface is intended for debugging and experimentation only.

Thank you for the helpful clarification. Just to be sure, are there
other intended things that the user can test other than what weights
weighted interleave would resolve to?

Thank you again for the patch, I hope you have a great day!
Joshua

> [1] Link:
> https://lkml.kernel.org/r/20250505182328.4148265-1-joshua.hahnjy@xxxxxxxxx
>
> Signed-off-by: yeeli <seven.yi.lee@xxxxxxxxx>
> ---
> mm/Kconfig | 20 +++++++
> mm/mempolicy.c | 148 +++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 168 insertions(+)