From patchwork Fri Sep 4 16:58:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 7124851 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 95955BEEC1 for ; Fri, 4 Sep 2015 17:01:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 96FF92082E for ; Fri, 4 Sep 2015 17:00:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 56B462070F for ; Fri, 4 Sep 2015 17:00:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 307FB6E6CA; Fri, 4 Sep 2015 10:00:57 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from gproxy4-pub.mail.unifiedlayer.com (gproxy4-pub.mail.unifiedlayer.com [69.89.23.142]) by gabe.freedesktop.org (Postfix) with SMTP id 529AD6EC26 for ; Fri, 4 Sep 2015 10:00:53 -0700 (PDT) Received: (qmail 22920 invoked by uid 0); 4 Sep 2015 17:00:50 -0000 Received: from unknown (HELO cmgw3) (10.0.90.84) by gproxy4.mail.unifiedlayer.com with SMTP; 4 Sep 2015 17:00:50 -0000 Received: from box514.bluehost.com ([74.220.219.114]) by cmgw3 with id DB0c1r01A2UhLwi01B0gLv; Fri, 04 Sep 2015 17:00:48 -0600 X-Authority-Analysis: v=2.1 cv=GpXRpCFC c=1 sm=1 tr=0 a=9W6Fsu4pMcyimqnCr1W0/w==:117 a=9W6Fsu4pMcyimqnCr1W0/w==:17 a=cNaOj0WVAAAA:8 a=f5113yIGAAAA:8 a=TBVoxVdAAAAA:8 a=GhZ5P8ky69gA:10 a=noBwr2J6l1kA:10 a=ff-B7xzCdYMA:10 a=jsAmBejXXrQ06ank25sA:9 a=YbWGwhB_HDplaQpM:21 a=ovLNDb5QSoxjbhxm:21 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuousgeek.org; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=yw8GhpYKN6o/RZAV0SeFr9PArL1S6RINgzP2XqG/lo8=; b=TiGAxEVY278oRPxH3zQW8FMiQgUbxXvLo1I+s8BFRxUDGL2xhdi3AXFeJcblXjEFRenSkKbSn7VexUfqajkzq83WmQOqmBfzbOxmdrkoyQYYhtxt6c56ydkLRoIMwR0r; Received: from [67.161.37.189] (port=52804 helo=localhost.localdomain) by box514.bluehost.com with esmtpsa (TLSv1.2:AES128-SHA256:128) (Exim 4.84) (envelope-from ) id 1ZXuLt-0003Ni-Ub; Fri, 04 Sep 2015 11:00:37 -0600 From: Jesse Barnes To: intel-gfx@lists.freedesktop.org Date: Fri, 4 Sep 2015 09:58:55 -0700 Message-Id: <1441385943-11508-2-git-send-email-jbarnes@virtuousgeek.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441385943-11508-1-git-send-email-jbarnes@virtuousgeek.org> References: <1441385943-11508-1-git-send-email-jbarnes@virtuousgeek.org> X-Identified-User: {10642:box514.bluehost.com:virtuous:virtuousgeek.org} {sentby:smtp auth 67.161.37.189 authed with jbarnes@virtuousgeek.org} Cc: dwmw2@infradead.org Subject: [Intel-gfx] [PATCH 1/9] mm: move mmu_find_ops to mmu_notifier.c X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For use by other modules. Signed-off-by: Jesse Barnes --- drivers/misc/sgi-gru/grutlbpurge.c | 19 ------------------- include/linux/mmu_notifier.h | 8 ++++++++ mm/mmu_notifier.c | 19 +++++++++++++++++++ 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/drivers/misc/sgi-gru/grutlbpurge.c b/drivers/misc/sgi-gru/grutlbpurge.c index 2129274..0f86892 100644 --- a/drivers/misc/sgi-gru/grutlbpurge.c +++ b/drivers/misc/sgi-gru/grutlbpurge.c @@ -275,25 +275,6 @@ static const struct mmu_notifier_ops gru_mmuops = { .release = gru_release, }; -/* Move this to the basic mmu_notifier file. But for now... */ -static struct mmu_notifier *mmu_find_ops(struct mm_struct *mm, - const struct mmu_notifier_ops *ops) -{ - struct mmu_notifier *mn, *gru_mn = NULL; - - if (mm->mmu_notifier_mm) { - rcu_read_lock(); - hlist_for_each_entry_rcu(mn, &mm->mmu_notifier_mm->list, - hlist) - if (mn->ops == ops) { - gru_mn = mn; - break; - } - rcu_read_unlock(); - } - return gru_mn; -} - struct gru_mm_struct *gru_register_mmu_notifier(void) { struct gru_mm_struct *gms; diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index 61cd67f..0a78f5e 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h @@ -215,6 +215,8 @@ extern void __mmu_notifier_invalidate_range_end(struct mm_struct *mm, unsigned long start, unsigned long end); extern void __mmu_notifier_invalidate_range(struct mm_struct *mm, unsigned long start, unsigned long end); +extern struct mmu_notifier *mmu_find_ops(struct mm_struct *mm, + const struct mmu_notifier_ops *ops); static inline void mmu_notifier_release(struct mm_struct *mm) { @@ -425,6 +427,12 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) { } +static inline struct mmu_notifier *mmu_find_ops(struct mm_struct *mm, + struct mmu_notifier_ops *ops) +{ + return NULL; +} + #define ptep_clear_flush_young_notify ptep_clear_flush_young #define pmdp_clear_flush_young_notify pmdp_clear_flush_young #define ptep_clear_flush_notify ptep_clear_flush diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c index 3b9b3d0..d978138 100644 --- a/mm/mmu_notifier.c +++ b/mm/mmu_notifier.c @@ -389,6 +389,25 @@ void mmu_notifier_unregister_no_release(struct mmu_notifier *mn, } EXPORT_SYMBOL_GPL(mmu_notifier_unregister_no_release); +struct mmu_notifier *mmu_find_ops(struct mm_struct *mm, + const struct mmu_notifier_ops *ops) +{ + struct mmu_notifier *mn, *tmp_mn = NULL; + + if (mm->mmu_notifier_mm) { + rcu_read_lock(); + hlist_for_each_entry_rcu(mn, &mm->mmu_notifier_mm->list, + hlist) + if (mn->ops == ops) { + tmp_mn = mn; + break; + } + rcu_read_unlock(); + } + return tmp_mn; +} +EXPORT_SYMBOL_GPL(mmu_find_ops); + static int __init mmu_notifier_init(void) { return init_srcu_struct(&srcu);