Re: [patch 2/4] mmu_notifier: Callbacks to invalidate address ranges

2008-02-02 Thread Andrea Arcangeli
On Fri, Feb 01, 2008 at 05:35:28PM -0600, Robin Holt wrote: > No, we need a callout when we are becoming more restrictive, but not > when becoming more permissive. I would have to guess that is the case > for any of these callouts. It is for both GRU and XPMEM. I would > expect the same is true

Re: [patch 2/4] mmu_notifier: Callbacks to invalidate address ranges

2008-02-01 Thread Robin Holt
On Fri, Feb 01, 2008 at 06:21:45PM -0600, Robin Holt wrote: > On Fri, Feb 01, 2008 at 04:05:08PM -0800, Christoph Lameter wrote: > > Are you saying that you get the callback when transitioning from a read > > only to a read write pte on the *same* page? > > I believe that is what we saw. We have

Re: [patch 2/4] mmu_notifier: Callbacks to invalidate address ranges

2008-02-01 Thread Robin Holt
On Fri, Feb 01, 2008 at 04:05:08PM -0800, Christoph Lameter wrote: > On Fri, 1 Feb 2008, Robin Holt wrote: > > > On Fri, Feb 01, 2008 at 03:19:32PM -0800, Christoph Lameter wrote: > > > On Fri, 1 Feb 2008, Robin Holt wrote: > > > > > > > We are getting this callout when we transition the pte from

Re: [patch 2/4] mmu_notifier: Callbacks to invalidate address ranges

2008-02-01 Thread Christoph Lameter
On Fri, 1 Feb 2008, Robin Holt wrote: > On Fri, Feb 01, 2008 at 03:19:32PM -0800, Christoph Lameter wrote: > > On Fri, 1 Feb 2008, Robin Holt wrote: > > > > > We are getting this callout when we transition the pte from a read-only > > > to read-write. Jack and I can not see a reason we would nee

Re: [patch 2/4] mmu_notifier: Callbacks to invalidate address ranges

2008-02-01 Thread Robin Holt
On Fri, Feb 01, 2008 at 03:19:32PM -0800, Christoph Lameter wrote: > On Fri, 1 Feb 2008, Robin Holt wrote: > > > We are getting this callout when we transition the pte from a read-only > > to read-write. Jack and I can not see a reason we would need that > > callout. It is causing problems for x

Re: [patch 2/4] mmu_notifier: Callbacks to invalidate address ranges

2008-02-01 Thread Christoph Lameter
On Fri, 1 Feb 2008, Robin Holt wrote: > We are getting this callout when we transition the pte from a read-only > to read-write. Jack and I can not see a reason we would need that > callout. It is causing problems for xpmem in that a write fault goes > to get_user_pages which gets back to do_wp_

Re: [patch 2/4] mmu_notifier: Callbacks to invalidate address ranges

2008-02-01 Thread Robin Holt
Christoph, The following code in do_wp_page is a problem. We are getting this callout when we transition the pte from a read-only to read-write. Jack and I can not see a reason we would need that callout. It is causing problems for xpmem in that a write fault goes to get_user_pages which gets b

Re: [patch 2/4] mmu_notifier: Callbacks to invalidate address ranges

2008-02-01 Thread Christoph Lameter
Argh. Did not see this soon enougn. Maybe this one is better since it avoids the additional unlocks? On Fri, 1 Feb 2008, Robin Holt wrote: > do_wp_page can reach the _end callout without passing the _begin > callout. This prevents making the _end unles the _begin has also > been made. > > Inde

Re: [patch 2/4] mmu_notifier: Callbacks to invalidate address ranges

2008-02-01 Thread Robin Holt
do_wp_page can reach the _end callout without passing the _begin callout. This prevents making the _end unles the _begin has also been made. Index: mmu_notifiers-cl-v5/mm/memory.c === --- mmu_notifiers-cl-v5.orig/mm/memory.c2

[patch 2/4] mmu_notifier: Callbacks to invalidate address ranges

2008-01-31 Thread Christoph Lameter
The invalidation of address ranges in a mm_struct needs to be performed when pages are removed or permissions etc change. invalidate_range_begin/end() is frequently called with only mmap_sem held. If invalidate_range_begin() is called with locks held then we pass a flag into invalidate_range() to

[patch 2/4] mmu_notifier: Callbacks to invalidate address ranges

2008-01-24 Thread Christoph Lameter
The invalidation of address ranges in a mm_struct needs to be performed when pages are removed or permissions etc change. invalidate_range() is generally called with mmap_sem held but no spinlocks are active. Exceptions: We hold i_mmap_lock in __unmap_hugepage_range and sometimes in zap_page_ran