From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E58A4C77B7F for ; Sat, 20 May 2023 15:09:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 05A41900004; Sat, 20 May 2023 11:09:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 00A8E900003; Sat, 20 May 2023 11:09:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E3B8B900004; Sat, 20 May 2023 11:09:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D4ABA900003 for ; Sat, 20 May 2023 11:09:33 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A4DCB120C6D for ; Sat, 20 May 2023 15:09:33 +0000 (UTC) X-FDA: 80810967426.08.24F6F63 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf22.hostedemail.com (Postfix) with ESMTP id 00FAEC000F for ; Sat, 20 May 2023 15:09:31 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=kzEZFk0V; spf=pass (imf22.hostedemail.com: domain of chrisl@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=chrisl@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684595372; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RVPu2O91mG2wMDVYbLnocK4+fYwX9k/D1MhC5nfP574=; b=0KsD2FxfODYmrwa7DTIy+7trPue2AhfDBbwJnumKXGMDodPD6/buGW5cIxPuKEqZfjjAgF Ff5laez9KT4R91DYFZ+PIt8YixNu3ffS2JKNFUQZlQZjUoO8BjKaP7bKgcGdBPVhrp65Mk w0SE7LjW314fQeVKXgYdqHaUReRTO1Q= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684595372; a=rsa-sha256; cv=none; b=klOYmzFKX4R+ZBC45PwppDSPRPJZ23gTgRaWLJfUdlNv+Fkv2RUZ7PXipA2KN8eNmkUF3s mQxUX8FKEeNk78xnj880g/fUaHafdZacoo5i4wcCrQl73hsyKOgEv6GYEsDNC7O7sTtvsZ 75wIo87MBP9andNLoH9mKzXWKya+4J4= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=kzEZFk0V; spf=pass (imf22.hostedemail.com: domain of chrisl@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=chrisl@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CD988612C9; Sat, 20 May 2023 15:09:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84BC4C433D2; Sat, 20 May 2023 15:09:28 +0000 (UTC) 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== Date: Sat, 20 May 2023 08:09:26 -0700 From: Chris Li To: Jason Gunthorpe Cc: Alistair Popple , "T.J. Mercier" , lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org, cgroups@vger.kernel.org, Yosry Ahmed , Tejun Heo , Shakeel Butt , Muchun Song , Johannes Weiner , Roman Gushchin , Kalesh Singh , Yu Zhao Subject: Re: [LSF/MM/BPF TOPIC] Reducing zombie memcgs Message-ID: References: <874josz4rd.fsf@nvidia.com> <877ctm518f.fsf@nvidia.com> <87ttwnkzap.fsf@nvidia.com> <87jzxe9baj.fsf@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 00FAEC000F X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: bwczr5tui79qaubcfeje99c1mujkpebg X-HE-Tag: 1684595371-767057 X-HE-Meta: U2FsdGVkX18WJRIpgR3ugXJZcgkDxY3it+xk22fJ7I0VPsi7mETqXEbnFT6gi2S3Svynl5ducrZVMPYUJrAN3n+qUA2QAIp6B3hNXKi5bld09+PuC6yijpm2htEOXBD7oVqcudyX7+8p7pysFh2FnRga3ZIlZdg9bLjyFxghL39798nopyo5fe1PDj257BJs7eA70XHynd9eyOzAhed8PXe788wVHpjYFqdrtFbrUmdo+qcjsXsVvgFIr0xiDuTefWKO6sVE4joWrO91DbhS2C5Kksnv92UN6lLmu7+UXHH+lrxYd3S+U58Y/V1AoNYI6mMNw7j765vLME9mC/wV4DfPesQ3jKCxvEBB1xWlCqGpAv79loyEwDRczCpc1M6SSU4x2ivmd8RKJ5rrUD6EcUIzsJQV1IX/PmGjQREHDBakKHt3IJSbOg5H1UcrGoClxT3S26GuV81DKlhJ5Vxw5ZWRtchOeE+aMRtaO5Z1TUPo3l4gwzk+SRfFeGdO1FpNGaCFNZeZKQRmRj93hT6UCCPTEKkZUUId7mBDQ3f8Sdbu5ua8VLKKTnub1ExRvHuV7otM2098Aw/y0eN4gIgNIcBhn6+wmEyXJhN3mHc7+ZU1aXiIuD+gmkxxlfKiHi08KMgciCy0SYmEp7EIanQBwo86InbKSmlKkE9HdRRCVADFsEapm/tC/8H/NMlya/Qbk4IveRYYfdgu2YmmgL1Lq0TQS3QZ5ZNGEvnkK6GlLf2x/vPlBlxNl2X9Quclo3y/6KsQaNXWfXDQQ6bhlmf6GUvEQ5G11/aWzXmhbM6+/iUKl64YqJRQWxFfv+yJPv9mFaI/P4WNbOkEEcC9cc7DpZ9LqEW8DHL2W3i8S26sbL5VmpkF9Fux8acC/dEgsol94Kj+d5uiKQcSVSouX0dBSxx64B9EDcRJJa2+ENaEGFIJaoqCGjDJhiNoslFt1ytzADLFzuhMF4VT44336us 9J++oIT+ +2+7ff+uU4wotphE+PNLNoqcO0BIRS4cX9A4NN26p+x0paVbGHDBFgN5O9Ay0eT5bvJ7YKdyJhuZKa0dr2HvtglWXAPflReszNuCvmXztMY8mJmf1GAXlvX5Qc/dI8W0KQCyErA0Iznub54fNYqk2p9lHShWr78a6w9mlhAzaTHjpqKLX6umbzr9s4J6gTU/Riy2CCe9rZImDGi747kKzG6vuYGQD8B5KnpHvOCJg8w8AqmQGQvAZlxa19RlvIwcNl00Q X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 >