Received: by 10.223.164.221 with SMTP id h29csp648441wrb; Wed, 11 Oct 2017 06:55:02 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBjSzGcBC2Ql+Q/QfWY1xuSCnbIThpOI/7CqIEI31cQtvxzeBo+lKygyqW7BsiLC7dfRrN6 X-Received: by 10.98.31.215 with SMTP id l84mr17214228pfj.36.1507730102455; Wed, 11 Oct 2017 06:55:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507730102; cv=none; d=google.com; s=arc-20160816; b=xuycO7xyHPN4Z82wmNZw565q39L9B65m3KJHiCR+hdIO6SdIMc+FdUKPGZTArX9Xgm d5re7yFdik2I6MlAaUzN+6ncEH3RR4mzLmOFomxnDQE3qN2ZNkHkE9mmxhk6oy8Bh3oq DkoifodJRTWB4oDgrPd+9V5380/edXWO2X0+InzlaAFmH+l3WjjjffNJ4SPmDz+88RIP Vnr5o7og4cYqLqf/RKvWgRkczdP37/008O+gV6C9hXpxCnIYRcdfmTZEfbfg7dZ7qRY+ 1HYAhZvC9wnXVSYEYhL8gMmJP8ZGaug1t8GMcVD21TYBLactfMyg00NGx4QUlCVOp5MS QEVg== 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=SuvzUB3afbrvIbe0N0eXLt10qrcg/ZXmG8GwOFLCJ08=; b=UH49Lvg+KAVAjuWCul1vhmO1wfEw4aIEAKXcwgjxsnoQp3j4ztiioOcCoZO7nTT7Bn rKLg8m0wlgL9SgRxaQ+RYwZlp27VeLnVjwigfMPBzj24eW7U/L8KYCnuF16zJscqLBiV RHqYReoYQkmQUFODA7fnp3jUXhDE2x7IWOBCKOPO2OPrIvXvF0ks32sI+jKp0Njd5co5 txKHJ2s0gWQ5j2z2lmNvVgqCglpC702ZDPJU5D6jFGFP+LEFa+F5qbyyTKZ4MSlQgafQ 18kYYYS6e98yywxFpYS1eymKystauCQv0SU0HE/w0qLc3DFbi54+ptOJoHpkRa9HsOOs Hm7g== 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 r7si9406043plj.72.2017.10.11.06.54.48; Wed, 11 Oct 2017 06:55: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 S1757633AbdJKNyK (ORCPT + 99 others); Wed, 11 Oct 2017 09:54:10 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:36764 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757620AbdJKNyG (ORCPT ); Wed, 11 Oct 2017 09:54:06 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9BDqYIt031967 for ; Wed, 11 Oct 2017 09:54:06 -0400 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 2dhjx5q1eu-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 11 Oct 2017 09:54:05 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 11 Oct 2017 14:54:02 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 11 Oct 2017 14:53:55 +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 v9BDrsqx7602346; Wed, 11 Oct 2017 13:53:54 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 30CA64C04E; Wed, 11 Oct 2017 14:49:51 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7B5734C040; Wed, 11 Oct 2017 14:49:49 +0100 (BST) Received: from nimbus.lab.toulouse-stg.fr.ibm.com (unknown [9.145.30.240]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 11 Oct 2017 14:49:49 +0100 (BST) From: Laurent Dufour To: paulmck@linux.vnet.ibm.com, peterz@infradead.org, akpm@linux-foundation.org, kirill@shutemov.name, ak@linux.intel.com, mhocko@kernel.org, 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 Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, haren@linux.vnet.ibm.com, khandual@linux.vnet.ibm.com, npiggin@gmail.com, bsingharora@gmail.com, Tim Chen , linuxppc-dev@lists.ozlabs.org, x86@kernel.org Subject: [PATCH v5 22/22] powerpc/mm: Add speculative page fault Date: Wed, 11 Oct 2017 15:52:46 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507729966-10660-1-git-send-email-ldufour@linux.vnet.ibm.com> References: <1507729966-10660-1-git-send-email-ldufour@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17101113-0008-0000-0000-0000049EC820 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17101113-0009-0000-0000-00001E30D580 Message-Id: <1507729966-10660-23-git-send-email-ldufour@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-11_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710110191 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch enable the speculative page fault on the PowerPC architecture. This will try a speculative page fault without holding the mmap_sem, if it returns with VM_FAULT_RETRY, the mmap_sem is acquired and the traditional page fault processing is done. Build on if CONFIG_SPF is defined (currently for BOOK3S_64 && SMP). Signed-off-by: Laurent Dufour --- arch/powerpc/mm/fault.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 4797d08581ce..c018c2554cc8 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -442,6 +442,20 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address, if (is_exec) flags |= FAULT_FLAG_INSTRUCTION; +#ifdef CONFIG_SPF + if (is_user) { + /* let's try a speculative page fault without grabbing the + * mmap_sem. + */ + fault = handle_speculative_fault(mm, address, flags); + if (!(fault & VM_FAULT_RETRY)) { + perf_sw_event(PERF_COUNT_SW_SPF, 1, + regs, address); + goto done; + } + } +#endif /* CONFIG_SPF */ + /* When running in the kernel we expect faults to occur only to * addresses in user space. All other faults represent errors in the * kernel and should generate an OOPS. Unfortunately, in the case of an @@ -526,6 +540,9 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address, up_read(¤t->mm->mmap_sem); +#ifdef CONFIG_SPF +done: +#endif if (unlikely(fault & VM_FAULT_ERROR)) return mm_fault_error(regs, address, fault); -- 2.7.4 From 1583042275336074344@xxx Fri Nov 03 10:59:19 +0000 2017 X-GM-THRID: 1583042275336074344 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread