[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHbLzkof4TL3cehgubYU-oAu_6x3ODnzDoOUyQDdn4xG0ts_-A@mail.gmail.com>
Date: Wed, 10 Feb 2021 08:41:52 -0800
From: Yang Shi <shy828301@...il.com>
To: Kirill Tkhai <ktkhai@...tuozzo.com>
Cc: Roman Gushchin <guro@...com>, Vlastimil Babka <vbabka@...e.cz>,
Shakeel Butt <shakeelb@...gle.com>,
Dave Chinner <david@...morbit.com>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...e.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux MM <linux-mm@...ck.org>,
Linux FS-devel Mailing List <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [v7 PATCH 09/12] mm: vmscan: use per memcg nr_deferred of shrinker
On Wed, Feb 10, 2021 at 6:37 AM Kirill Tkhai <ktkhai@...tuozzo.com> wrote:
>
> On 10.02.2021 04:52, Yang Shi wrote:
> > On Tue, Feb 9, 2021 at 5:27 PM Roman Gushchin <guro@...com> wrote:
> >>
> >> On Tue, Feb 09, 2021 at 09:46:43AM -0800, Yang Shi wrote:
> >>> Use per memcg's nr_deferred for memcg aware shrinkers. The shrinker's nr_deferred
> >>> will be used in the following cases:
> >>> 1. Non memcg aware shrinkers
> >>> 2. !CONFIG_MEMCG
> >>> 3. memcg is disabled by boot parameter
> >>>
> >>> Signed-off-by: Yang Shi <shy828301@...il.com>
> >>> ---
> >>> mm/vmscan.c | 78 ++++++++++++++++++++++++++++++++++++++++++++---------
> >>> 1 file changed, 66 insertions(+), 12 deletions(-)
> >>>
> >>> diff --git a/mm/vmscan.c b/mm/vmscan.c
> >>> index d4b030a0b2a9..748aa6e90f83 100644
> >>> --- a/mm/vmscan.c
> >>> +++ b/mm/vmscan.c
> >>> @@ -368,6 +368,24 @@ static void unregister_memcg_shrinker(struct shrinker *shrinker)
> >>> up_write(&shrinker_rwsem);
> >>> }
> >>>
> >>> +static long count_nr_deferred_memcg(int nid, struct shrinker *shrinker,
> >>> + struct mem_cgroup *memcg)
> >>
> >> "Count" is not associated with xchg() semantics in my head, but I don't know
> >> what's the better version. Maybe steal or pop?
> >
> > It is used to retrieve the nr_deferred value. I don't think "steal" or
> > "pop" helps understand. Actually "count" is borrowed from
> > count_objects() method of shrinker.
>
> I'd also voted for another name.
>
> xchg_nr_deferred() or steal/pop sound better for me.
OK, I do have a hard time to understand steal/pop, but xchg sounds
more self-explained to me.
>
Powered by blists - more mailing lists