Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp994442ybt; Fri, 10 Jul 2020 18:57:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgRsVFNWVR+ExWjZvEHnj2ykFf6Kcd34gNW8fsAyNwe4x/2Hp1a2Kb92e//8E4b/UKvroK X-Received: by 2002:a17:906:7c8:: with SMTP id m8mr63013826ejc.527.1594432668138; Fri, 10 Jul 2020 18:57:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594432668; cv=none; d=google.com; s=arc-20160816; b=lXUOwkl2QFZU17fn036S0kvcF5ecrZYM2dCIT0Ht6o/Q0TjyNqB6EjpNzxVQJmZ7GG o4fZ7Il/xsY8d2M6gWInQ1hbQUdCpdclmiXN/n67ihJssaQ085F1wt4BA9DfS0SshQOr KoP7veJR/aH5mJ2TuuRNxMyyBjJ9N/1OtX6BerOkMUHPdjwM3MPgz/2a0L3Hy8kg0+vy fhEFQW+ReTKP1i/d86KUVRd5mgCdKPahexw+hEBtqrGBmdG47rFzYON6YuA3oH7L/15G uHOEzsaTDeLU+VBGhPLaBdqkZap4lQSNM58Erc6x7CWiejM68WkfHXfo25410qL4Gi3n FreA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=fHI4iXtmX01yNpRFDCOqzvlBSYR9wvdFvILVM3jzt4w=; b=Cehs/T/sudutLo1BQGsxhJni9TqDv+Ts+adRElDx59eqCWsvcGXQ4J5IlA4ftywmYR Xkuj31fIyTtb7MEcYGiTfp+waWqgKdVa+lqszSoVe0YR2ikcyi3LNodgJzqxH7+Sx9s0 tcK+sN/0M8aWlSurAMAC93Sg4CzGhQL4lUxgKC1dk5ptN2v2K5nEbqh90CagN5C5bIPG g1BP+Wd7IPP5dpoJmoDvtS57pJbhqwyd14JLeg/NbjxVDdBhuCvBtWMTdCcnJIrUesyt Q+HBKN6hW6s4IymBspw5ih7yfg4LJNzAxM1H2TFb5lxYRxB+g1C+JTNEn4BbH+ziriDH eEQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=M7P0dNpc; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f1si4910723ejx.211.2020.07.10.18.57.24; Fri, 10 Jul 2020 18:57: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=@gmail.com header.s=20161025 header.b=M7P0dNpc; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726955AbgGKBzF (ORCPT + 99 others); Fri, 10 Jul 2020 21:55:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726605AbgGKBzF (ORCPT ); Fri, 10 Jul 2020 21:55:05 -0400 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4DAFC08C5DC for ; Fri, 10 Jul 2020 18:55:04 -0700 (PDT) Received: by mail-io1-xd43.google.com with SMTP id i4so7952016iov.11 for ; Fri, 10 Jul 2020 18:55:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fHI4iXtmX01yNpRFDCOqzvlBSYR9wvdFvILVM3jzt4w=; b=M7P0dNpcggbgMq8M3ZUKrRzfuzHd/DzMtIcX7NdMEr00hAR/QZ8gt5RoDEUgT1yOxK px4ROFrpvTlpcSBMIMFpfZzmLQxIPjab+7WvXPLMWWZzjghjraS92SqCf6bTARF55h6F 6lUI+pieHU7pOZjluSZcZ0NCsGMSZ3qjzBpM/dfPFHQB6JBGG3pG9g57SsnS+xx017up OVdNzDD6+oFnkmXyclJYkItOLkzZlfybaEfvA7vnpYcFQ3AJalyhdgL0F2aDpZGwDrwM NQIU+H9g9Y5ufClFM/5bwUhV9ABYhzjWAOJwqtxpZx46WosAw1d6pqlhBRkAkmsGYCXB 27LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fHI4iXtmX01yNpRFDCOqzvlBSYR9wvdFvILVM3jzt4w=; b=AoE8+8y7URKR1LvCzHtwchRFOiwDS7Xd98ekpaXEifGziGhXSAgUMWbFTmF45QYGcI zFjKuUye5yER5stqL0LFUjZOqf6qUgZzWGKY0sYycRrBB8RAVtE5QkRMcgvGl+L3k4SO 5/G8E6V9H8RVOOiqkzt7dNRaY/PEtYgkAU57zCG9DG4AZk1GhX52hqogN6I1ZhdfIE5M SRqOPLmcBLoWQ9X3Pz/s++Bkjbz00rCe+b6V2/IJvzJAC70pM8HM/ghdEyLkswbral05 8PI7sAd7t44U8tx6GpRMGF1h9rjJhxGnEA/cLvwRBkh+1T24X+YTda8fpxUgET9Up3Es m/dg== X-Gm-Message-State: AOAM533SFHH6mdPw4bW45fZrxH53WodOzXix/bFUBIQc3GDYrvRbAexd qjneam6j/uFY3AEqJHf+OC+qHQEWWdVg+fIKffs= X-Received: by 2002:a5d:9752:: with SMTP id c18mr26549080ioo.10.1594432504271; Fri, 10 Jul 2020 18:55:04 -0700 (PDT) MIME-Version: 1.0 References: <20200711011459.1159929-1-shakeelb@google.com> In-Reply-To: <20200711011459.1159929-1-shakeelb@google.com> From: Yafang Shao Date: Sat, 11 Jul 2020 09:54:28 +0800 Message-ID: Subject: Re: [PATCH] mm: vmscan: consistent update to pgrefill To: Shakeel Butt Cc: Johannes Weiner , Roman Gushchin , Michal Hocko , Chris Down , Andrew Morton , Linux MM , LKML 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 On Sat, Jul 11, 2020 at 9:15 AM Shakeel Butt wrote: > > 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 > --- > 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 > -- Thanks Yafang