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=-3.9 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 0DF3DC433DF for ; Sat, 22 Aug 2020 16:15:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DDE332072D for ; Sat, 22 Aug 2020 16:15:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598112919; bh=isMvzDNGOUiMNk2BIEA3QEi93PSQ3Y8CgtPqLIRZLZk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=MX2XxJzbE4yZFDwfSWngOyBEJcBsgDjXdADOXhKZDhdTdd5vvlMETwz7AgDdge5sD r4WIjXxJksUywZGqZOrCa9nziROHCLEhTzhTHTVrzbh7EeIYJYaCE0CVZ06ogJf/lQ vBwV28GdBd8mdT1329wHqGN2EQKiEY/DKZFg+uB4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728386AbgHVQPS (ORCPT ); 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-Google-Smtp-Source: ABdhPJxGFQyR6X7jfGwNve2VYTk84FXXXS0mySEKqGAXYzOnBgbMhOrZ4CsqfT7EPLBmd5Jv9k7j5Q== 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 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=-3.9 required=3.0 tests=BAYES_00,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 6A677C433E1 for ; Sat, 22 Aug 2020 16:15:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 037A620738 for ; Sat, 22 Aug 2020 16:15:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="USe4atxT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 037A620738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8326A6B0062; Sat, 22 Aug 2020 12:15:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E3478D000E; Sat, 22 Aug 2020 12:15:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7216A8D0002; Sat, 22 Aug 2020 12:15:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0167.hostedemail.com [216.40.44.167]) by kanga.kvack.org (Postfix) with ESMTP id 5DFA96B0062 for ; Sat, 22 Aug 2020 12:15:13 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 209DA181AEF07 for ; Sat, 22 Aug 2020 16:15:13 +0000 (UTC) X-FDA: 77178704106.16.rate21_56057c027043 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id DFBDA100E6903 for ; Sat, 22 Aug 2020 16:15:12 +0000 (UTC) X-HE-Tag: rate21_56057c027043 X-Filterd-Recvd-Size: 4473 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Sat, 22 Aug 2020 16:15:12 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id g6so5063218ljn.11 for ; Sat, 22 Aug 2020 09:15:12 -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=dKeicca5aPNwktMsV2r4oSEPQMLTua68Gc1r0Kf5UfzscqN6zU60KbjVgQBETLYBih yZCN+Ko9OYUMvgK465NuJrOVFcVX7WZf3ZcQZqKmRnem7Q4z20fqfi3USeRL9tAWb6kv KFW0ornztgpIPFPWTzdEzUnm1zCyxp2jFVTKhCyWYzwC0O8MN3wjNAR+JhoX85hi6d4j KBQOC9j3GH+IHkTsft9ChvBpxUg/BIpUMSqctTiXH+Ou48qB+egeLZkiDLinvz3Q1v+y FmkZO6Tn9yFcVeRRWGBPoVBPm99UnlhNdq77HurPouK5IUt1QGnudnkSblNrKf5Qo/QO EVWQ== X-Gm-Message-State: AOAM530kJfsvM1LHZ6eVC+86I+hHqWEKDmgv4MkAVQV940OHJGB05MDl TLCUV+11P4QhebKwTWdlKpC+RYgWYIfrRA== X-Google-Smtp-Source: ABdhPJxKSkyO2Qek6OTMEjLslEEnO5+3CCbF7CYymjzk+P6Un1Z3z87mog99YFcUf+Vl/qLHeIkKuA== X-Received: by 2002:a2e:9056:: with SMTP id n22mr3674124ljg.374.1598112910534; Sat, 22 Aug 2020 09:15:10 -0700 (PDT) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com. [209.85.208.173]) by smtp.gmail.com with ESMTPSA id s127sm1084231lja.119.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-f173.google.com with SMTP id v12so5076449ljc.10 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" X-Rspamd-Queue-Id: DFBDA100E6903 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 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