From: Tim Chen Subject: Re: [PATCH 3/3] mm: Fix missing mem cgroup soft limit tree updates Date: Tue, 9 Feb 2021 14:34:07 -0800 Message-ID: <3445ebcd-bc69-ec6e-8995-c95753b5c4a7@linux.intel.com> References: <3b6e4e9aa8b3ee1466269baf23ed82d90a8f791c.1612902157.git.tim.c.chen@linux.intel.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US List-ID: Content-Type: text/plain; charset="us-ascii" To: Johannes Weiner Cc: Andrew Morton , Michal Hocko , Vladimir Davydov , Dave Hansen , Ying Huang , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On 2/9/21 2:22 PM, Johannes Weiner wrote: > Hello Tim, > > On Tue, Feb 09, 2021 at 12:29:47PM -0800, Tim Chen wrote: >> @@ -6849,7 +6850,9 @@ static void uncharge_page(struct page *page, struct uncharge_gather *ug) >> * exclusive access to the page. >> */ >> >> - if (ug->memcg != page_memcg(page)) { >> + if (ug->memcg != page_memcg(page) || >> + /* uncharge batch update soft limit tree on a node basis */ >> + (ug->dummy_page && ug->nid != page_to_nid(page))) { > > The fix makes sense to me. > > However, unconditionally breaking up the batch by node can > unnecessarily regress workloads in cgroups that do not have a soft > limit configured, and cgroup2 which doesn't have soft limits at > all. Consider an interleaving allocation policy for example. > > Can you please further gate on memcg->soft_limit != PAGE_COUNTER_MAX, > or at least on !cgroup_subsys_on_dfl(memory_cgrp_subsys)? > Sure. Will fix this. Tim