Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp627431pxa; Fri, 21 Aug 2020 16:51:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD09hZPPwJHceigW5lTGaRPfum+KWzrgvj0HWiGsqgYZhTePkwCzd1ghwpoUyV7j+08zJ2 X-Received: by 2002:a05:6402:2069:: with SMTP id bd9mr5085554edb.127.1598053910536; Fri, 21 Aug 2020 16:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598053910; cv=none; d=google.com; s=arc-20160816; b=ZEEc9hn2z8i5Ap11Z6XiGKKavvfLWWS8UpYGcLgA96o8PJXhE2Vmdl3nOW8xYcxqo4 Q+PASVv6EtdNirKgRFqfOuF5aKs5XwgCzfNQ571zMfv4mNAKdUqb7zwW7liu7BsPIzM3 k7NN7vWYbiDh5QbcsNv8v2aUnFT8z4bSx6/Mq01TSqi3siJwL1aYVMl+yF5fKvSB+f5r DaPAS6qj8JNY2ZxRGsogqAO2TP4FR0mHdB7+Vn8zkwy9PCDyHiOjJd2QWewRLMy2rw6R 5M/AMMeMMMOrY6LckSrLMJBsi/8K02d0F89aLPBqWtmCt6vAhs/13KX0WiUG8PfjgAsG +WbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=r0CkcmCYgcP4TRFy3+MaJk8hhxqQa23QkpKUGatylGE=; b=PlMsu9aP5hGqRAluk5h7IEI2V9oXQ+kneUsQFXDvKx01DxAOE+HuMr6VhArcZ8v8aO 9z73w4BHlY3RNHRVcNo7OWX69pSXCppxQJLHwBav+Vd/PYqerCrvfk3sQ7DC/54NOKge mx0/hKaDeEiT9n7lMUNq2fvq/xmz5oskUzarfRVh4TGOQ5r2KVzwdIC1ma2le//Q3krg fbvKL2Muvwel9DmsCKvx1DfvaVFFZXAp4XWrDSbf6+/IBUKETqQ7FSdmAtvYSKs9Qv2M kZble7mBWcZzCbrLB/W+o5Gidd4FDm/gaF/lQo3CIBro7R/bZBWHbiHq26G7JS78y6hM mxzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DydGPsIn; 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 y5si2132430ejm.213.2020.08.21.16.51.27; Fri, 21 Aug 2020 16:51:50 -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=DydGPsIn; 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 S1726897AbgHUXuX (ORCPT + 99 others); Fri, 21 Aug 2020 19:50:23 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:42259 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726737AbgHUXuO (ORCPT ); Fri, 21 Aug 2020 19:50:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598053812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r0CkcmCYgcP4TRFy3+MaJk8hhxqQa23QkpKUGatylGE=; b=DydGPsInDYqspIePWektOp8KxYhRBl9PlA9uTc43vehmRuR2F5HN2uJ/Ll91IjQmrP1NwE rxGw9T1uGwwFWjw62jo/k6aw7+Cn4Q10cKxUQ5emTWYbvcHF4zFFi6Ta/pmlrPXhtJ9QvA EoPZqC+4zWjPOQX2wUEn+hh1z1qhYn0= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-85-UgnwhL5EPWKGv6hmT2GFMA-1; Fri, 21 Aug 2020 19:50:11 -0400 X-MC-Unique: UgnwhL5EPWKGv6hmT2GFMA-1 Received: by mail-qv1-f71.google.com with SMTP id q4so2308317qvu.6 for ; Fri, 21 Aug 2020 16:50:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r0CkcmCYgcP4TRFy3+MaJk8hhxqQa23QkpKUGatylGE=; b=NXkh8ouNm0Gd5nTSFTLiPMZSC5mg+UYfb+GByeLc3Pl4df15ZnT75DRmKExJA7LB2k RjN9qZjMzz/t0tBl2G7bZe84VuvSKvr+XZIlKkFstNDKdnHMYXLjFEdq3AsVv8mvGoy1 6wi6sZk1rohPwGe/GI53qYQBtLSDPcXTq1kQWrKr8GaNFTohQCftm7SjI75tEOzIK+jJ hdVR7KQwqEbiBHEssncHKxWzg5SjfUdRRUuHqoHKlPVAHCLKt74w77mwV6YNqJdfef5/ QpLHR9AgCBu51E9QoDqlOca3Bd8dQtSf/kNX49r8DOzalR9fqxVtkwDz70Zr3QzkR9W0 D3Tg== X-Gm-Message-State: AOAM533oni5zlzfVimxX8Cb4C3l0yh+wIhsnEwn57jMYuXW5aOnn+tm+ J8eGxbDutgBLBHGh3s+KJWwOhWLsGiDh/oXl+KxLrxNit9Q8IicLleEBa1smQMTkQT1qV8fGI+W uTynZ/qexXG8Hd7YZTHheYxkV X-Received: by 2002:a05:620a:142:: with SMTP id e2mr4945275qkn.418.1598053810815; Fri, 21 Aug 2020 16:50:10 -0700 (PDT) X-Received: by 2002:a05:620a:142:: with SMTP id e2mr4945253qkn.418.1598053810611; Fri, 21 Aug 2020 16:50:10 -0700 (PDT) Received: from localhost.localdomain (bras-vprn-toroon474qw-lp130-11-70-53-122-15.dsl.bell.ca. [70.53.122.15]) by smtp.gmail.com with ESMTPSA id t69sm2821600qka.73.2020.08.21.16.50.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2020 16:50:08 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: "Maya B . Gokhale" , Linus Torvalds , Yang Shi , Marty Mcfadden , peterx@redhat.com, Kirill Shutemov , Oleg Nesterov , Jann Horn , Jan Kara , Kirill Tkhai , Andrea Arcangeli , Christoph Hellwig , Andrew Morton Subject: [PATCH 4/4] mm: Add PGREUSE counter Date: Fri, 21 Aug 2020 19:49:58 -0400 Message-Id: <20200821234958.7896-5-peterx@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200821234958.7896-1-peterx@redhat.com> References: <20200821234958.7896-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This accounts for wp_page_reuse() case, where we reused a page for COW. Signed-off-by: Peter Xu --- include/linux/vm_event_item.h | 1 + mm/memory.c | 1 + mm/vmstat.c | 1 + 3 files changed, 3 insertions(+) diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index 2e6ca53b9bbd..18e75974d4e3 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h @@ -30,6 +30,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, PGFAULT, PGMAJFAULT, PGLAZYFREED, PGREFILL, + PGREUSE, PGSTEAL_KSWAPD, PGSTEAL_DIRECT, PGSCAN_KSWAPD, diff --git a/mm/memory.c b/mm/memory.c index cb9006189d22..148eafb8cbb1 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2622,6 +2622,7 @@ static inline void wp_page_reuse(struct vm_fault *vmf) if (ptep_set_access_flags(vma, vmf->address, vmf->pte, entry, 1)) update_mmu_cache(vma, vmf->address, vmf->pte); pte_unmap_unlock(vmf->pte, vmf->ptl); + count_vm_event(PGREUSE); } /* diff --git a/mm/vmstat.c b/mm/vmstat.c index e670f910cd2f..4f7b4ee6aa12 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1241,6 +1241,7 @@ const char * const vmstat_text[] = { "pglazyfreed", "pgrefill", + "pgreuse", "pgsteal_kswapd", "pgsteal_direct", "pgscan_kswapd", -- 2.26.2