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=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS 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 582AFC47254 for ; Fri, 8 May 2020 21:44:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 185102173E for ; Fri, 8 May 2020 21:44:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20150623.gappssmtp.com header.i=@cmpxchg-org.20150623.gappssmtp.com header.b="BO4e5bD/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 185102173E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 97C9890001D; Fri, 8 May 2020 17:44:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 92D0190001C; Fri, 8 May 2020 17:44:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8698790001D; Fri, 8 May 2020 17:44:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0047.hostedemail.com [216.40.44.47]) by kanga.kvack.org (Postfix) with ESMTP id 6E6B790001C for ; Fri, 8 May 2020 17:44:24 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 340734DD9 for ; Fri, 8 May 2020 21:44:24 +0000 (UTC) X-FDA: 76794880848.19.field20_2661bc5f9b84d X-HE-Tag: field20_2661bc5f9b84d X-Filterd-Recvd-Size: 4645 Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Fri, 8 May 2020 21:44:23 +0000 (UTC) Received: by mail-qk1-f193.google.com with SMTP id b188so3337724qkd.9 for ; Fri, 08 May 2020 14:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=hfgFNTJ/A8Lg7nI9g+Xp3FmILdU0dHMohrFwQmfLQXo=; b=BO4e5bD/Q+sMJjS2zPBJ9fA0BfYUE6sPFxYwsNOwSV4A2F0R22Kk02cgB2O7t3YZjN WXq235+CpxzxCfyxC4UYLkH/H+vrK1wMRWc3F3A11zVLIM3R2j0B/m2cBQTChZS2n/IP ycONKTo/SlL6z7hvTvz8LF/MSBS+pQTo+GfyZVFUF2s22DI7IQqTmOIRk93B6ONU/3d+ Pq1q9czvaqdabgSzhAER31wB8ODppfSiaxEfMXyIsYMZeQmm7jGvrzMFyqWdkB6tXXwH A2Lb4VY/NrvuvTG+OprSMVStvHwAZoJcabj5QflkXcTJuSH6Gb0UOWCFSguBlgr8iiZr 7VuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hfgFNTJ/A8Lg7nI9g+Xp3FmILdU0dHMohrFwQmfLQXo=; b=pm27K21K2tsaYJmD8/7c1csuDA4tfIdbAYtkzH8uULCNPfM9GXA1cdxFFzaeKkQblu xpKFfuywuqxolS4qW9hKhX1Q/NHmzI7QhXtjo9lwgb6yvBf0nH7UeBhjTYD+co3aS1zr keYT6/FUqQLScjo3Lwgs4FZ1F2OJAHwXxNbmUxdK3alqbitNqigGmPWQ/LOMMKXbcpj1 5fXTRHrPvXH0TlaXJ3HD/YwFyF3LUleJyqkAhNR3ecMaMxOii7Gu9yGcR9Rzhgv5f7s+ /wKg7JTfTggQMVrhWWe7TBukInrFIhKmOkk+sXn1DbiZmYy8WocRcGHY3AxkCkXGvaOW pvaA== X-Gm-Message-State: AGi0PubLWlY5OqnTrXqOBZDr0Tp081PGPjqnB01V+d1VekUxJaTKeMog pV5sCsHMEhVvfhOciOahRclRxA== X-Google-Smtp-Source: APiQypIcaFiRBShLfyT2ZablqamrjqanqyX+wOuWHrrB6W4WNcimavEO382WKWr9Frqp3mIoOgsFNg== X-Received: by 2002:a05:620a:816:: with SMTP id s22mr5051840qks.348.1588974262923; Fri, 08 May 2020 14:44:22 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:2627]) by smtp.gmail.com with ESMTPSA id x19sm2116487qkh.42.2020.05.08.14.44.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2020 14:44:22 -0700 (PDT) Date: Fri, 8 May 2020 17:44:05 -0400 From: Johannes Weiner To: Shakeel Butt Cc: Mel Gorman , Roman Gushchin , Michal Hocko , Andrew Morton , Yafang Shao , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] memcg: expose root cgroup's memory.stat Message-ID: <20200508214405.GA226164@cmpxchg.org> References: <20200508170630.94406-1-shakeelb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200508170630.94406-1-shakeelb@google.com> 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 08, 2020 at 10:06:30AM -0700, Shakeel Butt wrote: > One way to measure the efficiency of memory reclaim is to look at the > ratio (pgscan+pfrefill)/pgsteal. However at the moment these stats are > not updated consistently at the system level and the ratio of these are > not very meaningful. The pgsteal and pgscan are updated for only global > reclaim while pgrefill gets updated for global as well as cgroup > reclaim. > > Please note that this difference is only for system level vmstats. The > cgroup stats returned by memory.stat are actually consistent. The > cgroup's pgsteal contains number of reclaimed pages for global as well > as cgroup reclaim. So, one way to get the system level stats is to get > these stats from root's memory.stat, so, expose memory.stat for the root > cgroup. > > from Johannes Weiner: > There are subtle differences between /proc/vmstat and > memory.stat, and cgroup-aware code that wants to watch the full > hierarchy currently has to know about these intricacies and > translate semantics back and forth. > > Generally having the fully recursive memory.stat at the root > level could help a broader range of usecases. The changelog begs the question why we don't just "fix" the system-level stats. It may be useful to include the conclusions from that discussion, and why there is value in keeping the stats this way. > Signed-off-by: Shakeel Butt > Suggested-by: Johannes Weiner Acked-by: Johannes Weiner