Received: by 2002:ac0:8bc7:0:0:0:0:0 with SMTP id o7csp87191ima; Wed, 6 Feb 2019 21:40:31 -0800 (PST) X-Google-Smtp-Source: AHgI3IaDtY11esGEFk6ujnnJOQ31/sDIs1ysTyY6vdDfpujcSEixzUZlpP5JUMwIPXk7rIfjARwD X-Received: by 2002:a62:8d4f:: with SMTP id z76mr14828859pfd.2.1549518031562; Wed, 06 Feb 2019 21:40:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549518031; cv=none; d=google.com; s=arc-20160816; b=APP2zGiWs2KhUtBMUENwmwSQiILm4wvJVjjj9Ff+KreJoAgIy/RhZrO0cZe9NHa3P7 i5rQjULIbkN1DC/FrbTS1lGMXHWMOU4rbKRnN/fdCOmqUy5IIfKI5ik2b3WUagPGM+SI J2NBV/S6K8TlzA8SDaT3bAljm9fHmckhtLU+XlpV+ZmtZTFmBX3ycBBh56GX0CGyVtid bvAvszlGDNrA/GdDQB8BdG2d2Q4Ilm893pWYViKoO7YzWTAWZYOr51xCHFUx1Sd29OGE kF2zCBT+LnApJJOi9rkxxyyLLzXyq4BAZd7RDht/Xxq+hDNmSsvDp5ikKNmxSRhF04jE LP6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=XjTZPZGlz/MNyU6aOr7ZZyAeRmtbqpb7D/yFa34GyFM=; b=lu62HoqvgEDFszCss88zl0M4QcJWD44jpePbVZEmiJr6kwZC/HyLp4703MtZXrTbj/ LjNOdJ7C4vtPQoVtkcX7hdgiivhd0Ka2OE8DWjPKsZPQoBvyyclKXzEP5kQgVcZysRQP r6fs5uBHmT/jORB8xAyM8pRocoqA8Jf5iWDAgyP4Vq9GQ+OaE74P6pwokXaTRY2jwqVo ik2Ie4Rwc+dgWaqkPdwDKzZMBry5Dd4oeDWwsV9RKK9tBNCb/0GGwsQHPsbkle2OrXNI fz/S/F/sXjyp3c3PlJraDHc+kJTrV/vW0Da3VBHn63p6RVUH8ylNRmRLg+Of4ugblWHX C2sg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si6208892pga.349.2019.02.06.21.40.16; Wed, 06 Feb 2019 21:40:31 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726952AbfBGFik (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- 2.16.4