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.9 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 6A59DC4363A for ; Mon, 26 Oct 2020 18:43:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9ECE820732 for ; Mon, 26 Oct 2020 18:43:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="W4UwCYfP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9ECE820732 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 C8B9D6B005C; Mon, 26 Oct 2020 14:43:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C3C866B0062; Mon, 26 Oct 2020 14:43:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B2E836B0068; Mon, 26 Oct 2020 14:43:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0074.hostedemail.com [216.40.44.74]) by kanga.kvack.org (Postfix) with ESMTP id 870676B005C for ; Mon, 26 Oct 2020 14:43:18 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 1B91B3624 for ; Mon, 26 Oct 2020 18:43:18 +0000 (UTC) X-FDA: 77414949276.28.plate64_560089027275 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id F00EB6D63 for ; Mon, 26 Oct 2020 18:43:17 +0000 (UTC) X-HE-Tag: plate64_560089027275 X-Filterd-Recvd-Size: 2613 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Mon, 26 Oct 2020 18:43:17 +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=1603737796; 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=P7GrXdQukH8QcGrvFB9xxnqwsvwICxuOa+4ZolzGNKQ=; b=W4UwCYfP8Bv1a+RM/tDWs3diuLwdo+Kf8of98YlmMYCdyi8X2o5sWHvCVIyuUt2p5ylDp0 K3O7rYW0NSazAqSYngTINJyU9udjlHyJjmFrk6YPJfTNXE+9fhnaR7tYHXITYVWYnAm+0d bwKPEdKmkkk2ndyo1oZ7T07g1mhL2G4= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4144DACA0; Mon, 26 Oct 2020 18:43:16 +0000 (UTC) Date: Mon, 26 Oct 2020 19:43:14 +0100 From: Michal Hocko To: Johannes Weiner Cc: zhongjiang-ali , vdavydov.dev@gmail.com, akpm@linux-foundation.org, linux-mm@kvack.org Subject: Re: [PATCH] mm: memcontrol: correct the NR_ANON_THPS counter of hierarchical memcg Message-ID: <20201026184314.GL20500@dhcp22.suse.cz> References: <1603722395-72443-1-git-send-email-zhongjiang-ali@linux.alibaba.com> <20201026144757.GJ20500@dhcp22.suse.cz> <20201026163133.GB548555@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201026163133.GB548555@cmpxchg.org> 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 Mon 26-10-20 12:31:33, Johannes Weiner wrote: > On Mon, Oct 26, 2020 at 03:47:57PM +0100, Michal Hocko wrote: > > On Mon 26-10-20 22:26:35, zhongjiang-ali wrote: > > > memcg_page_state will get the specified number in hierarchical memcg, > > > It should multiply by HPAGE_PMD_NR rather than an page if the item is > > > NR_ANON_THPS. > > > > I am not sure which tree are you looking at but the current Linus tree > > already does have this hunk. > > This tripped up my pattern matching as well. You go to the code and > you see this bit already there. But it's only there for the local > stats, not the hierarchical stats, and the code for them is nearly > identical - except "%s" vs "total_%s" and memcg_page_state_local() vs > memcg_page_state(). You are right! Completely missed the total part. Thanks! My bad! > Zhongjiang is updating the hierarchical stats a few lines below where > you see that hunk. Acked-by: Michal Hocko -- Michal Hocko SUSE Labs