Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp829485ybv; Thu, 20 Feb 2020 08:02:59 -0800 (PST) X-Google-Smtp-Source: APXvYqw8HG39O+3GFYGe6VVcpp1wRUqBFpTMNMMHZ+g+n1X2uLOVcwLWrKA2gdI14hH1kgMeySvT X-Received: by 2002:a05:6830:18d4:: with SMTP id v20mr24542419ote.29.1582214579341; Thu, 20 Feb 2020 08:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582214579; cv=none; d=google.com; s=arc-20160816; b=n4eHLkvTMbCwuYDiGmtubIeS+vzMvr/idgJw+WxDBoI92KMttQMsXIQCUTAXI4wQqt QKXhdbIJkyW9CL6ik+OSAxbtJ8Ht6ZQHvLIfnzD64FoTKwy3+w3MnV2Ses1qLx8EPNNV uQ7BE8cedZJeNLmapOKIFniZERnh4mXej8qAo+SZAz8avA5OvygJnenWx6xFJLIVSLy5 ZJ8MrnoBHjFHwX+qu5SgeQ5C7AfRyUTgKSUNlvqoNnu88S02iTe9NdDQrCb3Ee7STb4v MN8dRlbcBBemp14BQ8d4uHX+XDs3oeV6MpOtMxJKy4CWqDxabvgGzTSzhNW5cHHrVVCf hjjQ== 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=hbwtB78+GrmjAgtuBkp/5M+dteqsFUb6HTGdpyT5C/M=; b=zuX657haF4zUQH6k7isyBx6mNUL61vrrVVRXtukMPIGaWN8ZsxruWzbhOqhB9p+p6t T21VYXB03uGeaoKpt7P6D7vc8wpD60E8fzVdvwTe5eueRI94JdCWRI2eOuSpbvv1Z1Fy UYf3k9uDhzsmuxc3kHlcMZgOgUphHUpXu9uu/ZfjPtyMd0M2yZDOAKdA6heqn652916o IeH8hRU9FBK72yRmnj7sLplOkpqtxHVNHes1o8rsPHEjueLLEuuGd0q0I9SM73grnCIi TCYZzjib38XyEKYhZShhgM4+W7hfQ5sT6uHqlOb5kt+2AYTsBqLrQ4oLCByFIEZ26lkq tw8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=E25NuS5e; 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 e9si9738519oib.207.2020.02.20.08.02.36; Thu, 20 Feb 2020 08:02:59 -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=E25NuS5e; 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 S1728585AbgBTQC3 (ORCPT + 99 others); Thu, 20 Feb 2020 11:02:29 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:51920 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728414AbgBTQC3 (ORCPT ); Thu, 20 Feb 2020 11:02:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582214548; 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=hbwtB78+GrmjAgtuBkp/5M+dteqsFUb6HTGdpyT5C/M=; b=E25NuS5ebfIMLKILPg6vRYWy6yd8/J+PZUWQakBlV6zC0b0ojXeCGUV0plcEH/AV8X6u/a teJ1SbF6Ew9yV22tvOMC/pG42DcpSOkhRVGnye7kYsZJtERDVnATdfjpe+Un154aNB0Ikz R85VuPIqkk4dzAD3OgQLq0UeeGdYbXE= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-278-zVQUZuQdPJyasWjmKePQWw-1; Thu, 20 Feb 2020 11:02:25 -0500 X-MC-Unique: zVQUZuQdPJyasWjmKePQWw-1 Received: by mail-qk1-f197.google.com with SMTP id v81so3039198qkb.11 for ; Thu, 20 Feb 2020 08:02:25 -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=hbwtB78+GrmjAgtuBkp/5M+dteqsFUb6HTGdpyT5C/M=; b=FMjjdJDNPqjIgwB5KBa5kXPRFzXOMBI4KW2m56jmoy2IrLS6uvwzmyE4I2YnYp2WoD Pf3c+v3HoSdEB2W5Rocqmk3K/UNEfgYs1Fq8Jy+xLkbTA8mt+CYhIfQt8VG2+RInsXYa o3TIfGS4Omk+vp9UJu+nJAWxjsPpkkmSkS0RMrUJv/YZfStNWBPCs+DSlcnXqLjU8xJi 8iQppt3sWP/qq4wBc/Go++aD5xaUvwT+z7dn4/zXyiy52KCA6OEXQktS6fLmoz3XUsQ8 uwdShi/H11JHyi4ZgkDGzC80LP78vhNADNtAH6px1HdhPPKCfq5RaIknynohOlcNbrIO jlEQ== X-Gm-Message-State: APjAAAW5hNXmzw+EE3qE2O/KIUhcIandET289MBb/aK1GSljjQ/g/CDE AjZ6G7vWX8d1J2ONgGaoYx7IWiTZLeQb5pRI/Ij2+N3nn62ZcnGYVkS7X0iX9hBrckM9qerWLyu mtS+gE6IwZ/EGl/Kpa9fIrUbn X-Received: by 2002:a05:620a:1656:: with SMTP id c22mr29866249qko.144.1582214545474; Thu, 20 Feb 2020 08:02:25 -0800 (PST) X-Received: by 2002:a05:620a:1656:: with SMTP id c22mr29866224qko.144.1582214545238; Thu, 20 Feb 2020 08:02:25 -0800 (PST) Received: from xz-x1.redhat.com ([104.156.64.75]) by smtp.gmail.com with ESMTPSA id d206sm1816478qke.66.2020.02.20.08.02.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 08:02:24 -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 07/16] powerpc/mm: Use helper fault_signal_pending() Date: Thu, 20 Feb 2020 11:02:22 -0500 Message-Id: <20200220160222.9422-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 powerpc code to use the new helper, by moving the signal handling earlier before the retry logic. Signed-off-by: Peter Xu --- arch/powerpc/mm/fault.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 8db0507619e2..0868172ce4e3 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -582,6 +582,9 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address, major |= fault & VM_FAULT_MAJOR; + if (fault_signal_pending(fault, regs)) + return user_mode(regs) ? 0 : SIGBUS; + /* * Handle the retry right now, the mmap_sem has been released in that * case. @@ -595,15 +598,8 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address, */ flags &= ~FAULT_FLAG_ALLOW_RETRY; flags |= FAULT_FLAG_TRIED; - if (!fatal_signal_pending(current)) - goto retry; + goto retry; } - - /* - * User mode? Just return to handle the fatal exception otherwise - * return to bad_page_fault - */ - return is_user ? 0 : SIGBUS; } up_read(¤t->mm->mmap_sem); -- 2.24.1