Received: by 10.223.176.5 with SMTP id f5csp1989228wra; Sun, 4 Feb 2018 17:33:36 -0800 (PST) X-Google-Smtp-Source: AH8x224bt9XZy7hcdBqXYljCuzwEqJbWdtVg0T9NArZSPmHsODXx7Vx8g3V73AHeRXAeIs+brn9R X-Received: by 10.99.36.65 with SMTP id k62mr5982032pgk.345.1517794416790; Sun, 04 Feb 2018 17:33:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517794416; cv=none; d=google.com; s=arc-20160816; b=LRErS+ZXCY1iCm1nSG9wD0vMfG7TBWhb9jFegmbC9106G2ASf67ohRMSjozkG9qhpq lZIh1u2Oq8q9xNKZTSJk/jDnsxJ21eHf7LL4KbRNFaEhwDe5QKdb0sjUUij/ho3tyijv FlAiMMLIEYigRu2b6yhKx4NB+xOqu1DJaxyTE1ot6u3CfCMPNJt9Q9VqGPdEDdqMz4LD YZ/3WoO0D0hJV6yOwfYB0/3Q/UX6MJGXjGJqX2xdS412USCyEqzlAN1Ubtc71PF28lMD 0YlP+93S6ARcDXkshISiz4/wUMWbC+yURemupJCn5Hw+rjxuEJxa0YkuvpYNnqpWv03j M93Q== 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:arc-authentication-results; bh=JjQ1+cyEQ5RmQAQQ1CKo8pSibpPozmd+5PolHluIVtI=; b=0weKVmvfJztpDSlL+Y42W3SHgGLH/+p5ts3RXwEoM0O6OgbxeFixhC6EC3ZgXA1B/v CfnoJzJFpUP2lD9+Wvx5g5UhLlJcI5RrQU11fyyYAbBHK9oqPEWNazAIl0ACV2RuRa9r etSi7J1pxxH4HTm8XIDGU5z07GAWwtjlXf7ENZ2mjkVni9LwaztgxiEKFiEilY600MDC sVRwmwAdTaTMfDNf6xwPa7MxUVFDKHXvdrG9EVOyd+FLg7yEQnPqFpxd1MY7xeOfVu7n w55adVx9I04iw2vYvsKIvZmzFeA7iOqLr7aUSI53NQX/dmR6+wbEOnfM/t+CKKK5QbtS OaFg== 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 o6-v6si3497955plk.288.2018.02.04.17.33.22; Sun, 04 Feb 2018 17:33:36 -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 S1752808AbeBEBcl (ORCPT + 99 others); Sun, 4 Feb 2018 20:32:41 -0500 Received: from mx2.suse.de ([195.135.220.15]:44098 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752796AbeBEB3Z (ORCPT ); Sun, 4 Feb 2018 20:29:25 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C674EAE24; Mon, 5 Feb 2018 01:28:01 +0000 (UTC) From: Davidlohr Bueso To: akpm@linux-foundation.org, mingo@kernel.org Cc: peterz@infradead.org, ldufour@linux.vnet.ibm.com, jack@suse.cz, mhocko@kernel.org, kirill.shutemov@linux.intel.com, mawilcox@microsoft.com, mgorman@techsingularity.net, dave@stgolabs.net, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: [PATCH 50/64] arch/unicore32: use mm locking wrappers Date: Mon, 5 Feb 2018 02:27:40 +0100 Message-Id: <20180205012754.23615-51-dbueso@wotan.suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180205012754.23615-1-dbueso@wotan.suse.de> References: <20180205012754.23615-1-dbueso@wotan.suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Davidlohr Bueso This becomes quite straightforward with the mmrange in place. Signed-off-by: Davidlohr Bueso --- arch/unicore32/mm/fault.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/unicore32/mm/fault.c b/arch/unicore32/mm/fault.c index dd35b6191798..f806ade79afd 100644 --- a/arch/unicore32/mm/fault.c +++ b/arch/unicore32/mm/fault.c @@ -233,12 +233,12 @@ static int do_pf(unsigned long addr, unsigned int fsr, struct pt_regs *regs) * validly references user space from well defined areas of the code, * we can bug out early if this is from code which shouldn't. */ - if (!down_read_trylock(&mm->mmap_sem)) { + if (!mm_read_trylock(mm, &mmrange)) { if (!user_mode(regs) && !search_exception_tables(regs->UCreg_pc)) goto no_context; retry: - down_read(&mm->mmap_sem); + mm_read_lock(mm, &mmrange); } else { /* * The above down_read_trylock() might have succeeded in @@ -275,7 +275,7 @@ static int do_pf(unsigned long addr, unsigned int fsr, struct pt_regs *regs) } } - up_read(&mm->mmap_sem); + mm_read_unlock(mm, &mmrange); /* * Handle the "normal" case first - VM_FAULT_MAJOR -- 2.13.6