Re: [RFC PATCH 1/2] mm/swap, memcg: basic structure and logic for per cgroup swap priority control
From: Michal Koutný
Date: Tue Jun 17 2025 - 08:24:51 EST
Hello.
On Thu, Jun 12, 2025 at 07:37:43PM +0900, youngjun.park@xxxxxxx wrote:
> Example:
> cat memory.swap.priority
> Inactive
> /dev/sdb unique:1 prio:10
> /dev/sdc unique:2 prio:5
>
> - Creation
> echo "unique id of swapdev 1: priority, unique id of swapdev 2: priority ..."
> > memory.swap.priority
>
> - Destruction
> Reset through the memory.swap.priority interface.
> Example: echo "" > memory.swap.priority
>
> And also be destroyed when the mem_cgroup is removed.
>
> 3. Priority Mechanism
>
> - Follows the original concept of swap priority.
> (This includes automatic binding of swap devices to NUMA nodes.)
How is this supposed to work
cg1 /dev/sda prio:10
/dev/sdb prio:5
` cg3 /dev/sda prio:5
/dev/sdb prio:10
cg2 /dev/sda prio:5
/dev/sdb prio:10
` cg4 /dev/sda prio:10
/dev/sdb prio:5
when there are competitors from cg3 and cg4? Which device should be
preferred by each cgroup?
Interface note -- try to make it "Nested keyed" or "Flat keyed" as
described in Documentation/admin-guide/cgroup-v2.rst (like io.max or
io.weight), so that it is consistent with other cgroup v2 APIs.
HTH,
Michal
Attachment:
signature.asc
Description: PGP signature