Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2214969rwl; Sun, 26 Mar 2023 18:31:39 -0700 (PDT) X-Google-Smtp-Source: AKy350YbXPTePbhZLsa+7BmJYJgngsZ1+DgnzFcoLCy5h/VfQn9Y4kYq+aS8BSnNEj9NEXRQ2eBl X-Received: by 2002:a17:90b:4f47:b0:23d:2f73:d3c8 with SMTP id pj7-20020a17090b4f4700b0023d2f73d3c8mr11393711pjb.42.1679880699211; Sun, 26 Mar 2023 18:31:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679880699; cv=none; d=google.com; s=arc-20160816; b=ZWklcJuHEgRc1CradcxtuIfs5zrYvpe6rxsKwvCUUBh01xAeSWf4ocSl0EbOYrECIV n9Mw4F8yYFf/bgRk91uYQ4Vyi6iBstN8ddQjE25iaHfDu5NMhBgMndwwxvgTJuGxOSNl hHsTKgzAt87msQTzY8uv1v/LOJBVExH0nn0dX1wIf2k7L9F7kI/Z+7fukAg36ZEigM8t /5pem7/cl/yl2CDyeYyLqJHHcsoT9lkXc5Ewb1dR+iabE3N1gQuLyrAhoZakTLueetcP KeMVTHU3qA/rBvBdrREBOig90hajxgt0vm8PojLU8u3UH+ljWKCH9tlmQZ26OeE7/+aa QIHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:cc:from:to :references:subject:user-agent:mime-version:date:message-id; bh=PhH1U2eS/ZpvUDyAHR3x/qIfATM1irCQcsgIv/bHOls=; b=T61tcMfrGIoegmXH/xawk2RW67C9yGjirIOxSv4Eh2gSIL/j+gTObo3zpTmeovSVF3 jxlWeS/qJTkfNNrh/G4oZ837UT9jug9DCq3zbKLC+yywgJvxLo7xJ+72d1DN9JwYikMP OZnomrqcuLNfecSpAeOopjUGU86IUDPvMT7yLQ/WszTuU/bHQaVBYY1Y3wy7MRf0ZTOY ROk+juidBxl9WbuUS9Iag5k/c0BJnR5qYrN2618hLpnNi3yA7zYXqhXpD0NWG5FFdUIb GVn78HnPojuWIzwPtiTa5usMNvMeC/AuLz76+skT9LzmE9GpEgKGjPdeZhlQ1/5ytvfy /UIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gl18-20020a17090b121200b002340b11f1e8si9455550pjb.44.2023.03.26.18.31.27; Sun, 26 Mar 2023 18:31:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229675AbjC0B3n (ORCPT + 99 others); Sun, 26 Mar 2023 21:29:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjC0B3m (ORCPT ); Sun, 26 Mar 2023 21:29:42 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29BF544BE; Sun, 26 Mar 2023 18:29:41 -0700 (PDT) Received: from kwepemi500024.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4PlFZT0mWszrX6N; Mon, 27 Mar 2023 09:28:33 +0800 (CST) Received: from [10.67.109.31] (10.67.109.31) by kwepemi500024.china.huawei.com (7.221.188.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 27 Mar 2023 09:29:38 +0800 Message-ID: Date: Mon, 27 Mar 2023 09:29:37 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH 1/1] mm: memcontrol: fix vmstats_percpu state incorrect subtraction after reparent References: <20230320030648.50663-1-caixinchen1@huawei.com> <20230320030648.50663-2-caixinchen1@huawei.com> <20230324171114.32oru5sdubfsfvgi@blackpad> To: From: Cai Xinchen CC: , , , , , , , , , , , , In-Reply-To: <20230324171114.32oru5sdubfsfvgi@blackpad> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.109.31] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemi500024.china.huawei.com (7.221.188.100) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.3 required=5.0 tests=NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Yes, only cgroup v1. On 2023/3/25 1:11, Michal Koutný wrote: > Hello. > > On Mon, Mar 20, 2023 at 03:06:48AM +0000, Cai Xinchen wrote: >> When memcg C is offllined, its pages are reparented to memcg P, >> so far P->vmstats (hierarchical) have those pages, and >> P->vmstats_percpu (non-hierarchical) don't. When those pages get >> uncharged, P->vmstats (hierachical) decreases, which is correct, >> but P->vmstats_percpu (non-hierarchical) also decreases, which >> is wrong, as those stats were never added to P->vmstats_percpu to >> begin with. > I was wondering why ->vmstats_percpu matters (in the end all is summed > in ->vmstats) -- do you mean this is a cgroup v1 only issue? As only > that exposes the non-hieararchical stats. > > Thanks, > Michal