From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752485AbeEPCuF (ORCPT ); Tue, 15 May 2018 22:50:05 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:56221 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752038AbeEPCuE (ORCPT ); Tue, 15 May 2018 22:50:04 -0400 X-Google-Smtp-Source: AB8JxZqVIpAOgauCgJexe0tvVHnan2aaxvlsmAEyoxSozBw2iTgZCs4DGmLeCQ/pUJgAoTECuoLQbH/ZX2zY8WchMPo= MIME-Version: 1.0 In-Reply-To: <1523975611-15978-24-git-send-email-ldufour@linux.vnet.ibm.com> References: <1523975611-15978-1-git-send-email-ldufour@linux.vnet.ibm.com> <1523975611-15978-24-git-send-email-ldufour@linux.vnet.ibm.com> From: Ganesh Mahendran Date: Wed, 16 May 2018 10:50:02 +0800 Message-ID: Subject: Re: [PATCH v10 23/25] mm: add speculative page fault vmstats To: Laurent Dufour Cc: Andrew Morton , Michal Hocko , Peter Zijlstra , kirill@shutemov.name, ak@linux.intel.com, dave@stgolabs.net, jack@suse.cz, Matthew Wilcox , benh@kernel.crashing.org, mpe@ellerman.id.au, paulus@samba.org, Thomas Gleixner , Ingo Molnar , hpa@zytor.com, Will Deacon , Sergey Senozhatsky , Andrea Arcangeli , Alexei Starovoitov , kemi.wang@intel.com, Sergey Senozhatsky , Daniel Jordan , David Rientjes , Jerome Glisse , linux-kernel , Linux-MM , haren@linux.vnet.ibm.com, khandual@linux.vnet.ibm.com, npiggin@gmail.com, Balbir Singh , Paul McKenney , Tim Chen , linuxppc-dev@lists.ozlabs.org, x86@kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-04-17 22:33 GMT+08:00 Laurent Dufour : > Add speculative_pgfault vmstat counter to count successful speculative page > fault handling. > > Also fixing a minor typo in include/linux/vm_event_item.h. > > Signed-off-by: Laurent Dufour > --- > include/linux/vm_event_item.h | 3 +++ > mm/memory.c | 1 + > mm/vmstat.c | 5 ++++- > 3 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h > index 5c7f010676a7..a240acc09684 100644 > --- a/include/linux/vm_event_item.h > +++ b/include/linux/vm_event_item.h > @@ -111,6 +111,9 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, > SWAP_RA, > SWAP_RA_HIT, > #endif > +#ifdef CONFIG_SPECULATIVE_PAGE_FAULT > + SPECULATIVE_PGFAULT, > +#endif > NR_VM_EVENT_ITEMS > }; > > diff --git a/mm/memory.c b/mm/memory.c > index 425f07e0bf38..1cd5bc000643 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -4508,6 +4508,7 @@ int __handle_speculative_fault(struct mm_struct *mm, unsigned long address, > * If there is no need to retry, don't return the vma to the caller. > */ > if (ret != VM_FAULT_RETRY) { > + count_vm_event(SPECULATIVE_PGFAULT); > put_vma(vmf.vma); > *vma = NULL; > } > diff --git a/mm/vmstat.c b/mm/vmstat.c > index 536332e988b8..c6b49bfa8139 100644 > --- a/mm/vmstat.c > +++ b/mm/vmstat.c > @@ -1289,7 +1289,10 @@ const char * const vmstat_text[] = { > "swap_ra", > "swap_ra_hit", > #endif > -#endif /* CONFIG_VM_EVENTS_COUNTERS */ > +#ifdef CONFIG_SPECULATIVE_PAGE_FAULT > + "speculative_pgfault" "speculative_pgfault", will be better. :) > +#endif > +#endif /* CONFIG_VM_EVENT_COUNTERS */ > }; > #endif /* CONFIG_PROC_FS || CONFIG_SYSFS || CONFIG_NUMA */ > > -- > 2.7.4 >