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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31A48C388F7 for ; Tue, 20 Oct 2020 17:25:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 52A5522242 for ; Tue, 20 Oct 2020 17:25:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="kWO2SM7c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 52A5522242 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6B6A66B005C; Tue, 20 Oct 2020 13:25:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 63E936B0062; Tue, 20 Oct 2020 13:25:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 506FE6B0068; Tue, 20 Oct 2020 13:25:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0176.hostedemail.com [216.40.44.176]) by kanga.kvack.org (Postfix) with ESMTP id 1FC3C6B005C for ; Tue, 20 Oct 2020 13:25:08 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B669C8368EF7 for ; Tue, 20 Oct 2020 17:25:07 +0000 (UTC) X-FDA: 77392979454.16.level28_521629d27241 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 90345102717C9 for ; Tue, 20 Oct 2020 17:25:07 +0000 (UTC) X-HE-Tag: level28_521629d27241 X-Filterd-Recvd-Size: 3820 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Tue, 20 Oct 2020 17:25:07 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1603214706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nkUZcV0RHvBQCtddDCi8Jl1PDarJsxHvw9FO675doK0=; b=kWO2SM7cpF0FkTdM/cFGdvR38/5kht/iq0z+RnxlxCeAi5dvBHQol/wc3WHvyyHjkzIpqx dyZbzFhkUgIa1XkoKodi3De9X0nGHMAA7IXmWm9mk71t6uxW/ztMBrpqDV3guj3y/7q7be x6zD1ouQqeadG5LlZlgJaudBsBbh69I= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id EFD9DADCC; Tue, 20 Oct 2020 17:25:05 +0000 (UTC) Date: Tue, 20 Oct 2020 19:24:02 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Richard Palethorpe Cc: Shakeel Butt , Linux MM , LKML , LTP List , Roman Gushchin , Johannes Weiner , Andrew Morton , Christoph Lameter , Michal Hocko , Tejun Heo , Vlastimil Babka Subject: Re: [PATCH v3] mm: memcg/slab: Stop reparented obj_cgroups from charging root Message-ID: <20201020172402.GD46039@blackbook> References: <87lfg2ob83.fsf@suse.de> <20201019095812.25710-1-rpalethorpe@suse.com> <87mu0hwik7.fsf@suse.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IDYEmSnFhs3mNXr+" Content-Disposition: inline In-Reply-To: <87mu0hwik7.fsf@suse.de> 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: --IDYEmSnFhs3mNXr+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi. On Tue, Oct 20, 2020 at 06:52:08AM +0100, Richard Palethorpe wrote: > I don't think that is relevant as we get the memcg from objcg->memcg > which is set during reparenting. I suppose however, we can determine if > the objcg was reparented by inspecting memcg->objcg. +1 > If we just check use_hierarchy then objects directly charged to the > memcg where use_hierarchy=0 will not be uncharged. However, maybe it is > better to check if it was reparented and if use_hierarchy=0. I think (I had to make a table) the yielded condition would be: if ((memcg->use_hierarchy && reparented) || (!mem_cgroup_is_root(memcg) && !reparented)) __memcg_kmem_uncharge(memcg, nr_pages); (I admit it's not very readable.) Michal --IDYEmSnFhs3mNXr+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEEoQaUCWq8F2Id1tNia1+riC5qSgFAl+PHSwACgkQia1+riC5 qSiqORAAmQO74JHeb74RQGqy+cE/teEdvHO884KVh6QnHVdHqekJdJ1f+9FhN0/B Yn0Ou7ySZDTT9X3dtRKX/eP7jjF6wRtyP9GD2T6a6XG5LGSGh3lLjsVnYTkq4Bef C5xqA/fUoSsJClVHwzyWEhfboLwXlgJmFIOoa2uhrZpIO39jIppNu4Vwslrpznaj qtPdaHNa5PDlXruFNdKxzLVPvrvrmEaLdM0a+8CGD81pENDrTXdSBNnAgnwi6zA/ aK/co/Kt8BJBs+SKQCBIFyEH/HTGfHtYm15vfuYHOU7SDWGNtH1+BAzeVQw5jrAK qZHR2w5D5RJ2lLU33j/7yHYcdHIv8CShM7CE8LN4JkcSoZZGbSsUpd6LYth6jptW /EhIYQQ7Ub+JTBGP5nbe78vO8P/qInBy7/R4jWyKk1F7sJa30ktqQTcfYPI9L2Fp QwrkvMSm0RrJ9MkAyy7NPhkB5hASdDtdGEumWHSKB+KJDLjiE74QAV1qmlsTiUbn CDkmCc8eMBeIHAjDq2dDT8ed6uXY7GHd+wWIFuYbwo6EJtCwhYCtmVfpnMY03QG4 +qoSzv5g9ADW/WwdeHnIcFujFUD012hmuLN5iQvrRs8iuxAvRlIuK8iNjvgJbK9Z F74NC2z/cOUKtA3fGrNCmMfQ52oLgbg/iMQAwRPAZVilCXH1s/c= =IzbP -----END PGP SIGNATURE----- --IDYEmSnFhs3mNXr+--