[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YmAAzkwGg6GspCiu@dhcp22.suse.cz>
Date: Wed, 20 Apr 2022 14:47:10 +0200
From: Michal Hocko <mhocko@...e.com>
To: Yosry Ahmed <yosryahmed@...gle.com>
Cc: Johannes Weiner <hannes@...xchg.org>,
Shakeel Butt <shakeelb@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Roman Gushchin <roman.gushchin@...ux.dev>,
David Rientjes <rientjes@...gle.com>,
Tejun Heo <tj@...nel.org>,
Dan Schatzberg <schatzberg.dan@...il.com>,
Zefan Li <lizefan.x@...edance.com>,
Jonathan Corbet <corbet@....net>,
Shuah Khan <shuah@...nel.org>, Yu Zhao <yuzhao@...gle.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Wei Xu <weixugc@...gle.com>, Greg Thelen <gthelen@...gle.com>,
Chen Wandun <chenwandun@...wei.com>,
Vaibhav Jain <vaibhav@...ux.ibm.com>,
Michal Koutný <mkoutny@...e.com>,
Tim Chen <tim.c.chen@...ux.intel.com>, cgroups@...r.kernel.org,
linux-doc@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux-MM <linux-mm@...ck.org>, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v3 1/4] memcg: introduce per-memcg reclaim interface
On Thu 14-04-22 10:25:29, Yosry Ahmed wrote:
> On Fri, Apr 8, 2022 at 1:08 PM Yosry Ahmed <yosryahmed@...gle.com> wrote:
> >
> > On Fri, Apr 8, 2022 at 7:55 AM Dan Schatzberg <schatzberg.dan@...il.com> wrote:
> > >
> > > On Fri, Apr 08, 2022 at 04:11:05PM +0200, Michal Hocko wrote:
> > > > Regarding "max" as a possible input. I am not really sure to be honest.
> > > > I can imagine that it could be legit to simply reclaim all the charges
> > > > (e.g. before removing the memcg) which should be achieveable by
> > > > reclaiming the reported consumption. Or what exactly should be the
> > > > semantic?
> > >
> > > Yeah, it just allows you to avoid reading memory.current to just
> > > reclaim everything if you can specify "max" - you're still protected
> > > by nretries to eventually bail out. Mostly, though I just feel like
> > > supporting "max" makes memory.reclaim semetric with a lot of the
> > > cgroup memory control files which tend to support "max".
> >
> > One possible approach here is to have force_empty behavior when we
> > write "max" to memory.reclaim. From Google's perspective we don't have
> > a preference, but it seems to me like logical behavior. We can do this
> > either by directly calling mem_cgroup_force_empty() or just draining
> > stock and lrus in memory_reclaim().
> >
> > This actually brings up another interesting point. Do you think we
> > should drain lrus if try_to_free_mem_cgroup_pages() fails to reclaim
> > the request amount? We can do this after the first call or before the
> > last one. It could introduce more evictable pages for
> > try_to_free_mem_cgroup_pages() to free.
>
> Hey Michal, any thoughts on this? I am looking for feedback on this
> before I send out v4.
As I've already said I do not have strong preferences for the "max"
value to be accepted by the interface. Maybe you can add a support for
max in a separate patch so the discussion would not delay the rest of
the work.
For the LRU draining I do not see any problem for that to be added. The
overhead of the operation would increase, especially on larger machines,
which could be a concern. So the real question is whether not doing so
is a big problem. Our force_empty implementation optimistically drains
pcp caches but please note that this is not really guranteeing anything
as charges can happen at any time.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists