From patchwork Thu Feb 7 05:37:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Davidlohr Bueso X-Patchwork-Id: 10800379 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DCF2113B4 for ; Thu, 7 Feb 2019 05:38:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE8EA2ABFC for ; Thu, 7 Feb 2019 05:38:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C24342C557; Thu, 7 Feb 2019 05:38:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 786102ABFC for ; Thu, 7 Feb 2019 05:38:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726930AbfBGFik (ORCPT ); Thu, 7 Feb 2019 00:38:40 -0500 Received: from smtp.nue.novell.com ([195.135.221.5]:39334 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726128AbfBGFij (ORCPT ); Thu, 7 Feb 2019 00:38:39 -0500 Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Thu, 07 Feb 2019 06:38:37 +0100 Received: from localhost.localdomain (nwb-a10-snat.microfocus.com [10.120.13.201]) by emea4-mta.ukb.novell.com with ESMTP (TLS encrypted); Thu, 07 Feb 2019 05:38:05 +0000 From: Davidlohr Bueso To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, dave@stgolabs.net, linux-kernel@vger.kernel.org, Ralf Baechle , Paul Burton , James Hogan , linux-mips@vger.kernel.org, Davidlohr Bueso Subject: [PATCH 2/2] MIPS/c-r4k: do no use mmap_sem for gup_fast() Date: Wed, 6 Feb 2019 21:37:40 -0800 Message-Id: <20190207053740.26915-3-dave@stgolabs.net> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190207053740.26915-1-dave@stgolabs.net> References: <20190207053740.26915-1-dave@stgolabs.net> Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is well known that because the mm can internally call the regular gup_unlocked if the lockless approach fails and take the sem there, the caller must not hold the mmap_sem already. Fixes: e523f289fe4d (MIPS: c-r4k: Fix sigtramp SMP call to use kmap) Cc: Ralf Baechle Cc: Paul Burton Cc: James Hogan Cc: linux-mips@vger.kernel.org Signed-off-by: Davidlohr Bueso --- arch/mips/mm/c-r4k.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index cc4e17caeb26..38fe86928837 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c @@ -1034,11 +1034,9 @@ static void r4k_flush_cache_sigtramp(unsigned long addr) struct flush_cache_sigtramp_args args; int npages; - down_read(¤t->mm->mmap_sem); - npages = get_user_pages_fast(addr, 1, 0, &args.page); if (npages < 1) - goto out; + return; args.mm = current->mm; args.addr = addr; @@ -1046,8 +1044,6 @@ static void r4k_flush_cache_sigtramp(unsigned long addr) r4k_on_each_cpu(R4K_HIT, local_r4k_flush_cache_sigtramp, &args); put_page(args.page); -out: - up_read(¤t->mm->mmap_sem); } static void r4k_flush_icache_all(void)