From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E9B6C433E1 for ; Mon, 24 Aug 2020 00:24:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DA394206C0 for ; Mon, 24 Aug 2020 00:24:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Mb7bMxo7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA394206C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5FD086B0002; Sun, 23 Aug 2020 20:24:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5AE496B0005; Sun, 23 Aug 2020 20:24:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 49C906B0006; Sun, 23 Aug 2020 20:24:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0095.hostedemail.com [216.40.44.95]) by kanga.kvack.org (Postfix) with ESMTP id 31B436B0002 for ; Sun, 23 Aug 2020 20:24:19 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E171E1EE6 for ; Mon, 24 Aug 2020 00:24:18 +0000 (UTC) X-FDA: 77183565396.06.back22_2d0fc332704e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id AB92810040F27 for ; Mon, 24 Aug 2020 00:24:18 +0000 (UTC) X-HE-Tag: back22_2d0fc332704e X-Filterd-Recvd-Size: 5750 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Mon, 24 Aug 2020 00:24:17 +0000 (UTC) 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-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-204-slHKHsikMLiwOj_4N4rYkw-1; Sun, 23 Aug 2020 20:24:15 -0400 X-MC-Unique: slHKHsikMLiwOj_4N4rYkw-1 Received: by mail-qt1-f198.google.com with SMTP id h12so1127516qta.6 for ; Sun, 23 Aug 2020 17:24:15 -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=NKxtEInoPXPJu1FoCpBfczc55iSec9uP15Sna64ImjuHGYG89c5beb0Z/9TYUwf7kG qGihX76az/f/UEcoqkPaJXLmbcob7LIsUxfj3YJyqLOhqTrzzFkzN8WMEhAXtvFy18hg +c0Q6fpbTigmnzIEa2wpbu3HCGl/t0sq4rsohVihbOgHBnB+IFgWrC8ptILOrQYvbX2O F42CUGGhVpAvMnGgCQa2ajuZ8LEMlWk7L52/MYINPveqQREqftqyCRZVc76VLiKiv7l2 B4UfGK6oPBm73utb6H6LMT2ylv5poy7QSdwpw4Z+hCIXKk+Dnwq8n4yA5Gy28JRlv+jc 66bw== X-Gm-Message-State: AOAM533Amy/H66kfkVY1sFyrQbAkxS+IB3MESVKNNycwTbQmDt/wnVFS cnLMQH7Y0BQvjgTU7eJ0OGgDKt7dWxahlqKx110CpvZdQFVFJjrDs+eg+GhfGiKYpb+hARfFAzn 6HKThR3HApeA= X-Received: by 2002:a37:6193:: with SMTP id v141mr2721374qkb.94.1598228654216; Sun, 23 Aug 2020 17:24:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkcTolph1Y5YpkQJT+t0zUoDh4CQuIN98lIrZp0YWFuOexKcrn7yV6gBF7cIru30yYY3y13A== 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 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Queue-Id: AB92810040F27 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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