From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roman Gushchin Subject: Re: [PATCH 1/3] mm, memcg: Don't put offlined memcg into local stock Date: Mon, 31 Jan 2022 09:15:41 -0800 Message-ID: References: <20211001190938.14050-1-longman@redhat.com> <20211001190938.14050-2-longman@redhat.com> <95ba1931-e9c9-45c3-b080-d28f2ad368a7@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=facebook; bh=eCRYYz8CwNO8O2JABlB8+ChoY0hda0ZxFN3fTK4Xn+8=; b=Pg6Dze3XEAWrkTME0ubICe1S0BW96KIIb2kTwK0l47yJHhECMzLkCrtex6iQg0C5yCaN pTdtpaEaYayqZIb4SVwMWAl7BS+SzdfZXSEjg/b8ol6g0CYC2FrMAm0dkBFVSsF5wIIx lAt9V7ken9z18Etb4m8ihca/rxgJcpwIyXM= Content-Disposition: inline In-Reply-To: <95ba1931-e9c9-45c3-b080-d28f2ad368a7-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> List-ID: Content-Transfer-Encoding: 7bit To: Waiman Long Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Vlastimil Babka , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Shakeel Butt , Muchun Song On Mon, Jan 31, 2022 at 12:09:09PM -0500, Waiman Long wrote: > On 1/31/22 12:01, Roman Gushchin wrote: > > On Sun, Jan 30, 2022 at 10:55:56PM -0500, Waiman Long wrote: > > > On 10/1/21 19:51, Roman Gushchin wrote: > > > > On Fri, Oct 01, 2021 at 03:09:36PM -0400, Waiman Long wrote: > > > > > When freeing a page associated with an offlined memcg, refill_stock() > > > > > will put it into local stock delaying its demise until another memcg > > > > > comes in to take its place in the stock. To avoid that, we now check > > > > > for offlined memcg and go directly in this case to the slowpath for > > > > > the uncharge via the repurposed cancel_charge() function. > > > > Hi Waiman! > > > > > > > > I'm afraid it can make a cleanup of a dying cgroup slower: for every > > > > released page we'll potentially traverse the whole cgroup tree and > > > > decrease atomic page counters. > > > > > > > > I'm not sure I understand the benefits we get from this change which > > > > do justify the slowdown on the cleanup path. > > > > > > > > Thanks! > > > I was notified of a lockdep splat that this patch may help to prevent. > > Would you mind to test this patch: > > https://www.spinics.net/lists/cgroups/msg31244.html ? > > > > It should address this dependency. > > Thanks for the pointer. I believe that your patch should be able to address > this circular locking dependency. > > Feel free to add my > > Reviewed-by: Waiman Long Thank you!