From patchwork Thu May 17 11:06:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Dufour X-Patchwork-Id: 10406427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8CB4D60247 for ; Thu, 17 May 2018 11:08:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AE87287E2 for ; Thu, 17 May 2018 11:08:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F09A28877; Thu, 17 May 2018 11:08:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C97C4287E2 for ; Thu, 17 May 2018 11:08:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DD1F66B04C5; Thu, 17 May 2018 07:07:43 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D071B6B04C7; Thu, 17 May 2018 07:07:43 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B80906B04C6; Thu, 17 May 2018 07:07:43 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr0-f199.google.com (mail-wr0-f199.google.com [209.85.128.199]) by kanga.kvack.org (Postfix) with ESMTP id 525016B04C4 for ; Thu, 17 May 2018 07:07:43 -0400 (EDT) Received: by mail-wr0-f199.google.com with SMTP id r23-v6so2862579wrc.2 for ; Thu, 17 May 2018 04:07:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:in-reply-to:references:message-id; bh=RgTyjuwJTFIHjkToI0VJSnKN4LuykLVjJ1AVocPlXIM=; b=HiH+rgcvQJuO1/lwOQqoxpR6a32Aa8BSaIvM4MbIn5h3Ngeaf2wedyZVYc8Op1jX0d VQBo+va2NJfnmxl+sDClw5N5JB6ZuM0aWRfnebz2a4IlFp0kPqyIcJGIS8D/8xZWRryV nEG/FK6sLBQNEll7Go6YWqOIbIgndKxxOC0GXwOVSmmZA3EL1yETK5R2egFEqN2yL8OY q1ihw22YfV1VJ4oPtCcyR4C/VYlL36OCX9yEAyiCIUG8soEt978sAInek9J/ADuRWFBK jvyhof9WvPMaXBuqd2/OEin3C6+5494E6rXTNa7WwlBG6kuwKSpY98h6yMhrZxx9tL7m tmlw== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of ldufour@linux.vnet.ibm.com) smtp.mailfrom=ldufour@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: ALKqPwdkEQ9iwoijDJvRgC0pEzxboPJA8IeJ3TrXCc+WDMkjrH6GoJUu Y1JRKHMPLTDM95i7waq20k3+tNviljDXf9RKzB42Zv9PGR7RGne2IqqOYsM2EGp6cHBCUgLA4yt RIPC90AORrWZ3NePApnLY/B5eLriyFAncUZLwE64jT0GcFqQohJVbYkH7MnthLe0= X-Received: by 2002:a50:adcc:: with SMTP id b12-v6mr6532024edd.168.1526555262920; Thu, 17 May 2018 04:07:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoX+qJg/Fbuc5rf9AvXHveitkIJAMeCPRHhJVEp3A0UXX+mtAnWv/PULFJheW41/7rrr6W+ X-Received: by 2002:a50:adcc:: with SMTP id b12-v6mr6531969edd.168.1526555262094; Thu, 17 May 2018 04:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526555262; cv=none; d=google.com; s=arc-20160816; b=Kl8b1+83aabU8Wiz+Ru2DwfueS7AhAQ9XCcJ433LGWf0mVdlgdZHb4XVrKXi4ED4q8 s20RscmrjZdObfkdi+wgYsXv+AzulHV4n+D83QRIMtvEWW0mtpbl2unKi4zAhO9IzFG5 fbXa/J3LXc/vlK7dKVcHQJRZhcF8FmTz7De2DCP8h02uaAXkdfPd5paoxUSXWl3wWJN4 +HzdKwR1Czp1qy3u4pvf2XTCuS8mVNwfwHWDdUZlAVgTU2TmMfWLgZI3mE1n1OI5AhfY oGHfG+vVV3J+9h6bqut0kuarLXh9tUDKaCX/jYEGcHzervHM1Ew3kAmIRC5FAc7HBzIT iz4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:references:in-reply-to:date:subject:cc:to:from :arc-authentication-results; bh=RgTyjuwJTFIHjkToI0VJSnKN4LuykLVjJ1AVocPlXIM=; b=XGCw+KTHQF0ERZkGzMuGe5soGKgM7ojqWGcxJPiHHmU8Ksh8syeMrxac8O2lf3pQ4E ILkqUOeqYeyvGi1AQvd8rEbpWG7wGHJpaTndYzOKd5QxDe4EeVhNEwb0iXNSxJwRnD1y pVHVGOV68SuhD3F+tdL0s8dIoYEKaw5a1ZrlZlUfU0Qtn2SsG/s/LHvNPT7LPPIsNR7J FU9dwnpcnDtqrKO44D8flIDn6XeyYBzmpKvq3irs/gLK0atC5QIoezDZ/VrDjmJFC63A hEByS2G/szTMuYOnrpmAAf89NfNBanffBzta0LY+liI33N17peadIYpkfuYGBjYLZ1Nj tgUg== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of ldufour@linux.vnet.ibm.com) smtp.mailfrom=ldufour@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id h9-v6si5105614edk.225.2018.05.17.04.07.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 04:07:42 -0700 (PDT) Received-SPF: neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of ldufour@linux.vnet.ibm.com) client-ip=148.163.158.5; Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of ldufour@linux.vnet.ibm.com) smtp.mailfrom=ldufour@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4HB4aKK057666 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 2j17yf1taf-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 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: X-Virus-Scanned: ClamAV using ClamSMTP 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 */