Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1053780pxa; Sat, 22 Aug 2020 09:17:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwE7XCLA1PNr0ZBYXt28iXDGiMEUStd8XOq6tHJgYOh7I9MfWT08AvN23S2A98iLd/8S+Pr X-Received: by 2002:a17:906:3390:: with SMTP id v16mr7724531eja.106.1598113044411; Sat, 22 Aug 2020 09:17:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598113044; cv=none; d=google.com; s=arc-20160816; b=yqVihhdApQqrBFsjADeZyHy+zExMvcut3TFRDlTsK1FUOHlZldrjCFiNqAewmXGCzk 65kZZwQjXISByLyLsTGfB50AIIg1H1o2eNTft0UxxolFQ7d7MVK2mnGQOPf23I+IP8FT 80TR1Zczju4rtr3iYoJ1pX/DnmzD4MJ3bWyWLOdtK5AKAuFlSClteGn5nj5+/EYDNDh8 uX40mKJPdnaheKOBe2PaW34S2YK8ly/g60x0HgGvc9/ll1idX8ht4Vz+geKWb/nx2SaK s20utWzkxLcEKstw8HZzdcySkXCBtvD3V4sVJDwVY95vZpiDQWnD/0SsbrvBgGlDzCVo nDtw== 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=Z361/QagF8IRa312xvMzCBJJ5mRG1KZKw3X9EJJOzvE=; b=RZm8w968Q8N4jfgz7+ia7eEm4PfUZu+YFDGvgbmpjwnjrv0UlBsCMlBVfsDtOl8Tnk TzxBY9DXJgU1hxHNhliA62C5nn0Tp3w7HyEtBNU8x7tCFz00wg8Zs/dAly0fHf5Na25V Mlh5vfuhliWPD9/DHr+EKZ9nAp/XZtm9oPupASxnag1zX8Fj5X/aV1ZY5dyaJGek9TWb Yrg9pUQZ1Pnr9Mba79L3/69Fwi8ojJLfrwRinaW21CveY/35O7PAA7K5ARVZhnFoLwdo KGF3NftoOvqo6V0rPfOeswb+9GXsRnUs1afzN/PB5SyEmm2y4x5VXKE9nxtiU81zQryg 4kfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=USe4atxT; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z15si3935818ejr.110.2020.08.22.09.17.01; Sat, 22 Aug 2020 09:17:24 -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=@linux-foundation.org header.s=google header.b=USe4atxT; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728255AbgHVQPS (ORCPT + 99 others); Sat, 22 Aug 2020 12:15:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726534AbgHVQPQ (ORCPT ); Sat, 22 Aug 2020 12:15:16 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 682D1C061573 for ; Sat, 22 Aug 2020 09:15:16 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id c8so2363550lfh.9 for ; Sat, 22 Aug 2020 09:15:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Z361/QagF8IRa312xvMzCBJJ5mRG1KZKw3X9EJJOzvE=; b=USe4atxT1XGsmUmY4JfdNKlZap4kgabPBgLIVxlFlrZTNkT1blbP1Qe1piPCnR05M7 LnI1nx4ew0ih5FZWnknrsgZJYXPZiz2ItoCnZhcYUSjLwHjxB9EPD68EGydBBEXDjr8/ EU5dtBVxqqbT6L431sOPltWgOHKfxgirUbBZA= 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=Z361/QagF8IRa312xvMzCBJJ5mRG1KZKw3X9EJJOzvE=; b=n0uwOCrAy9XxmiBNvL9Ex1AZpOrADIxXC82hfoU8oW0nfmUo7ODQXpQgpJDeF4bSjX e+8ApbiEMZ/JeRt51LiyE8DbZ9sI11255JtM88Y0eTpwskMnIQQBtY6+cvXvgTiJDiry /N5jSNx/tpnf/RTRiN//6qtevM1Wd07sN8JRRMVrgBKAdA0CW+c4zGwTEhFqGseYxtQo QSBwm68jueqUBbscyjnovz2wBU5ZEGgcGwK8OvYFDY0v467oJzR5S0Mga3SH6WmtvmNG IYbjT3svsblv3z9Uy/kEEqk6QJAThSaUFTTlb4If/oUpAJ4U3bChYOIp7zqBqf3c+yij qFTQ== X-Gm-Message-State: AOAM532g6VZknnMYX53NpXOMAyYgWrqbiPGXvVqQovAr42ygcmdWQWVd wfjZiZ7ZWfU5InEumQelfb5LQG+itTmkXw== X-Received: by 2002:a05:6512:31c2:: with SMTP id j2mr3806248lfe.85.1598112910705; Sat, 22 Aug 2020 09:15:10 -0700 (PDT) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com. [209.85.208.178]) by smtp.gmail.com with ESMTPSA id a17sm1076795ljd.123.2020.08.22.09.15.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 22 Aug 2020 09:15:09 -0700 (PDT) Received: by mail-lj1-f178.google.com with SMTP id t6so5070696ljk.9 for ; Sat, 22 Aug 2020 09:15:09 -0700 (PDT) X-Received: by 2002:a2e:b008:: with SMTP id y8mr3483497ljk.421.1598112908980; Sat, 22 Aug 2020 09:15:08 -0700 (PDT) MIME-Version: 1.0 References: <20200821234958.7896-1-peterx@redhat.com> <20200821234958.7896-5-peterx@redhat.com> In-Reply-To: <20200821234958.7896-5-peterx@redhat.com> From: Linus Torvalds Date: Sat, 22 Aug 2020 09:14:53 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/4] mm: Add PGREUSE counter To: Peter Xu Cc: Linux-MM , Linux Kernel Mailing List , "Maya B . Gokhale" , Yang Shi , Marty Mcfadden , Kirill Shutemov , Oleg Nesterov , Jann Horn , Jan Kara , Kirill Tkhai , Andrea Arcangeli , Christoph Hellwig , Andrew Morton 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 Fri, Aug 21, 2020 at 4:50 PM Peter Xu wrote: > > This accounts for wp_page_reuse() case, where we reused a page for COW. If we do this, wouldn't it make more sense to also count the COW case to see how they match up? Right now we count faults and major faults. So as a result you can can calculate minor faults trivially. But if you count page reuse, you can't calculate any stats on it, because most of the minor faults will presumably be for new pages (either zero or cached file mappings). So the "pgreuse" seems to be a counter without any context to it. IOW, I get the feeling that either we should do this properly (and maybe count "dirty faults" and "access" faults, at which point the reuse case becomes a subcase of the dirty ones) or we shouldn't do it at all. Creating a counter without any way to sanely compare it to anything seems a bit pointless. Linus