Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp976905ybt; Fri, 10 Jul 2020 18:16:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyl/sLCZzyWEZEf9UGCXfxBZfWtIZKPlY7cMwqJ9RTg3WXyn/NOo725qvuiu0HY13f2GQki X-Received: by 2002:a17:906:ca4c:: with SMTP id jx12mr58937315ejb.231.1594430208504; Fri, 10 Jul 2020 18:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594430208; cv=none; d=google.com; s=arc-20160816; b=JVY7iUQf6nVu6tpnU2t5uxxVgCIX8zZrBcx/zT9zX/O671T38Fbh4/Ro7KY8abR6N5 7sKicQuX15rh8z7mSbQR9q3rNUbgm9NCjTEOigGT9trA2HOJ5tDSiDnPhr/TBUPkaM77 C4Ky6OsxwXbcqEaoFWcgm2bsF6eJ1W9ZfnoBlllpGRftEyC0EcZZ1WabhPiZGLTr0OFw QpwzvIAK+zW7UjdfBGSFF0Oeaz8zzVKnKgR+7s0ybVO45Ep27sfT6W+bgSvXlT+so9Nq a4noGtFw8VwAn98FE3EGH9NhD2PArVf2zo5N80lmpoFhLqKgmQ/OoJd0qIB0J9ZPWYgT TUfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=U5INvZHUBg4ofchuBpYEmrsR0JVEvqywIM5ZpiyAXHI=; b=WnOExLx33he8Za4RoKDiRqCfPt2wzzqNWG/WKKIswuCLebrecJiwoP15J3Zag2G8i0 VLXel4x/Luq8rIHI/hFn4Wn3eWurcHAhpySuCAXVe6xwgokEJ2HxHD/xJeQhNQm4dIaY wyHv/iZK+yP4hIjKs8de9VIVgDH0LwOYVHY1V63Vv3ZvwPsjkAFpWVa5ZFZ4fK4M6Qx/ lbL0wl6Ienjr0xLtx7J67eBAA2NtwNsNkex0EGq42+UzfEu+1gBQiTJsQhSmb3n8p/La 3bCdwP01QhbMuhT8aOX9WcMMwVF2/3ml2tx1wSXt+/BpVJ4SvXiLnx2YjdNDOA46FiXX 41fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Vqc0dVCP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d26si5513830ejy.594.2020.07.10.18.16.25; Fri, 10 Jul 2020 18:16:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Vqc0dVCP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726829AbgGKBPI (ORCPT + 99 others); Fri, 10 Jul 2020 21:15:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726780AbgGKBPH (ORCPT ); Fri, 10 Jul 2020 21:15:07 -0400 Received: from mail-pf1-x44a.google.com (mail-pf1-x44a.google.com [IPv6:2607:f8b0:4864:20::44a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DE80C08C5DC for ; Fri, 10 Jul 2020 18:15:07 -0700 (PDT) Received: by mail-pf1-x44a.google.com with SMTP id a25so4805436pfl.2 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=gahws3zMf8S2ejjyOwIyRGnB7WAEJSoQIOzMiNL7dbZ9QOahJFhtdSUFAmatcADpCD sbZbzLzHIhZu+Vs+iSPDktcJFSxSEwgrZ+1w+bkx9R48E//1/M4Lieyi1Ga9B1acMzo1 dUtQBito7TvEvX3kxOKJwp6WDUNxbu1zTl+dMznrxEfRKJAa9Ak5uuIm9bdCUQ23cJ96 omeaes2WbfQE1gYgFpKEaUGrRRu/obLpz517B4b9+6AnaFg+YFeTYQT8o852pRSJ7aa+ iOUbW2kscoxzzEgon4kWO7hT+Vz0qLyy0pn11USJIVtv4sB3ob7nvKuj2INU65VMBKIz kd3A== X-Gm-Message-State: AOAM533ha6FDSkYDACpreadCY3qY1pPTFM3GBa1eCAcLWu/Ffk/gQRC+ /2DoSQOUQrOSHDOAwaq5HP59jCx47XUNYg== 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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); -- 2.27.0.383.g050319c2ae-goog