Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3139469imm; Thu, 17 May 2018 04:09:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqVybO3Sk4sKRlLPSFy/NBYAxicLBI/vkE/NjZpUd4iHMSijscnqsvv0xEpibq55Bw9nUQQ X-Received: by 2002:a63:18c:: with SMTP id 134-v6mr3731763pgb.138.1526555393028; Thu, 17 May 2018 04:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526555393; cv=none; d=google.com; s=arc-20160816; b=lhL/UXZqc98GN8ASWP67OraHdyGx8ekQlYtZ5u25Q/dU8FF3WVpLwZWwkLKFTOKycF sJMX6A82uct9qnbsZC5+i8BKOXDVIirwokomYkFKzeNp2m2miJX77Yd64Yy5+YoY+AFH IfJruSsqhHveOfFbfsAh6ohwIg5Zcw3tCrexMUhCKLLmEBYY/2VfYoKAVeFGEHXRWLzN w2kooxMTafwG6ksuF4OwSvh1/EKv3la/pirZOqfelDWmKqYcFNW9RQWXWme063PmzJgB bRsFEiFnsw+G+zB/QKs/wXlhHt+kLwCwi88NEAnc0cvSitP1p5U4fmqg2xsWLJzxmmbV yzmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=RgTyjuwJTFIHjkToI0VJSnKN4LuykLVjJ1AVocPlXIM=; b=Cf+PpDRMNtSITZoF/k87mWedlgYz1v7n5sA5MqaEonvNsBDQpSG6PyA7vlTT8RaV9q xxbRIysp2GWA1DA1hccxCPXrcs9g4roCOHUi7FCpDY/rd8pFYSIDi10rLT5YHBi8QZIl r9N9IXTN/KhyejOdtdBXljxtmnHbGQbqTmvYUDkMiFQuzlckjkD1e7eRRa56HS1f74Ek 6SWmHpjSTKemz1Qvj2A/0uFITWJN12xSnsCZOjCO6MKcap1mMC5ug4c/55Lnc2S4wNaW taVBQRZunw+/Lo4HKG3KqamvW93xxkdQgbrUZ8h5nSCYrZ0/qdM80cWaMU4ndRaf3yMS lVyg== 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 w21-v6si3918663pgm.433.2018.05.17.04.09.38; Thu, 17 May 2018 04:09:52 -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 S1752509AbeEQLIv (ORCPT + 99 others); Thu, 17 May 2018 07:08:51 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49848 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752366AbeEQLHl (ORCPT ); Thu, 17 May 2018 07:07:41 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4HB4Cju054160 for ; Thu, 17 May 2018 07:07:40 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j17kxax3t-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 17 May 2018 07:07:40 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 17 May 2018 12:07:38 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 17 May 2018 12:07:29 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4HB7Sop17498454; Thu, 17 May 2018 11:07:28 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 79C424C04A; Thu, 17 May 2018 11:59:17 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 423864C044; Thu, 17 May 2018 11:59:16 +0100 (BST) Received: from nimbus.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.33]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 17 May 2018 11:59:16 +0100 (BST) 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 , khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.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 Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, haren@linux.vnet.ibm.com, npiggin@gmail.com, bsingharora@gmail.com, paulmck@linux.vnet.ibm.com, Tim Chen , linuxppc-dev@lists.ozlabs.org, x86@kernel.org Subject: [PATCH v11 23/26] mm: add speculative page fault vmstats Date: Thu, 17 May 2018 13:06:30 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526555193-7242-1-git-send-email-ldufour@linux.vnet.ibm.com> References: <1526555193-7242-1-git-send-email-ldufour@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18051711-0020-0000-0000-0000041E356F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18051711-0021-0000-0000-000042B35785 Message-Id: <1526555193-7242-24-git-send-email-ldufour@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-17_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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805170100 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 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 30433bde32f2..48e1cf0a54ef 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4509,6 +4509,9 @@ int __handle_speculative_fault(struct mm_struct *mm, unsigned long address, 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 a2b9518980ce..3af74498a969 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", +#endif +#endif /* CONFIG_VM_EVENT_COUNTERS */ }; #endif /* CONFIG_PROC_FS || CONFIG_SYSFS || CONFIG_NUMA */ -- 2.7.4