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.7 required=3.0 tests=BAYES_00, 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 6AEF4C43457 for ; Fri, 16 Oct 2020 05:41:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BBEFA2080A for ; Fri, 16 Oct 2020 05:41:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBEFA2080A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 89E6E940007; Fri, 16 Oct 2020 01:41:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 827AD900002; Fri, 16 Oct 2020 01:41:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 715FA940007; Fri, 16 Oct 2020 01:41:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0021.hostedemail.com [216.40.44.21]) by kanga.kvack.org (Postfix) with ESMTP id 3DE2B900002 for ; Fri, 16 Oct 2020 01:41:01 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C602A3629 for ; Fri, 16 Oct 2020 05:41:00 +0000 (UTC) X-FDA: 77376689880.14.women08_1d045292721a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id A4FD518229835 for ; Fri, 16 Oct 2020 05:41:00 +0000 (UTC) X-HE-Tag: women08_1d045292721a X-Filterd-Recvd-Size: 2090 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Fri, 16 Oct 2020 05:41:00 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B9BECADC2; Fri, 16 Oct 2020 05:40:58 +0000 (UTC) References: <20201014190749.24607-1-rpalethorpe@suse.com> <20201014200833.GA19363@carbon.lan> User-agent: mu4e 1.4.13; emacs 27.1 From: Richard Palethorpe To: Roman Gushchin Cc: ltp@lists.linux.it, Johannes Weiner , Andrew Morton , Shakeel Butt , "Christoph Lameter" , Michal Hocko , Tejun Heo , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] mm: memcg/slab: Stop reparented obj_cgroups from charging root Reply-To: rpalethorpe@suse.de In-reply-to: <20201014200833.GA19363@carbon.lan> Date: Fri, 16 Oct 2020 06:40:57 +0100 Message-ID: <87v9fasp7a.fsf@suse.de> MIME-Version: 1.0 Content-Type: text/plain 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: Hello Roman, Roman Gushchin writes: > Hi Richard! > >> SLAB objects which outlive their memcg are moved to their parent >> memcg where they may be uncharged. However if they are moved to the >> root memcg, uncharging will result in negative page counter values as >> root has no page counters. >> >> To prevent this, we check whether we are about to uncharge the root >> memcg and skip it if we are. Possibly instead; the obj_cgroups should >> be removed from their slabs and any per cpu stocks instead of >> reparenting them to root? > > It would be really complex. I think your fix is totally fine. > We have similar checks in cancel_charge(), uncharge_batch(), > mem_cgroup_swapout(), mem_cgroup_uncharge_swap() etc. > > > Acked-by: Roman Gushchin > > Thanks! Great I will respin. -- Thank you, Richard.