Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3138241imm; Thu, 17 May 2018 04:08:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpoNZM+4215/UNdBR3qYA5j4FuanX1aYBplc3ZL1j2c3SwsmgSo35AoyXeLy3JcAZ5Pg4Ov X-Received: by 2002:a17:902:7149:: with SMTP id u9-v6mr4754273plm.356.1526555334092; Thu, 17 May 2018 04:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526555334; cv=none; d=google.com; s=arc-20160816; b=VpZA+7ght9VCC1jd3ZbcXncnsYuFGwM4G51QYus1hO5ulsdHZnSYENMUAbzd0/9P8s wJUJYNdVoINMKJcWbHkzqUpRrSTSRoKshNIZV/3KiLzqrjevIknF/TzdxjnVJ1Ra/Xon Clu0h1OiBIpt4WiaH+sg+REoWynum3Ob7LECUxmeNGLtEcOZPzlNUYKq/oUmwiLZ87t2 qbPCSsvRpTMYGJBsngC6wnZXngfsQsGubh9JB15evc7TuMIJFGv9i4mKxoBWsbehiYZJ ekWHGnVbDGw5V/BnYfg+EfomxDAy1GzcyER+jFTYuZtw66bH4P+TUormt5Gk34NKOR9W 2Oyw== 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=h9LmB9pOtsRGWNCYLx+GpdbSpgLQo7+oQP3Xil94HAU=; b=WL9OGNVhB6F6wDnd2J4l+FacNmfN8Fbevk8s1jG4hsckUx42/pNrf7C5qBjMuakOFw 6C0lb7JjeyqT/DG4piNToTlXF7Q+fMviQuvSiZCl2j0iNjx3nS4oei9U0JpsIo4IoDLq kZ9r4SSykHvcQgb52wADhx7Lx2nL6GDtDknvOAtISxmu1pYPdsuoEvAY7w56jtHNG2KI s3jyeFFv1i3FjsrZtTEPCusuzFA8QIu5dCX0iU7X1HIa9f76mTUfhaCm+fbqXKIiEWZ6 AWbn0V70oGngf7VK7U8oGsu6fBR3YVsUmibcSuooQJxv5Ub7QpMsmwoVjtW9kJMbOPrZ Jn4w== 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 b66-v6si4744850plb.107.2018.05.17.04.08.39; Thu, 17 May 2018 04:08:54 -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 S1752408AbeEQLHt (ORCPT + 99 others); Thu, 17 May 2018 07:07:49 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:48896 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752329AbeEQLHr (ORCPT ); Thu, 17 May 2018 07:07:47 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4HB4ubk036821 for ; Thu, 17 May 2018 07:07:46 -0400 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0b-001b2d01.pphosted.com with ESMTP id 2j17a13tx7-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 17 May 2018 07:07:46 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 17 May 2018 12:07:44 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 17 May 2018 12:07:36 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4HB7Z6d7733550; Thu, 17 May 2018 11:07:35 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6FB734C04A; Thu, 17 May 2018 11:59:24 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 269BB4C050; Thu, 17 May 2018 11:59:23 +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:23 +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 26/26] arm64/mm: add speculative page fault Date: Thu, 17 May 2018 13:06:33 +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-0008-0000-0000-000004F77992 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18051711-0009-0000-0000-00001E8BEE07 Message-Id: <1526555193-7242-27-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 From: Mahendran Ganesh This patch enables the speculative page fault on the arm64 architecture. I completed spf porting in 4.9. From the test result, we can see app launching time improved by about 10% in average. For the apps which have more than 50 threads, 15% or even more improvement can be got. Signed-off-by: Ganesh Mahendran [handle_speculative_fault() is no more returning the vma pointer] Signed-off-by: Laurent Dufour --- arch/arm64/mm/fault.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 91c53a7d2575..fb9f840367f9 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -411,6 +411,16 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr, perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr); /* + * let's try a speculative page fault without grabbing the + * mmap_sem. + */ + fault = handle_speculative_fault(mm, addr, mm_flags); + if (fault != VM_FAULT_RETRY) { + perf_sw_event(PERF_COUNT_SW_SPF, 1, regs, addr); + goto done; + } + + /* * As per x86, we may deadlock here. However, since the kernel only * validly references user space from well defined areas of the code, * we can bug out early if this is from code which shouldn't. @@ -460,6 +470,8 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr, } up_read(&mm->mmap_sem); +done: + /* * Handle the "normal" (no error) case first. */ -- 2.7.4