linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Cliff Wickman <cpw@sgi.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: aarcange@redhat.com, akpm@linux-foundation.org, avi@redhat.com,
	hughd@google.com, mgorman@suse.de, linux-mm@kvack.org
Subject: Re: [PATCH] mm: export mmu notifier invalidates
Date: Fri, 4 Jan 2013 16:09:15 -0600	[thread overview]
Message-ID: <20130104220915.GA11735@sgi.com> (raw)
In-Reply-To: <20130104213516.GA7650@infradead.org>

On Fri, Jan 04, 2013 at 04:35:17PM -0500, Christoph Hellwig wrote:
> On Fri, Jan 04, 2013 at 09:41:53AM -0600, Cliff Wickman wrote:
> > So we request that these two functions be exported.
> 
> Can you please post the patch that actually uses it in the same series?

The code that needs to use these two functions is an SGI module.  We'd
be happy to open source it, but I think no one else is interested in it.

This is what that patch looks like:

---
 opensource/xvma/xvma/kernel/xvma.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Index: 121214.rhel7/opensource/xvma/xvma/kernel/xvma.c
===================================================================
--- 121214.rhel7.orig/opensource/xvma/xvma/kernel/xvma.c
+++ 121214.rhel7/opensource/xvma/xvma/kernel/xvma.c
@@ -32,6 +32,7 @@
 #include <linux/mmu_notifier.h>
 #include <linux/rculist.h>
 #include <linux/spinlock.h>
+#include <linux/version.h>
 #include <asm/current.h>
 #include "xvma.h"
 static struct rb_root xmm_rb_root = RB_ROOT;
@@ -1248,16 +1249,19 @@ void
 zap_xvma_ptes(struct xvma_struct * xvma, unsigned long start, unsigned long size)
 {
 	struct mm_struct * mm = xvma->xvma_mm;
+	unsigned long end = start + size;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,5,0)
 	struct mmu_notifier * mn;
 	struct hlist_node * n;
-	unsigned long end = start + size;
+	int srcu;
+#endif
 
 	DPRINTK_XMM_XVMA(xvma->xvma_xmm, xvma);
 	if (mm) {
-		int srcu;
 		/* don't remove this - superpages may have no mmu notifier */
         	if (!mm->mmu_notifier_mm)
                 	return;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,5,0)
 		srcu = srcu_read_lock(&mm->mmu_notifier_mm->srcu);
 		hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) {
 			if (mn->ops->invalidate_range_start)
@@ -1268,6 +1272,10 @@ zap_xvma_ptes(struct xvma_struct * xvma,
 				mn->ops->invalidate_range_end(mn, mm, start, end);
 		}
 		srcu_read_unlock(&mm->mmu_notifier_mm->srcu, srcu);
+#else
+                __mmu_notifier_invalidate_range_start(mm, start, end);
+                __mmu_notifier_invalidate_range_end(mm, start, end);
+#endif
 	} else if (xvma->xvma_xmm->xmm_invalidate_high_range) {
 		xvma->xvma_xmm->xmm_invalidate_high_range(xvma->xvma_xmm, start, end);
 	}
-- 
Cliff Wickman
SGI
cpw@sgi.com
(651) 683-3824

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2013-01-04 22:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-04 15:41 [PATCH] mm: export mmu notifier invalidates Cliff Wickman
2013-01-04 21:35 ` Christoph Hellwig
2013-01-04 22:09   ` Cliff Wickman [this message]
2013-01-07 14:14 ` Mel Gorman
2013-01-07 15:35   ` Andrea Arcangeli
  -- strict thread matches above, loose matches on Subject: below --
2013-02-12 21:35 Cliff Wickman
2013-02-12 21:57 ` Andrew Morton
2013-02-13 15:03   ` Robin Holt
2013-02-13 20:11     ` Andrew Morton
2013-02-13 21:03       ` Robin Holt
2013-02-14 21:08         ` Andrew Morton
2013-02-14 21:35           ` Robin Holt
2013-02-14 21:52             ` Andrew Morton
2013-02-14 22:25               ` Robin Holt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130104220915.GA11735@sgi.com \
    --to=cpw@sgi.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=avi@redhat.com \
    --cc=hch@infradead.org \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).