Received: by 10.223.176.5 with SMTP id f5csp1991501wra; Sun, 4 Feb 2018 17:37:30 -0800 (PST) X-Google-Smtp-Source: AH8x227V75Evu7D0gVsIBlG73yEpK1dlgabhEafsEDaZxi0yXqpG++TzBJ/jwM14FFJqZkQZvZf1 X-Received: by 10.101.101.200 with SMTP id y8mr37704344pgv.0.1517794649933; Sun, 04 Feb 2018 17:37:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517794649; cv=none; d=google.com; s=arc-20160816; b=kA46s8hcS8BeUDKCRqJDCm5HVtG42RkjXCTjPhp0gsRvScsyhunrMwEPtaZbYkVoJN 55ufpPsKGFLeA9HyuiUJ3YQhGyaDqI2ZSZctYgtlk4+pcBXmaUHzcB+5f4ARdJiZqxFz 1KGjx91gpeKyBXlwE5PPHhit+tMRbT6xgX7FtS+ZUPiRqM4avkntRdFmW+RHrkFJ8Giq ZpYo3qRT99hhRLfFVWoQJOq7zk1Mza3XYyLNAs6DN7zSFQYLxPJ4Eju1b7JrZdb0VTUh Afy6UompVrcgimvfqBLBz3B16hsXBnY/TnxUr/WLzBktZ+ydI4QCEldQIuyyFuI5J/EH Kjbg== 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=ZH6QxQu63tYeAHZNzz2af3WUQ4geWOblrud6v9nZeYo=; b=kfwgbJNswlLnXf+I+foIeYUv9V9AmDNgm+gmBGM4F/Pi20URIE1W3I1XNNy79gkLG3 JpitiepyEQaJcIcQOHMOtntDrzVfCeiATyBTbkumsLQ9bM6UhKLDjr2mfNuWJW7exwfA GOceYNomivtu5zp1k9KPvsVr+SsogFiJdeF/AGhQajDc5SlulrX+7xCBRNG+kXgLj0ys W7dkW1fE3hOTl95obkDQ5Tyikv8GQOJymicLIVhaJQZveee5kWYg8/sTnHjsd3ffLQI8 uV+S6qk2FWhVrYSwWFzlM9dCud82lRiz6ZUIqEloaO3fZdEzwvo2fCVR+9HbREtBxBGQ +d5g== 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 u18-v6si2759734plq.228.2018.02.04.17.37.15; Sun, 04 Feb 2018 17:37:29 -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 S1752934AbeBEBfJ (ORCPT + 99 others); Sun, 4 Feb 2018 20:35:09 -0500 Received: from mx2.suse.de ([195.135.220.15]:44135 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752433AbeBEB3L (ORCPT ); Sun, 4 Feb 2018 20:29:11 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 427CCAE12; 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 49/64] arch/xtensa: use mm locking wrappers Date: Mon, 5 Feb 2018 02:27:39 +0100 Message-Id: <20180205012754.23615-50-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/xtensa/mm/fault.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/xtensa/mm/fault.c b/arch/xtensa/mm/fault.c index 6f8e3e7cccb5..5e783e5583b6 100644 --- a/arch/xtensa/mm/fault.c +++ b/arch/xtensa/mm/fault.c @@ -75,7 +75,7 @@ void do_page_fault(struct pt_regs *regs) if (user_mode(regs)) flags |= FAULT_FLAG_USER; retry: - down_read(&mm->mmap_sem); + mm_read_lock(mm, &mmrange); vma = find_vma(mm, address); if (!vma) @@ -141,7 +141,7 @@ void do_page_fault(struct pt_regs *regs) } } - up_read(&mm->mmap_sem); + mm_read_unlock(mm, &mmrange); perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); if (flags & VM_FAULT_MAJOR) perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address); @@ -154,7 +154,7 @@ void do_page_fault(struct pt_regs *regs) * Fix it, but check if it's kernel or user first.. */ bad_area: - up_read(&mm->mmap_sem); + mm_read_unlock(mm, &mmrange); if (user_mode(regs)) { current->thread.bad_vaddr = address; current->thread.error_code = is_write; @@ -173,7 +173,7 @@ void do_page_fault(struct pt_regs *regs) * us unable to handle the page fault gracefully. */ out_of_memory: - up_read(&mm->mmap_sem); + mm_read_unlock(mm, &mmrange); if (!user_mode(regs)) bad_page_fault(regs, address, SIGKILL); else @@ -181,7 +181,7 @@ void do_page_fault(struct pt_regs *regs) return; do_sigbus: - up_read(&mm->mmap_sem); + mm_read_unlock(mm, &mmrange); /* Send a sigbus, regardless of whether we were in kernel * or user mode. -- 2.13.6