login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
February
»
16
Re: [patch 5/6] mmu_notifier: Support for drivers with revers maps (f.e. for XPmem)
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Andrew Morton
Subject:
Re: [patch 5/6] mmu_notifier: Support for drivers with revers maps (f.e. for XPmem)
Date: Friday, February 15, 2008 - 8:37 pm
On Thu, 14 Feb 2008 22:49:04 -0800 Christoph Lameter <clameter@sgi.com> wrote:
quoted text
> These special additional callbacks are required because XPmem (and likely > other mechanisms) do use their own rmap (multiple processes on a series > of remote Linux instances may be accessing the memory of a process). > F.e. XPmem may have to send out notifications to remote Linux instances > and receive confirmation before a page can be freed. > > So we handle this like an additional Linux reverse map that is walked after > the existing rmaps have been walked. We leave the walking to the driver that > is then able to use something else than a spinlock to walk its reverse > maps. So we can actually call the driver without holding spinlocks while > we hold the Pagelock. > > However, we cannot determine the mm_struct that a page belongs to at > that point. The mm_struct can only be determined from the rmaps by the > device driver. > > We add another pageflag (PageExternalRmap) that is set if a page has > been remotely mapped (f.e. by a process from another Linux instance). > We can then only perform the callbacks for pages that are actually in > remote use. > > Rmap notifiers need an extra page bit and are only available > on 64 bit platforms. This functionality is not available on 32 bit! > > A notifier that uses the reverse maps callbacks does not need to provide > the invalidate_page() method that is called when locks are held. >
hrm.
quoted text
> +#define mmu_rmap_notifier(function, args...) \ > + do { \ > + struct mmu_rmap_notifier *__mrn; \ > + struct hlist_node *__n; \ > + \ > + rcu_read_lock(); \ > + hlist_for_each_entry_rcu(__mrn, __n, \ > + &mmu_rmap_notifier_list, hlist) \ > + if (__mrn->ops->function) \ > + __mrn->ops->function(__mrn, args); \ > + rcu_read_unlock(); \ > + } while (0); > +
buggy macro: use locals.
quoted text
> +#define mmu_rmap_notifier(function, args...) \ > + do { \ > + if (0) { \ > + struct mmu_rmap_notifier *__mrn; \ > + \ > + __mrn = (struct mmu_rmap_notifier *)(0x00ff); \ > + __mrn->ops->function(__mrn, args); \ > + } \ > + } while (0); > +
Same observation as in the other patch.
quoted text
> =================================================================== > --- linux-2.6.orig/mm/mmu_notifier.c 2008-02-14 21:17:51.000000000 -0800 > +++ linux-2.6/mm/mmu_notifier.c 2008-02-14 21:21:04.000000000 -0800 > @@ -74,3 +74,37 @@ void mmu_notifier_unregister(struct mmu_ > } > EXPORT_SYMBOL_GPL(mmu_notifier_unregister); > > +#ifdef CONFIG_64BIT > +static DEFINE_SPINLOCK(mmu_notifier_list_lock); > +HLIST_HEAD(mmu_rmap_notifier_list); > + > +void mmu_rmap_notifier_register(struct mmu_rmap_notifier *mrn) > +{ > + spin_lock(&mmu_notifier_list_lock); > + hlist_add_head_rcu(&mrn->hlist, &mmu_rmap_notifier_list); > + spin_unlock(&mmu_notifier_list_lock); > +} > +EXPORT_SYMBOL(mmu_rmap_notifier_register); > + > +void mmu_rmap_notifier_unregister(struct mmu_rmap_notifier *mrn) > +{ > + spin_lock(&mmu_notifier_list_lock); > + hlist_del_rcu(&mrn->hlist); > + spin_unlock(&mmu_notifier_list_lock); > +} > +EXPORT_SYMBOL(mmu_rmap_notifier_unregister); > > +/* > + * Export a page. > + * > + * Pagelock must be held. > + * Must be called before a page is put on an external rmap. > + */ > +void mmu_rmap_export_page(struct page *page) > +{ > + BUG_ON(!PageLocked(page)); > + SetPageExternalRmap(page); > +} > +EXPORT_SYMBOL(mmu_rmap_export_page);
The other patch used EXPORT_SYMBOL_GPL. --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[patch 5/6] mmu_notifier: Support for drivers with revers ...
, Christoph Lameter
, (Thu Feb 14, 11:49 pm)
Re: [patch 5/6] mmu_notifier: Support for drivers with rev ...
, Andrew Morton
, (Fri Feb 15, 8:37 pm)
Re: [patch 5/6] mmu_notifier: Support for drivers with rev ...
, Christoph Lameter
, (Sat Feb 16, 12:28 pm)
Re: [patch 5/6] mmu_notifier: Support for drivers with rev ...
, Nick Piggin
, (Tue Feb 19, 4:55 pm)
Re: [patch 5/6] mmu_notifier: Support for drivers with rev ...
, Robin Holt
, (Tue Feb 19, 8:12 pm)
Re: [patch 5/6] mmu_notifier: Support for drivers with rev ...
, Nick Piggin
, (Tue Feb 19, 8:51 pm)
Re: [patch 5/6] mmu_notifier: Support for drivers with rev ...
, Robin Holt
, (Wed Feb 20, 2:00 am)
Re: [patch 5/6] mmu_notifier: Support for drivers with rev ...
, Robin Holt
, (Wed Feb 20, 2:05 am)
Re: [patch 5/6] mmu_notifier: Support for drivers with rev ...
, Nick Piggin
, (Wed Feb 20, 9:20 pm)
Re: [patch 5/6] mmu_notifier: Support for drivers with rev ...
, Robin Holt
, (Thu Feb 21, 3:58 am)
Re: [patch 5/6] mmu_notifier: Support for drivers with rev ...
, Nick Piggin
, (Mon Feb 25, 11:11 pm)
Re: [ofa-general] Re: [patch 5/6] mmu_notifier: Support fo ...
, Gleb Natapov
, (Tue Feb 26, 12:21 am)
Re: [ofa-general] Re: [patch 5/6] mmu_notifier: Support fo ...
, Nick Piggin
, (Tue Feb 26, 1:52 am)
Re: [ofa-general] Re: [patch 5/6] mmu_notifier: Support fo ...
, Gleb Natapov
, (Tue Feb 26, 2:38 am)
Re: [ofa-general] Re: [patch 5/6] mmu_notifier: Support fo ...
, KOSAKI Motohiro
, (Tue Feb 26, 2:52 am)
Re: [ofa-general] Re: [patch 5/6] mmu_notifier: Support fo ...
, Robin Holt
, (Tue Feb 26, 5:28 am)
Re: [patch 5/6] mmu_notifier: Support for drivers with rev ...
, Robin Holt
, (Tue Feb 26, 5:29 am)
Re: [patch 5/6] mmu_notifier: Support for drivers with rev ...
, Christoph Lameter
, (Wed Feb 27, 3:43 pm)
Re: [patch 5/6] mmu_notifier: Support for drivers with rev ...
, Andrea Arcangeli
, (Wed Feb 27, 5:42 pm)
Re: [patch 5/6] mmu_notifier: Support for drivers with rev ...
, Christoph Lameter
, (Wed Feb 27, 6:01 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Mel Gorman
Re: [PATCH 1/4] vmstat: remove zone->lock from walk_zones_in_node
Guenter Roeck
Re: [lm-sensors] Location for thermal drivers
David Woodhouse
Re: RFC: Moving firmware blobs out of the kernel.
Siddha, Suresh B
Re: [PATCH 2.6.21 review I] [11/25] x86: default to physical mode on hotplug CPU k...
Peter Zijlstra
Re: [patch 4/6] mm: merge populate and nopage into fault (fixes nonlinear)
git-commits-head
:
Linux Kernel Mailing List
[MIPS] Fix potential latency problem due to non-atomic cpu_wait.
Linux Kernel Mailing List
USB: rename USB_SPEED_VARIABLE to USB_SPEED_WIRELESS
Linux Kernel Mailing List
lib/vsprintf.c: fix bug omitting minus sign of numbers (module_param)
Linux Kernel Mailing List
[Bluetooth] Initiate authentication during connection establishment
Linux Kernel Mailing List
[POWERPC] 4xx: Add ppc40x_defconfig
linux-netdev
:
MERCEDES
Your mail id has won 950,000.00 in the MERCEDES Benz Online Promo.for claims send:
David Miller
Re: [PATCH] xen/netfront: do not mark packets of length < MSS as GSO
David Miller
Re: skb_segment() questions
Shan Wei
[RFC PATCH net-next 2/5]IPv6:netfilter: Send an ICMPv6 "Fragment Reassembly Timeou...
Stanislaw Gruszka
[PATCH 1/4] bnx2x: use smp_mb() to keep ordering of read write operations
git
:
Nicolas Sebrecht
git-svn died of signal 11 (was "3 failures on test t9100 (svn)")
Junio C Hamano
Re: [PATCH 2/2] Add url.<base>.pushInsteadOf: URL rewriting for push only
Martin Langhoff
Re: [PATCH] GIT commit statistics.
Alexandre Julliard
[PATCH] gitweb: Put back shortlog instead of graphiclog in the project list.
Josh Triplett
[PATCH 2/2] Add url.<base>.pushInsteadOf: URL rewriting for push only
openbsd-misc
:
Taisto Qvist XX
Re: AMD GEODE LX-800 just works with kernel from install42.iso and kernelpanics wi...
Nico Meijer
Re: gOS Develop Kit with VIA pc-1 Processor Platform VIA C7-D
Andreas Bihlmaier
Re: jetway board sensors (Fintek F71805F)
admin
Drive a 2009 car from R799p/m
Antti Harri
Re: how to create a sha256 hash
Colocation donated by:
Syndicate