mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next RFC 0/2] cpuset: Add cpuset.mems.spread_page to cgroup v2
@ 2025-09-30  9:35 Cai Xinchen
  2025-09-30  9:35 ` [PATCH -next RFC 1/2] cpuset: Move cpuset1_update_spread_flag to cpuset Cai Xinchen
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Cai Xinchen @ 2025-09-30  9:35 UTC (permalink / raw)
  To: llong, tj, hannes, mkoutny; +Cc: cgroups, linux-kernel, lujialin4, caixinchen1

I encountered a scenario where a machine with 1.5TB of memory,
while testing the Spark TPCDS 3TB dataset, experienced a significant
concentration of page cache usage on one of the NUMA nodes.
I discovered that the DataNode process had requested a large amount
of page cache. most of the page cache was concentrated in one NUMA node,
ultimately leading to the exhaustion of memory in that NUMA node.
At this point, all other processes in that NUMA node have to alloc
memory across NUMA nodes, or even across sockets. This eventually
caused a degradation in the end-to-end performance of the Spark test.

I do not want to restart the Spark DataNode service during business
operations. This issue can be resolved by migrating the DataNode into
a cpuset, dropping the cache, and setting cpuset.memory_spread_page to
allow it to evenly request memory. The core business threads could still
allocate local numa memory. After using cpuset.memory_spread_page, the
performance in the tpcds-99 test is improved by 2%.

The key point is that the even distribution of page cache within the
DataNode process (rather than the current NUMA distribution) does not
significantly affect end-to-end performance. However, the allocation
of core business processes, such as Executors, to the same NUMA node
does have a noticeable impact on end-to-end performance.

However, I found that cgroup v2 does not provide this interface. I
believe this interface still holds value in addressing issues caused
by uneven distribution of page cache allocation among process groups.

Thus I add cpuset.mems.spread_page to cpuset v2 interface.

Cai Xinchen (2):
  cpuset: Move cpuset1_update_spread_flag to cpuset
  cpuset: Add spread_page interface to cpuset v2

 kernel/cgroup/cpuset-internal.h |  6 ++--
 kernel/cgroup/cpuset-v1.c       | 25 +----------------
 kernel/cgroup/cpuset.c          | 49 ++++++++++++++++++++++++++++++++-
 3 files changed, 51 insertions(+), 29 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-11-04 12:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-30  9:35 [PATCH -next RFC 0/2] cpuset: Add cpuset.mems.spread_page to cgroup v2 Cai Xinchen
2025-09-30  9:35 ` [PATCH -next RFC 1/2] cpuset: Move cpuset1_update_spread_flag to cpuset Cai Xinchen
2025-09-30  9:35 ` [PATCH -next RFC 2/2] cpuset: Add spread_page interface to cpuset v2 Cai Xinchen
2025-09-30 12:05 ` [PATCH -next RFC 0/2] cpuset: Add cpuset.mems.spread_page to cgroup v2 Michal Koutný
2025-10-20  6:20   ` Cai Xinchen
2025-11-03 13:39     ` Michal Koutný
2025-11-04 12:00       ` Cai Xinchen
2025-09-30 13:57 ` Waiman Long

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®