From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10B3FC47E48 for ; Thu, 26 Sep 2019 09:40:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D4B3C222BE for ; Thu, 26 Sep 2019 09:40:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D4B3C222BE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8637C6B0010; Thu, 26 Sep 2019 05:40:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7EBCA6B0266; Thu, 26 Sep 2019 05:40:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6DB576B0269; Thu, 26 Sep 2019 05:40:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0126.hostedemail.com [216.40.44.126]) by kanga.kvack.org (Postfix) with ESMTP id 4FE506B0010 for ; Thu, 26 Sep 2019 05:40:10 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id E348C180AD803 for ; Thu, 26 Sep 2019 09:40:09 +0000 (UTC) X-FDA: 75976575738.23.crow24_75cceeac89c59 X-HE-Tag: crow24_75cceeac89c59 X-Filterd-Recvd-Size: 4643 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Thu, 26 Sep 2019 09:40:09 +0000 (UTC) Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A5AB64FCD9 for ; Thu, 26 Sep 2019 09:40:08 +0000 (UTC) Received: by mail-pf1-f200.google.com with SMTP id f2so1358436pfk.13 for ; Thu, 26 Sep 2019 02:40:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ppg1NSAShmiSu6checGzn4FvUz9QiJFKA275BDKmjpQ=; b=h69Lg+4zyOrbDS5ME+NRQFI9COGEquGOXL84jZgKvHBC9AquPrew8lWdkWrGB6HGW7 KddenHIE6Q9ME4FlMhdppXQFAHmwFpYC9qQ5jEcn3c3ZEPYKuavT+ygRZVwWAwrfLgpL k5lMa7i2a8ncsobWZxcVV1L3cwTUM0AF2utr6LqfFumXVMTbPtkVDdEPiqeNec54gf0P rOTwPKtw20ehD29SBnJ+84wmGOmyyYIQUbJ61NmnO+d0ItlLqz8LisWVHB428b6wT2v2 k2KmbwKtebPxGR6SZ0thBCnce5OGXImzFgHA/qu1NIebV+na3Rd3dTrsLcKppH02gHJS nigA== X-Gm-Message-State: APjAAAX2RyRhs0pCxN14FgY4+38SSLRwFlYs/wH1H3jDbb4R3YXtnmmq C9GWmLCHc7/Pav4mfuGhLExMoSN2eJizKnO5a9fnxq+t8HpKYkBDoo2CMMUyvQ0yDddkG6FFtVU wfTdifJ60bwk= X-Received: by 2002:a17:90a:8986:: with SMTP id v6mr2583671pjn.115.1569490807827; Thu, 26 Sep 2019 02:40:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQD3YCFxyODT7vLmOJs1BI9wxQJcPhmEkojKoQ0r5Yub0wIQeWe0SUpPIZubTSCqM/BHQXwg== X-Received: by 2002:a17:90a:8986:: with SMTP id v6mr2583641pjn.115.1569490807619; Thu, 26 Sep 2019 02:40:07 -0700 (PDT) Received: from xz-x1.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id p68sm3224982pfp.9.2019.09.26.02.39.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 02:40:06 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: David Hildenbrand , Hugh Dickins , Maya Gokhale , Jerome Glisse , Pavel Emelyanov , Johannes Weiner , peterx@redhat.com, Martin Cracauer , Matthew Wilcox , Shaohua Li , Marty McFadden , Andrea Arcangeli , Mike Kravetz , Denis Plotnikov , Mike Rapoport , Linus Torvalds , Mel Gorman , "Kirill A . Shutemov" , "Dr . David Alan Gilbert" Subject: [PATCH v5 06/16] arm64/mm: Use helper fault_signal_pending() Date: Thu, 26 Sep 2019 17:38:54 +0800 Message-Id: <20190926093904.5090-7-peterx@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190926093904.5090-1-peterx@redhat.com> References: <20190926093904.5090-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: Let the arm64 fault handling to use the new fault_signal_pending() helper, by moving the signal handling out of the retry logic. Signed-off-by: Peter Xu --- arch/arm64/mm/fault.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index cfd65b63f36f..4a695a44fb05 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -477,19 +477,14 @@ static int __kprobes do_page_fault(unsigned long ad= dr, unsigned int esr, fault =3D __do_page_fault(mm, addr, mm_flags, vm_flags); major |=3D fault & VM_FAULT_MAJOR; =20 - if (fault & VM_FAULT_RETRY) { - /* - * If we need to retry but a fatal signal is pending, - * handle the signal first. We do not need to release - * the mmap_sem because it would already be released - * in __lock_page_or_retry in mm/filemap.c. - */ - if (fatal_signal_pending(current)) { - if (!user_mode(regs)) - goto no_context; - return 0; - } + /* Quick path to respond to signals */ + if (fault_signal_pending(fault, regs)) { + if (!user_mode(regs)) + goto no_context; + return 0; + } =20 + if (fault & VM_FAULT_RETRY) { /* * Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk of * starvation. --=20 2.21.0