Re: [PATCH -next RFC 0/2] cpuset: Add cpuset.mems.spread_page to cgroup v2

From: Cai Xinchen
Date: Tue Nov 04 2025 - 07:00:27 EST


Therefore, when setting memory_spread_page, I also need to perform a drop cache operation.

This way, there is no need to restart the service.


Some previous ideas, such as using procfs or set_mempolicy to change the mempolicy of

non-current processes, could also achieve the goal after dropping the cache. [1]


Of course, changing the current memory distribution does not necessarily require dropping

the cache, but it will inevitably lead to a series of memory migrations.


[1] https://lore.kernel.org/all/20231122211200.31620-1-gregory.price@xxxxxxxxxxxx/

https://lore.kernel.org/all/ZWS19JFHm_LFSsFd@tiehlicka/

On 11/3/2025 9:39 PM, Michal Koutný wrote:
On Mon, Oct 20, 2025 at 02:20:30PM +0800, Cai Xinchen <caixinchen1@xxxxxxxxxx> wrote:
The MPOL_INTERLEAVE setting requires restarting the DataNode service.
In this scenario, the issue can be resolved by restarting the service,
\o/

but I would prefer not to restart the DataNode service if possible,
as it would cause a period of service interruption.
AFAICS, the implementation of cpuset's spread page works only for new
allocations (filemap_alloc_folio_noprof/cpuset_do_page_mem_spread) and
there's no migraion in cpuset1_update_task_spread_flags(). So this
simple v1-like spreading would still require restart of the service.

(This challenge of dynamism also a reason why it's not ready for v2,
IMO.)

HTH,
Michal