[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aFIJDQeHmTPJrK57@yjaykim-PowerEdge-T330>
Date: Wed, 18 Jun 2025 09:32:13 +0900
From: YoungJun Park <youngjun.park@....com>
To: Michal Koutný <mkoutny@...e.com>
Cc: linux-mm@...ck.org, akpm@...ux-foundation.org, hannes@...xchg.org,
mhocko@...nel.org, roman.gushchin@...ux.dev, shakeel.butt@...ux.dev,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
shikemeng@...weicloud.com, kasong@...cent.com, nphamcs@...il.com,
bhe@...hat.com, baohua@...nel.org, chrisl@...nel.org,
muchun.song@...ux.dev, iamjoonsoo.kim@....com, taejoon.song@....com,
gunho.lee@....com
Subject: Re: [RFC PATCH 1/2] mm/swap, memcg: basic structure and logic for
per cgroup swap priority control
On Tue, Jun 17, 2025 at 02:23:07PM +0200, Michal Koutný wrote:
> Hello.
>
> On Thu, Jun 12, 2025 at 07:37:43PM +0900, youngjun.park@....com 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?
Hello Michal.
What issue is the question assuming the existence of competitors in two
cgroups trying to address? Could you explain it a bit more specifically?
To answer your question for now,
Each cgroup just prefers devices according to their priority values.
until swap device is exhausted.
cg1 prefer /dev/sda than /dev/sdb.
cg2 prefer /dev/sdb than /dev/sda.
cg3 prefer /dev/sdb than /dev/sda.
cg4 prefer /dev/sda than /dev/sdb.
> 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.
Yes, it looks like the API format should be adjusted as you suggested.
Thanks for the review.
Regards,
Youngjun Park
Powered by blists - more mailing lists