Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp825944ybv; Thu, 20 Feb 2020 08:00:02 -0800 (PST) X-Google-Smtp-Source: APXvYqz7ppMrjVdRc+/nFY3HFLPMnMhO4ZgUOgjL7lJARCM5UOyHOT6Qs/Apk0/GEAtr+h5XaWYe X-Received: by 2002:a05:6808:251:: with SMTP id m17mr2516927oie.15.1582214402623; Thu, 20 Feb 2020 08:00:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582214402; cv=none; d=google.com; s=arc-20160816; b=RRenYoYElErCxagRfm5xeGHaW5atwYweHJPbNBdpsT+PVsOMw1xduVDbCKxcztCKJh kjnSskllhxlm6Ml4VtgWjE5Omvu8Us83yrVRhiRoFl1HdtN/GMo6uCm9VR9NOsZLOduQ 2eboci3PVFqbOFbKen890r6Lc0B927+wXADEgCONA6XI/lfN2U7c4SZ9El9nCi5A2n0i ETSKbFd0002U1UN+vc360c+eJjUKFfhyLjqnVeaA7dBoPbWbIkEF3yzR2Xx1CkhbHwYO R8P+0oT/KcUUug9XiVXJfjvBV32AgTVTJQ0jMWk3hz++36t37ePwgeg+NtDYu67+mdAA R8Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=clSHatG5ia5Xw2+IhpCP8KXnor3d1UGZTno0w+4svMM=; b=LjAjobP/0JKCLp5PeyAdVZ/hGZ1uQCpn58AUVwklc9jeyLiZcMX5JMbIbjKsha3gPY ih1WVTmBFNoPyslBqyS8Gx9jjDviUyIdBh3fkJ7itgBegHeu3uX6TJr4LBBqJTEUX5jv pfNrmvRt/zpGtRfDWYDdGMdqEeTD2sR226SQn4nK1+eR31cXUOgbOU0FSFr57gn30262 5jlDn+j5wT86CT3Oe4xmEcf14LmiIDv6bgP+ZGRsp7UDasbnuKfaXO2iW9m0P0B1GVWg TWNk4wV6hpo+aW+MX1IWRAncwtzEoDxF4qq8LENDg/MsziY2/OElFWe6+Q0q7FHBnjUn egkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LSDjMOnh; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h18si2063793otk.227.2020.02.20.07.59.50; Thu, 20 Feb 2020 08:00:02 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LSDjMOnh; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728745AbgBTP7e (ORCPT + 99 others); Thu, 20 Feb 2020 10:59:34 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:30295 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728733AbgBTP7d (ORCPT ); Thu, 20 Feb 2020 10:59:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582214372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=clSHatG5ia5Xw2+IhpCP8KXnor3d1UGZTno0w+4svMM=; b=LSDjMOnhNivKgKlNKUAYMHym//QPZRb+ja8KzSYsmx9ZJItrvTBw413+WZ81u3H+772xOW PmKx12CNO0nRpAWXedWmVh85yji9dMsG0k1GeAAJfGv60+G99U6KXPDgsggr5QUW3LQ3Rz reoCZFBXr/XXDVmzGRiMVPJ1ZEFsayA= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-262-Y2w0sKgxN7qOaG0SWtlsIA-1; Thu, 20 Feb 2020 10:59:30 -0500 X-MC-Unique: Y2w0sKgxN7qOaG0SWtlsIA-1 Received: by mail-qt1-f197.google.com with SMTP id d9so2881239qtq.13 for ; Thu, 20 Feb 2020 07:59:30 -0800 (PST) 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=clSHatG5ia5Xw2+IhpCP8KXnor3d1UGZTno0w+4svMM=; b=Pk0G3YVMqVep7B9k97NMxpxUdzBsmpeSbhGV37NF2O99vx09NfpvoOWx2yFIWco2IT N4er1+BhjODDoie+HqEy1zjvJhu9+/AcvSw+1WwIklF7Oi5WslXoybY1/xTUCSyWLixS WHicP4YCLbGBLp8QmgCE1X0esPND6NHx2/mfZdePAmQKOVdVEADS6FIG2bXYCXptAjKE 3FQkRoa/CH/87Sxl5FGYDgyfnVO6KIkiDS6MNA180Buc/vJR9ia96gDMnWKBZfc0QX8A 6BCpt15GJiwtfoU6OPsvvMzSZfb5limq7B+Q5XABwwgNNEk+XNOH+ezkIblFPFrcNP4M nvog== X-Gm-Message-State: APjAAAX8eRoOdveueQ9dEWE6SvD2QZ8+GR9f++VEGcO6/O5sSLj8Ev37 aQxGRp1h34BjXc/FFgjeLwoxe3aHAPTmHms9bx503cS2UItntd+3fg/qIKZKcDWzKDl68ptYmXo YA5TFRc9YaaoCxR12HpWkbcGp X-Received: by 2002:ac8:498f:: with SMTP id f15mr27215519qtq.123.1582214370319; Thu, 20 Feb 2020 07:59:30 -0800 (PST) X-Received: by 2002:ac8:498f:: with SMTP id f15mr27215485qtq.123.1582214370052; Thu, 20 Feb 2020 07:59:30 -0800 (PST) Received: from xz-x1.redhat.com ([104.156.64.75]) by smtp.gmail.com with ESMTPSA id f2sm1705818qkm.81.2020.02.20.07.59.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 07:59:29 -0800 (PST) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Peter Xu , Martin Cracauer , Mike Rapoport , Hugh Dickins , Jerome Glisse , "Kirill A . Shutemov" , Matthew Wilcox , Pavel Emelyanov , Brian Geffon , Maya Gokhale , Denis Plotnikov , Andrea Arcangeli , Johannes Weiner , "Dr . David Alan Gilbert" , Linus Torvalds , Mike Kravetz , Marty McFadden , David Hildenbrand , Bobby Powers , Mel Gorman Subject: [PATCH RESEND v6 06/16] arm64/mm: Use helper fault_signal_pending() Date: Thu, 20 Feb 2020 10:59:27 -0500 Message-Id: <20200220155927.9264-1-peterx@redhat.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200220155353.8676-1-peterx@redhat.com> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 85566d32958f..6f4b69d712b1 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -513,19 +513,14 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr, fault = __do_page_fault(mm, addr, mm_flags, vm_flags); major |= fault & VM_FAULT_MAJOR; - 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; + } + if (fault & VM_FAULT_RETRY) { /* * Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk of * starvation. -- 2.24.1