From patchwork Sat Jul 11 01:14:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shakeel Butt X-Patchwork-Id: 11657641 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CC66D13B1 for ; Sat, 11 Jul 2020 01:15:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 98FCE2076A for ; Sat, 11 Jul 2020 01:15:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Vqc0dVCP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98FCE2076A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DEDAE8D0003; Fri, 10 Jul 2020 21:15:08 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D9BED8D0001; Fri, 10 Jul 2020 21:15:08 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C8B078D0003; Fri, 10 Jul 2020 21:15:08 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0049.hostedemail.com [216.40.44.49]) by kanga.kvack.org (Postfix) with ESMTP id B321B8D0001 for ; Fri, 10 Jul 2020 21:15:08 -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 7335945BC for ; Sat, 11 Jul 2020 01:15:08 +0000 (UTC) X-FDA: 77024026296.19.birth46_1c16c5226ed3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 481421AD1BA for ; Sat, 11 Jul 2020 01:15:08 +0000 (UTC) X-Spam-Summary: 1,0,0,4836be0ad1380127,d41d8cd98f00b204,3mhijxwgkcoevkdnhhoejrrjoh.frpolqxa-ppnydfn.ruj@flex--shakeelb.bounces.google.com,,RULES_HIT:41:152:355:379:541:800:960:973:988:989:1260:1277:1313:1314:1345:1437:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2195:2199:2393:2559:2562:2895:2912:3138:3139:3140:3141:3142:3152:3352:3865:3866:3867:3868:3870:3871:3872:4321:5007:6261:6653:9969:10004:10400:10450:10455:11026:11473:11658:11914:12043:12048:12297:12438:12555:12895:12986:13069:13161:13229:13311:13357:14096:14097:14181:14394:14659:14721:19904:19999:21080:21433:21444:21451:21627:30054:30070,0,RBL:209.85.214.202:@flex--shakeelb.bounces.google.com:.lbl8.mailshell.net-66.100.201.100 62.18.0.100;04yrqtxzok799y69hbsiea99j48c8op6qu5hxjzut6dts4d6wtrpnyxg37dqb16.xk5zg3ripryh5w5jbrc1qm3dijbh837qmoj44t4xa77euadodeiruazzj91modf.a-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom _rules:0 X-HE-Tag: birth46_1c16c5226ed3 X-Filterd-Recvd-Size: 3773 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Sat, 11 Jul 2020 01:15:07 +0000 (UTC) Received: by mail-pl1-f202.google.com with SMTP id c15so4512540plz.15 for ; Fri, 10 Jul 2020 18:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=U5INvZHUBg4ofchuBpYEmrsR0JVEvqywIM5ZpiyAXHI=; b=Vqc0dVCPkiIhRztJakvxnD5/CbvZkoLqqkWRKgipucloSLX3KJKQ+gO7iBCohgWL/h a7iCV0zMQYyZN7dmF5SQAJFYfmAPLuq9edmHoB+QUpKf2Lm4kDb+zBfTMgcA53hXAwQW 8jyPNUd+aDlb5dI54nMA5C99IaFtQDFKWI8nmxOSomEXB95YaCyK9mYmpScip7eTJrED 2IsLwgduzjf5x/+qO6RilO5f6LIMHNUeHgy0w2LuxNGeJRrVDPbfb1GuE1mOBLL2SoFi kCqrcSu4+BVInG15BShvpUILEjf2a/9htOYICbbnqmjHu+soHfVEro46Ka29eZY1tPhi SqNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=U5INvZHUBg4ofchuBpYEmrsR0JVEvqywIM5ZpiyAXHI=; b=e8OU2rIFLWPhJ8mMXnxsBGSo55c30NBlUFetM/3fUd9AmCl4LEtYYwtLGZS2LW1wPC +aXToVYPI94ihlKcqPSNslkIDj7/3OOuqWche09t/8H/bMwwddrOP9tqCJHUIJOvki+Z hx55sX4iQzsCVTpqEHT5h0uZ59ei7SAyEvZQ0oqVIx83VHdmssrQcG7o/po33LC+rin2 UWreRsbKGlxDrk/yJfD9/Lewymg607GRjSBZkcqRqMudouwhSv/vh+6F/TV2EylorVQi D/ogJ7WT7NrrN5AQFvuHNOivi1SVhdbwBTe7c1hnESY9QrkwwDbR/U/H++hEXfjCazrO w2EA== X-Gm-Message-State: AOAM530cop8s5I+pLTGDFC36ummDYHe0BEGaoD3mYC66p2ZFslNF3M9i LE30aJIS8N22U22g83OAjfOwDgtE13sQHg== X-Google-Smtp-Source: ABdhPJz30qPG2tBMvb+LcVB4D7J198s33oZLzj9uQnuf8VxfukhyRVVMvK5TlsDHo2F41f0K7s6iBg7wHa1yig== X-Received: by 2002:a17:90a:f493:: with SMTP id bx19mr7799392pjb.134.1594430106382; Fri, 10 Jul 2020 18:15:06 -0700 (PDT) Date: Fri, 10 Jul 2020 18:14:59 -0700 Message-Id: <20200711011459.1159929-1-shakeelb@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog Subject: [PATCH] mm: vmscan: consistent update to pgrefill From: Shakeel Butt To: Johannes Weiner , Roman Gushchin , Michal Hocko , Yafang Shao , Chris Down Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Shakeel Butt X-Rspamd-Queue-Id: 481421AD1BA X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.023735, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The vmstat pgrefill is useful together with pgscan and pgsteal stats to measure the reclaim efficiency. However vmstat's pgrefill is not updated consistently at system level. It gets updated for both global and memcg reclaim however pgscan and pgsteal are updated for only global reclaim. So, update pgrefill only for global reclaim. If someone is interested in the stats representing both system level as well as memcg level reclaim, then consult the root memcg's memory.stat instead of /proc/vmstat. Signed-off-by: Shakeel Butt Acked-by: Yafang Shao Acked-by: Roman Gushchin Acked-by: Chris Down --- mm/vmscan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 5215840ee217..4167b0cc1784 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2030,7 +2030,8 @@ static void shrink_active_list(unsigned long nr_to_scan, __mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, nr_taken); - __count_vm_events(PGREFILL, nr_scanned); + if (!cgroup_reclaim(sc)) + __count_vm_events(PGREFILL, nr_scanned); __count_memcg_events(lruvec_memcg(lruvec), PGREFILL, nr_scanned); spin_unlock_irq(&pgdat->lru_lock);