[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1ecd277e-c236-08e1-f068-3dd65ee0e640@linux.intel.com>
Date: Fri, 19 Feb 2021 11:28:47 -0800
From: Tim Chen <tim.c.chen@...ux.intel.com>
To: Michal Hocko <mhocko@...e.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>,
Vladimir Davydov <vdavydov.dev@...il.com>,
Dave Hansen <dave.hansen@...el.com>,
Ying Huang <ying.huang@...el.com>, linux-mm@...ck.org,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/3] mm: Fix missing mem cgroup soft limit tree updates
On 2/19/21 1:16 AM, Michal Hocko wrote:
>>
>> Something like this?
>>
>> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
>> index 8bddee75f5cb..b50cae3b2a1a 100644
>> --- a/mm/memcontrol.c
>> +++ b/mm/memcontrol.c
>> @@ -3472,6 +3472,14 @@ unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order,
>> if (!mz)
>> break;
>>
>> + /*
>> + * Soft limit tree is updated based on memcg events sampling.
>> + * We could have missed some updates on page uncharge and
>> + * the cgroup is below soft limit. Skip useless soft reclaim.
>> + */
>> + if (!soft_limit_excess(mz->memcg))
>> + continue;
>> +
>> nr_scanned = 0;
>> reclaimed = mem_cgroup_soft_reclaim(mz->memcg, pgdat,
>
> Yes I meant something like this but then I have looked more closely and
> this shouldn't be needed afterall. __mem_cgroup_largest_soft_limit_node
> already does all the work
> if (!soft_limit_excess(mz->memcg) ||
> !css_tryget(&mz->memcg->css))
> goto retry;
> so this shouldn't really happen.
>
Ah, that's true. The added check for soft_limit_excess is not needed.
Do you think it is still a good idea to add patch 3 to
restrict the uncharge update in page batch of the same node and cgroup?
I am okay with dropping patch 3 and let the inaccuracies in the ordering
of soft limit tree be cleared out by an occasional soft reclaim.
These inaccuracies will still be there even with patch 3 fix due
to the memcg event sampling. Patch 3 does help to keep the soft reclaim
tree ordering more up to date.
Thanks.
Tim
Powered by blists - more mailing lists