Received: by 10.223.176.5 with SMTP id f5csp1989572wra; Sun, 4 Feb 2018 17:34:14 -0800 (PST) X-Google-Smtp-Source: AH8x2243sUjXOQ6qW0RjxrxoVbiZfLmGFq24YIqkMQRQCZUPEoLcMi8dR24gMQmE+k2b9AWxmvA6 X-Received: by 2002:a17:902:6c0e:: with SMTP id q14-v6mr42809470plk.445.1517794454174; Sun, 04 Feb 2018 17:34:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517794454; cv=none; d=google.com; s=arc-20160816; b=gb/FURR65Z5+JLCSShxQcFGkYYYegnqPKAJjVarQiihyhEqKJg+jHG0HYS2AI6jKjK ejsuZCuAkynMaAzZBa/O3fZPm1KlvWnVPohc68VYjExZ64egDTybmbF2AVKde831blHd ouzmIBZOt/kx3dEXoYFc3OPi5secZIvu3YivswhPJLL44nzym8pof2u4F9rKvTSHU9BT NLqcDFbwkM7TnA4u2IzlFEgYeJAoqflHHWy5OQDTvap4rdjNOH2cz89yKHtu441SxpL0 V5vXBKlfC/f0VVrgfTvPYIql4BvbxoyCaQK8ZQD+9C84eEXiYRv5eke1il7zoTFAyqA4 UqGg== 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=MaBp0d3qmcyKG6CfQSqd0m4ZCgcYlsvpXb+RGLoUg6c=; b=RFkEYlV+8fQ9kQhyDKl57qBjg467fX8zHZ/El2uT04G2oL1Pd2cbJT5X2F+9BF8esJ SgwziTcnepkyNcjJobh4wflJFIHbgkcbhO3QO5KQfBu2JLTcECCOF1mgcVsIZy8jGx/c NKayd+ZvEYtwQG5WaSgwUzBI4aTBh3EFf9aBkyRj+gc+pRyD5Q16e+x0Nkn50Ue4b9hz jWCIQsBJ9o/ukl6weI2tNI9uZ/n6Y+kToJxuM2ek6wjScW8NAAobC+R34CBjZxyFrsn7 V8ex5saEIPGnCQWpSIA6d//SYfOemhZIPjTcsF8jZ8bkR7GU4d33QnAXVeI2OV4RiIhp ztpg== 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 c10si2356892pge.396.2018.02.04.17.33.59; Sun, 04 Feb 2018 17:34:14 -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 S1752529AbeBEBdP (ORCPT + 99 others); Sun, 4 Feb 2018 20:33:15 -0500 Received: from mx2.suse.de ([195.135.220.15]:44168 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752792AbeBEB3X (ORCPT ); Sun, 4 Feb 2018 20:29:23 -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 A9650AE20; 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 45/64] arch/m32r: use mm locking wrappers Date: Mon, 5 Feb 2018 02:27:35 +0100 Message-Id: <20180205012754.23615-46-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/m32r/mm/fault.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/m32r/mm/fault.c b/arch/m32r/mm/fault.c index 0129aea46729..2c6b58ecfc53 100644 --- a/arch/m32r/mm/fault.c +++ b/arch/m32r/mm/fault.c @@ -137,11 +137,11 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, * source. If this is invalid we can skip the address space check, * thus avoiding the deadlock. */ - if (!down_read_trylock(&mm->mmap_sem)) { + if (!mm_read_trylock(mm, &mmrange)) { if ((error_code & ACE_USERMODE) == 0 && !search_exception_tables(regs->psw)) goto bad_area_nosemaphore; - down_read(&mm->mmap_sem); + mm_read_lock(mm, &mmrange); } vma = find_vma(mm, address); @@ -213,7 +213,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, else tsk->min_flt++; set_thread_fault_code(0); - up_read(&mm->mmap_sem); + mm_read_unlock(mm, &mmrange); return; /* @@ -221,7 +221,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, * Fix it, but check if it's kernel or user first.. */ bad_area: - up_read(&mm->mmap_sem); + mm_read_unlock(mm, &mmrange); bad_area_nosemaphore: /* User mode accesses just cause a SIGSEGV */ @@ -274,14 +274,14 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, * us unable to handle the page fault gracefully. */ out_of_memory: - up_read(&mm->mmap_sem); + mm_read_unlock(mm, &mmrange); if (!(error_code & ACE_USERMODE)) goto no_context; pagefault_out_of_memory(); return; do_sigbus: - up_read(&mm->mmap_sem); + mm_read_unlock(mm, &mmrange); /* Kernel mode? Handle exception or die */ if (!(error_code & ACE_USERMODE)) -- 2.13.6