Message ID | 20240402075142.196265-7-wangkefeng.wang@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1BCEACD1284 for <linux-arm-kernel@archiver.kernel.org>; Tue, 2 Apr 2024 07:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=L2EdB+Gg0uUXbmGJPAjShRALayEjvjGFY/EcDccQyEw=; b=bJnxVIwntqz2x7 7IsHP7xq/OXF32DsRvZL+3vaqOBUPIL8L/N9zjKxWGa1WaH5gDjGci75Lo/gx2CzUp84aDZ62k55I To0cV2p3cHYpKcpD2qHwlslAONgl5FRFuVy3aqnepaEUfvklklELEi0jsoqqRarhzOLvGv9Fdzl98 LUrKcdtIO5GPg4MvCvyi5r9V8RG3CMFrhH3UkPaWNofN6r/O6euVl5Wybyv85kt4p5k/N36ej5eGq khAJv966r1gH2LVdDMd2CWh5z0hvj9ZG0UrtIaD6UOiJj9GEWNd/RbSXxVHfwliNp7ccrIRrQeV7Q MadfUPlvyfL3d8acXSew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrZ0U-0000000A9X4-2Hkd; Tue, 02 Apr 2024 07:56:34 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrZ0G-0000000A9V3-1z7j; Tue, 02 Apr 2024 07:56:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=3lgbc0V97n4dqVCETRztl1tx7Hvne1+ku9oZwtLMRKM=; b=a+TOAUyYYZ3N8IH+u6X5aedBdf aGKNciA2dYLw39tnm2Z0PLqDMMSKhZ0SIktmey+M4c0f0Gl/n+zsGrYZg2MRoHv6a9/g/kOlE+KAr QeD12vci9C+eesEnLz4vyq7TtQSK83esE+iEXjgx1OA3MwLanwrv1Y1YG/vq7DyRLN1a67uJRO+91 FpGlBjM48ivO9EXkEp8SRedn6U7YcapGH/EQXufims2bYa2R0UivEdT2dbBP2wnUmS92ziFmZW3wN jNvFcubuNMzuCP8sQTILpKl1Y1J4NiyYhQ5JlnrbCIiWse3kvXcm2AeCLx2Yh3TRF2tMOStKboVwU SjWRE62A==; Received: from szxga02-in.huawei.com ([45.249.212.188]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrYyM-00000003V4G-3Hap; Tue, 02 Apr 2024 07:56:16 +0000 Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4V80Tk2SWLzbds4; Tue, 2 Apr 2024 15:52:26 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id CD95B18007B; Tue, 2 Apr 2024 15:53:20 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 2 Apr 2024 15:53:19 +0800 From: Kefeng Wang <wangkefeng.wang@huawei.com> To: <akpm@linux-foundation.org> CC: Russell King <linux@armlinux.org.uk>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, Christophe Leroy <christophe.leroy@csgroup.eu>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Alexander Gordeev <agordeev@linux.ibm.com>, Gerald Schaefer <gerald.schaefer@linux.ibm.com>, Dave Hansen <dave.hansen@linux.intel.com>, Andy Lutomirski <luto@kernel.org>, Peter Zijlstra <peterz@infradead.org>, <x86@kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linuxppc-dev@lists.ozlabs.org>, <linux-riscv@lists.infradead.org>, <linux-s390@vger.kernel.org>, <surenb@google.com>, Kefeng Wang <wangkefeng.wang@huawei.com> Subject: [PATCH 6/7] s390: mm: accelerate pagefault when badaccess Date: Tue, 2 Apr 2024 15:51:41 +0800 Message-ID: <20240402075142.196265-7-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240402075142.196265-1-wangkefeng.wang@huawei.com> References: <20240402075142.196265-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm100001.china.huawei.com (7.185.36.93) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240402_085444_449118_68988DDB X-CRM114-Status: GOOD ( 10.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
arch/mm/fault: accelerate pagefault when badaccess
|
expand
|
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index c421dd44ffbe..162ca2576fd4 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -325,7 +325,8 @@ static void do_exception(struct pt_regs *regs, int access) goto lock_mmap; if (!(vma->vm_flags & access)) { vma_end_read(vma); - goto lock_mmap; + count_vm_vma_lock_event(VMA_LOCK_SUCCESS); + return handle_fault_error_nolock(regs, SEGV_ACCERR); } fault = handle_mm_fault(vma, address, flags | FAULT_FLAG_VMA_LOCK, regs); if (!(fault & (VM_FAULT_RETRY | VM_FAULT_COMPLETED)))
The vm_flags of vma already checked under per-VMA lock, if it is a bad access, directly handle error and return, there is no need to lock_mm_and_find_vma() and check vm_flags again. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> --- arch/s390/mm/fault.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)