From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754791AbdBNQp1 (ORCPT ); Tue, 14 Feb 2017 11:45:27 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:34243 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753720AbdBNQpU (ORCPT ); Tue, 14 Feb 2017 11:45:20 -0500 From: Laurent Dufour To: mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, npiggin@gmail.com Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/3] powerpc/mm: page fault handler cleaning Date: Tue, 14 Feb 2017 17:45:09 +0100 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17021416-0020-0000-0000-00000307474E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17021416-0021-0000-0000-000040635EE6 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-14_09:,, 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-1612050000 definitions=main-1702140162 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series attempts to clean the page fault handler in the way it has been done previously for the x86 architecture [1]. The goal is to manage the mmap_sem earlier and only in do_page_fault(). This done by handling the retry case earlier, before handling the error case. This way the semaphore can be released earlier and the error path processed without holding it. The first patch is just moving a unlock to the caller of the service, which as no functional impact. The second patch is handling the retry case earlier in do_page_fault(). This is where most the change are done, but I was conservative here, not changing the use of mm_fault_error() in the case of the second retry. It may be smarter to handle that case separately but this may create duplicate code. The last patch is moving up semaphore releasing from mm_fault_error() to do_page_fault(). [1] see commits from Linus Torvalds 26178ec11ef3 ("x86: mm: consolidate VM_FAULT_RETRY handling") 7fb08eca4527 ("x86: mm: move mmap_sem unlock from mm_fault_error() to caller") Laurent Dufour (3): powerpc/mm: move mmap_sem unlock up from do_sigbus powerpc/mm: handle VM_FAULT_RETRY earlier powerpc/mm: move mmap_sem unlocking in do_page_fault() arch/powerpc/mm/fault.c | 82 ++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 42 deletions(-) -- 2.7.4