Received: by 10.223.176.5 with SMTP id f5csp1993124wra; Sun, 4 Feb 2018 17:40:22 -0800 (PST) X-Google-Smtp-Source: AH8x226HwojyJHgi4KAb/UWh+Q9lY8SN9Cxo4ewnD3hUd98F1VaSt3aipdKOiSkep/ScwLajM4oP X-Received: by 2002:a17:902:8f8b:: with SMTP id z11-v6mr20244952plo.43.1517794822823; Sun, 04 Feb 2018 17:40:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517794822; cv=none; d=google.com; s=arc-20160816; b=nOAw1wZx1jIpkPnl84yKwa9zlQyx1vbY6Zjww/u+TXhdM4GZ9LgqN13l5JrESuVxJ1 AQphaIqAR7txB7Ze/1WXqEm3Ibsf7RRZdJeeq6WDOjxqSX179RWshx2MWYnUDt4q9+1+ Z2IMrCIjg7aEow1J7b9+WA6aUefTC2LH4HiXpaEEiG3AoDfadiqDqxbUXri4wt5yVHqP ElxXyTGmsDasEJ3mDwQJRyPTfye3mhQciooiSPZ1YrFmXOPzzuzskgEbPOzV4nE92/b/ kN3z/g3PHP9y8Ne/SD5VYpotF8ggkHm0TAnksiLg3Iq3FC/pOwlKpSoes7u4dEVZsGHY of5g== 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=UTHXCdAnHihDaNHiiIPi/q5ZzIwB664QLh+ISPEOLcg=; b=wW/yY11XVLELgTPyifUkv64USVrZZBeegeQA8P00zqAdFa+IApri+dMH2QKjD4lJVy xqaVdcIzM3dO8ou5LfFnckC58KgjWKVoF+9CaH68FEoTLUKCRn9BF1SKCP3qx93RKtT9 p4hGwYRprMFhlBOd2uN7HkeKjq5P29IJUWRkNEla/E/yZ8DrALRuirXu2sTgWnrKjdWg WGpa+VwOp9mUl7xyfLv/ixy1+RAqrfM+968uN0lkFfQ/EK4B+8dBY8XbcAjWjQRdrvvz HikFZO/FNDHoKySp4rjSst0fmYOPJ6uwK92CmYWDjv2uhW6bahNV1sjPSzXpYjcwlcDQ a2Tw== 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 d74si6087516pfj.265.2018.02.04.17.40.08; Sun, 04 Feb 2018 17:40:22 -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 S1752803AbeBEBhg (ORCPT + 99 others); Sun, 4 Feb 2018 20:37:36 -0500 Received: from mx2.suse.de ([195.135.220.15]:43456 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752416AbeBEB2i (ORCPT ); Sun, 4 Feb 2018 20:28:38 -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 E8C60AE05; Mon, 5 Feb 2018 01:28:00 +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 47/64] arch/microblaze: use mm locking wrappers Date: Mon, 5 Feb 2018 02:27:37 +0100 Message-Id: <20180205012754.23615-48-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/microblaze/mm/fault.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/microblaze/mm/fault.c b/arch/microblaze/mm/fault.c index fd49efbdfbf4..072e0d79aab5 100644 --- a/arch/microblaze/mm/fault.c +++ b/arch/microblaze/mm/fault.c @@ -139,12 +139,12 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, * source. If this is invalid we can skip the address space check, * thus avoiding the deadlock. */ - if (unlikely(!down_read_trylock(&mm->mmap_sem))) { + if (unlikely(!mm_read_trylock(mm, &mmrange))) { if (kernel_mode(regs) && !search_exception_tables(regs->pc)) goto bad_area_nosemaphore; retry: - down_read(&mm->mmap_sem); + mm_read_lock(mm, &mmrange); } vma = find_vma(mm, address); @@ -251,7 +251,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, } } - up_read(&mm->mmap_sem); + mm_read_unlock(mm, &mmrange); /* * keep track of tlb+htab misses that are good addrs but @@ -262,7 +262,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, return; bad_area: - up_read(&mm->mmap_sem); + mm_read_unlock(mm, &mmrange); bad_area_nosemaphore: pte_errors++; @@ -286,7 +286,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, * 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 @@ -294,7 +294,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, return; do_sigbus: - up_read(&mm->mmap_sem); + mm_read_unlock(mm, &mmrange); if (user_mode(regs)) { info.si_signo = SIGBUS; info.si_errno = 0; -- 2.13.6