Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3202447yba; Tue, 16 Apr 2019 06:50:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzn4qT0u5zHSGz7G5gNWQFxuqiDMqMHf6VJFcQL8HHkkAGJP0tBO4b7yMVGb3zO1jSWxW7z X-Received: by 2002:a17:902:8d8b:: with SMTP id v11mr82119941plo.133.1555422602410; Tue, 16 Apr 2019 06:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555422602; cv=none; d=google.com; s=arc-20160816; b=z6jzfGTBBtwhG9VChL7/E9pVPFwt3RIrvFY+U+6PSEZsHm5WWwc92pmRd+I4HE9hZj EeRGIEuTdHKOUZuxNwrS6OSBOUhZMpSfhWh4hxFXhdMyGXXSzx9da40doLhToJ7c6fpn 1bkfgdLX7bnrXFSl2zELAJLbja1rQrnW8ix+kDYD0/huIglA5B9gX9boXDKF8vTfhEEB +QMzKF9mKLTj08iS91OchvU0x5k5I2dNTSVtD885Xw2MIc7sab48BuSs4KiLpQHr1Zub PD5t5ban3mS6TbzNYT8huM2jTXNO7n4CX+mG39wvgvCZPEuaPXtYcljuDXmxwp2ZMse5 z35w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:subject:cc:to:from; bh=G5RcpMbs5Qpi7XAuTIhInlGH2eGdEH42UsKUzadUQCU=; b=KgkkkfBjazYPD5H+LvmX6lPl/TkC6Y7TSt+xXuPPGeC4laiTlLY9a+I6VYL1ZJ/i20 HJuO6shoVRJ2XzKkOK4XHDx71oI55yAHZzUM3S85QruUNO2EAZ57Jh439GjJL+t9In+M Mh4grCGck16iPXKdLrMtEMjU4Kz4DoZ9u5IFTy2X7spBfwkNJgHkOE2NkXPXUv6Y0E6T 84DyMhmu/uEfqz0OBPNW9Vu5mmChG06IFyMWQjtU3MhGOslJQKByTkoGXBteF30tqp/j Opg9nLpD4sA5kmeu8x3Fincv9Up3n1A8TgPyxw6AZIiXVQh9SghdDnNNrn1K2oTJIoso LW9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 32si22526052plg.389.2019.04.16.06.49.46; Tue, 16 Apr 2019 06:50:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729488AbfDPNsc (ORCPT + 99 others); Tue, 16 Apr 2019 09:48:32 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:60654 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729623AbfDPNrX (ORCPT ); Tue, 16 Apr 2019 09:47:23 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3GDlDVa060537 for ; Tue, 16 Apr 2019 09:47:23 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2rwe3k5vjj-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 16 Apr 2019 09:47:17 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 16 Apr 2019 14:46:55 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 16 Apr 2019 14:46:43 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x3GDkgCs32833784 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Apr 2019 13:46:42 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5135C4C04E; Tue, 16 Apr 2019 13:46:42 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DDCD34C05A; Tue, 16 Apr 2019 13:46:40 +0000 (GMT) Received: from nimbus.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.33]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 16 Apr 2019 13:46:40 +0000 (GMT) From: Laurent Dufour To: akpm@linux-foundation.org, mhocko@kernel.org, peterz@infradead.org, kirill@shutemov.name, ak@linux.intel.com, dave@stgolabs.net, jack@suse.cz, Matthew Wilcox , aneesh.kumar@linux.ibm.com, benh@kernel.crashing.org, mpe@ellerman.id.au, paulus@samba.org, Thomas Gleixner , Ingo Molnar , hpa@zytor.com, Will Deacon , Sergey Senozhatsky , sergey.senozhatsky.work@gmail.com, Andrea Arcangeli , Alexei Starovoitov , kemi.wang@intel.com, Daniel Jordan , David Rientjes , Jerome Glisse , Ganesh Mahendran , Minchan Kim , Punit Agrawal , vinayak menon , Yang Shi , zhong jiang , Haiyan Song , Balbir Singh , sj38.park@gmail.com, Michel Lespinasse , Mike Rapoport Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, haren@linux.vnet.ibm.com, npiggin@gmail.com, paulmck@linux.vnet.ibm.com, Tim Chen , linuxppc-dev@lists.ozlabs.org, x86@kernel.org Subject: [PATCH v12 27/31] mm: add speculative page fault vmstats Date: Tue, 16 Apr 2019 15:45:18 +0200 X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190416134522.17540-1-ldufour@linux.ibm.com> References: <20190416134522.17540-1-ldufour@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19041613-0016-0000-0000-0000026F7280 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19041613-0017-0000-0000-000032CBBD97 Message-Id: <20190416134522.17540-28-ldufour@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-16_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904160093 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 | 3 +++ mm/vmstat.c | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index 47a3441cf4c4..137666e91074 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h @@ -109,6 +109,9 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, #ifdef CONFIG_SWAP 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 509851ad7c95..c65e8011d285 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4367,6 +4367,9 @@ vm_fault_t __handle_speculative_fault(struct mm_struct *mm, put_vma(vma); + if (ret != VM_FAULT_RETRY) + count_vm_event(SPECULATIVE_PGFAULT); + /* * The task may have entered a memcg OOM situation but * if the allocation error was handled gracefully (no diff --git a/mm/vmstat.c b/mm/vmstat.c index a7d493366a65..93f54b31e150 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1288,7 +1288,10 @@ const char * const vmstat_text[] = { "swap_ra", "swap_ra_hit", #endif -#endif /* CONFIG_VM_EVENTS_COUNTERS */ +#ifdef CONFIG_SPECULATIVE_PAGE_FAULT + "speculative_pgfault", +#endif +#endif /* CONFIG_VM_EVENT_COUNTERS */ }; #endif /* CONFIG_PROC_FS || CONFIG_SYSFS || CONFIG_NUMA */ -- 2.21.0