Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1803554pxa; Sun, 23 Aug 2020 17:25:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfETtEkSOHuOUM4M+21dSOrUx0stYeYfpcwQSWmWvlR9/5aRCp1+VlHHLxWF+8ta16MHTf X-Received: by 2002:a05:6402:1593:: with SMTP id c19mr3271672edv.318.1598228745650; Sun, 23 Aug 2020 17:25:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598228745; cv=none; d=google.com; s=arc-20160816; b=c3c/4ReK3TtoVjFHdUswmC0qrmEU6OVG8UhP9bMaulCpktrKsiAbEOw6GwzklScENy R5m75qt6M3RF5f3G+pbjF7D1YrIKSA057GuKLe+Wo3SJOevm1c+sVa4LkYujY3ru44vQ KKWvHmbd7UhdIii/Bc0pSaAgxkLjRITzWA5anQRP14LXauDQ12lkDmvEeCajZLIktimS 8qAuheZJ4Qxnq4SqspP59NvPGtKjYIoSyGRTykRmqkT6OWqsWsrkBg+6+XurrO5DIZsS twHHifKxECZLP/Q0Ht3B42a3zulMCkEtt6TdfiKmtfqJID7r7K++7YSQ1KBu0hHkZ1nX 0D/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=PCADZNh/J/32boJoS2MavSc2bQ2MKxckveY0wBleR1o=; b=AvacUl38EFGJsD+cG4IT+6fr3vTx7v+U1Wy+UKHPtTM4rDmmcHdWLOQftaGKe6dfhb 4GQAwoD6CRZ6Sfgki2aRC+VItjj/QcjxcuiZRZajCAg3ei8AeU/OOOBHCwgJhuamMXwY LRijbjunQ7c83YPA0BugOUrYk8TjXLtqrbYNZfvnU7NY15VLISV3Czs86/DuNlpwE2Pj vCz+jEQ9FKKzrUC/MmEWg7CCLvMeLSj1EA8adzRcM7Ryq+XPryWU1BeBl/T/Bj1vd63F Z6kuxU0wc+BIunXvfDHeKzoKAREtLReqFu5dn8D3vt9bSnkRvYv25HRy2TdHRHUU9L9E sFxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Mb7bMxo7; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c5si6032989ejm.274.2020.08.23.17.25.22; Sun, 23 Aug 2020 17:25:45 -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=@redhat.com header.s=mimecast20190719 header.b=Mb7bMxo7; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726939AbgHXAYT (ORCPT + 99 others); Sun, 23 Aug 2020 20:24:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:43622 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726737AbgHXAYR (ORCPT ); Sun, 23 Aug 2020 20:24:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598228656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PCADZNh/J/32boJoS2MavSc2bQ2MKxckveY0wBleR1o=; b=Mb7bMxo7xVUrj1AGEI9d4aJ0bvBxIfIF0Zqs2UXiWroShWGyz4NzLqOmkLeFbrWhwdRxX2 dAaayhfbwy469aVbRT6zuiEreo49Rx3GKBLh8k3/KxLRqD0uD4sz94tvt9Lil6NUpLzpr9 j/IC9OWL97fwuiH6x1ULPez1YFedDls= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-74-1hBX7jA1N3GJXvpHjPzsmQ-1; Sun, 23 Aug 2020 20:24:14 -0400 X-MC-Unique: 1hBX7jA1N3GJXvpHjPzsmQ-1 Received: by mail-qv1-f70.google.com with SMTP id q4so5235221qvu.6 for ; Sun, 23 Aug 2020 17:24:14 -0700 (PDT) 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=PCADZNh/J/32boJoS2MavSc2bQ2MKxckveY0wBleR1o=; b=YE4lYr7UvTM7PZI3TW5gbp5iShupyik0YLPPENFfNBxGyodfKUWxTDFUC7RY/9IvEw b+qDLXr09xcgI3BmxKbOEncHWmKjqdpw9zoK1pNdo4MRDPGOVHM7rQa/Vg2ObPnwzook yx6Ro2evzIGyAuVtrP6aUuaEujglTPsQWgVwdfIdQneQRuf2pzva7O8nFijzegyJ5f+m DMNCy1SuH1CxzNveOnNMn2mP1m/Du2CD6DUNtuGm+yJxKFd93jmwf7K+QzMqc2cHmq01 SClT/cec2j2viQtvbzJ6PS+T1uhmshf53yCRJ0AUBmZ1bdHybyeBdFxkppYhXtvJBhxe 7J9A== X-Gm-Message-State: AOAM533q2kYNFgHIGplLTjPw9bBP2wt5Xgj5TM05+ZL7XsbR9BLtTlAf CEuXLfGfxNO6As/buNBW+6OmiRDixjJt4Bl6Cz9lRr5wwPreNUUZXjrBBQ51Cen81fatfrR6jKU 5uJsulWQlH7VQVEZeF1QicpkJ X-Received: by 2002:a37:6193:: with SMTP id v141mr2721369qkb.94.1598228654215; Sun, 23 Aug 2020 17:24:14 -0700 (PDT) X-Received: by 2002:a37:6193:: with SMTP id v141mr2721350qkb.94.1598228653981; Sun, 23 Aug 2020 17:24:13 -0700 (PDT) Received: from xz-x1 (bras-vprn-toroon474qw-lp130-11-70-53-122-15.dsl.bell.ca. [70.53.122.15]) by smtp.gmail.com with ESMTPSA id a15sm6827522qkc.29.2020.08.23.17.24.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Aug 2020 17:24:13 -0700 (PDT) Date: Sun, 23 Aug 2020 20:24:11 -0400 From: Peter Xu To: Linus Torvalds 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 Subject: Re: [PATCH 4/4] mm: Add PGREUSE counter Message-ID: <20200824002411.GB6231@xz-x1> References: <20200821234958.7896-1-peterx@redhat.com> <20200821234958.7896-5-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 22, 2020 at 09:14:53AM -0700, Linus Torvalds wrote: > 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? Is wp_page_reuse() only used in cow? I saw that the callers of wp_page_reuse() are: (1) finish_mkwrite_fault (2) wp_pfn_shared (3) wp_page_shared (4) do_wp_page Since (1) is only called by either (2) or (3), while (2) and (3) apply only to shared memories, so I'm kind of sure the statistic is done via the changed path in do_wp_page() that is touched in patch 1 (my program was using private anonymous pages). Maybe I missed something, though.. > > 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. Yeah I haven't thought deep about this statistic, imho it would be something nice to have (besides helping me to verify the tests) so I still posted it instead of keeping it in the local repo. If this statistic is not liked by anyone, then we can definitely drop it. Thanks, -- Peter Xu