From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Li Subject: Re: [LSF/MM/BPF TOPIC] Reducing zombie memcgs Date: Sat, 20 May 2023 08:09:26 -0700 Message-ID: References: <874josz4rd.fsf@nvidia.com> <877ctm518f.fsf@nvidia.com> <87ttwnkzap.fsf@nvidia.com> <87jzxe9baj.fsf@nvidia.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684595370; bh=4zgFLqedrPYhCRx9gtDlB2omoSFlFonZfeeZY1IDdSs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kzEZFk0VO9ueKp77ylIn0iukDF8ZkxVEl5p/Kr9aMczqAZV9awU1UJj6f0bkjHPVo 4SbCmQr0PhPmDtzoHyfnJ4X1eIdoU7tN1NfIRojKxmCbAl7gY2iWtXT5zBaMsGtsV5 P376lvmh971ZdlsO81uAsWt3iDDzpj6pOp3+imrGT2+oA4tXubFVWqir63wJudT8QF AF71gt/jR2ymlz/bLVIWOMJuN8nqzffSMBWHNYb6yi+udBUSpGu1lxQO32LfwPRw/R zjxN+xEFT4tE8DNwP8dyMjf4Yqgbp/4Msc4/IoKWXojOJoqK/b7dNaDT08CwaVMFe6 OwNy5mhKqEj5w== Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Jason Gunthorpe Cc: Alistair Popple , "T.J. Mercier" , lsf-pc-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Yosry Ahmed , Tejun Heo , Shakeel Butt , Muchun Song , Johannes Weiner , Roman Gushchin , Kalesh Singh , Yu Zhao On Fri, May 12, 2023 at 06:09:20PM -0300, Jason Gunthorpe wrote: > On Fri, May 12, 2023 at 06:45:13PM +1000, Alistair Popple wrote: > > > However review comments suggested it needed to be added as part of > > memcg. As soon as we do that we have to address how we deal with shared > > memory. If we stick with the original RLIMIT proposal this discussion > > goes away, but based on feedback I think I need to at least investigate > > integrating it into memcg to get anything merged. > > Personally I don't see how we can effectively solve the per-page > problem without also tracking all the owning memcgs for every > page. This means giving each struct page an array of memcgs > > I suspect this will be too expensive to be realistically > implementable. Agree. To get the precise shared usage count, it needs to track the usage at the page level. It is possible to track just pair at the leaf node of the memcg. At the parent memcg it needs to avoid counting the same page twice. So it does need to track per page memcgs set that it belongs to. Chris > If it is done then we may not even need a pin controller on its own as > the main memcg should capture most of it. (althought it doesn't > distinguish between movable/swappable and non-swappable memory) > But this is all being done for the libvirt people, so it would be good > to involve them > > Jason >