Re: [RFC PATCH v2 0/3] mm: mempolicy: Multi-tier weighted interleaving
From: Huang, Ying
Date: Mon Oct 16 2023 - 04:00:04 EST
Gregory Price <gourry.memverge@xxxxxxxxx> writes:
> v2: change memtier mutex to semaphore
> add source-node relative weighting
> add remaining mempolicy integration code
>
> = v2 Notes
>
> Developed in colaboration with original authors to deconflict
> similar efforts to extend mempolicy to take weights directly.
>
> == Mutex to Semaphore change:
>
> The memory tiering subsystem is extended in this patch set to have
> externally available information (weights), and therefore additional
> controls need to be added to ensure values are not changed (or tiers
> changed/added/removed) during various calculations.
>
> Since it is expected that many threads will be accessing this data
> during allocations, a mutex is not appropriate.
IIUC, this is a change for performance. If so, please show some
performance data.
> Since write-updates (weight changes, hotplug events) are rare events,
> a simple rw semaphore is sufficient.
>
> == Source-node relative weighting:
>
> Tiers can now be weighted differently based on the node requesting
> the weight. For example CPU-Nodes 0 and 1 may have different weights
> for the same CXL memory tier, because topologically the number of
> NUMA hops is greater (or any other physical topological difference
> resulting in different effective latency or bandwidth values)
>
> 1. Set weights for DDR (tier4) and CXL(teir22) tiers.
> echo source_node:weight > /path/to/interleave_weight
If source_node is considered, why not consider target_node too? On a
system with only 1 tier (DRAM), do you want weighted interleaving among
NUMA nodes? If so, why tie weighted interleaving with memory tiers?
Why not just introduce weighted interleaving for NUMA nodes?
> # Set tier4 weight from node 0 to 85
> echo 0:85 > /sys/devices/virtual/memory_tiering/memory_tier4/interleave_weight
> # Set tier4 weight from node 1 to 65
> echo 1:65 > /sys/devices/virtual/memory_tiering/memory_tier4/interleave_weight
> # Set tier22 weight from node 0 to 15
> echo 0:15 > /sys/devices/virtual/memory_tiering/memory_tier22/interleave_weight
> # Set tier22 weight from node 1 to 10
> echo 1:10 > /sys/devices/virtual/memory_tiering/memory_tier22/interleave_weight
--
Best Regards,
Huang, Ying