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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jack Steiner <steiner@...>
Cc: Andrea Arcangeli <andrea@...>, Robin Holt <holt@...>, Avi Kivity <avi@...>, Izik Eidus <izike@...>, Nick Piggin <npiggin@...>, <kvm-devel@...>, Benjamin Herrenschmidt <benh@...>, Peter Zijlstra <a.p.zijlstra@...>, <linux-kernel@...>, <linux-mm@...>, <daniel.blueman@...>, Hugh Dickins <hugh@...>
Date: Wednesday, January 30, 2008 - 4:55 pm

On Wed, 30 Jan 2008, Jack Steiner wrote:


We are changing definitions. The original patch by Andrea calls 
invalidate_page for each pte that is cleared. So strictly you would not 
need an invalidate_range.


The refcount is not necessary if we adopt Andrea's approach of a callback 
on the clearing of each pte. At that point the page is still guaranteed to 
exist. If we do the range_invalidate later (as in V3) then the page may 
have been released (see sys_remap_file_pages() f.e.) before we zap the GRU 
ptes. So there will be a time when the GRU may write to a page that has 
been freed and used for another purpose.

Taking a refcount on the page defers the free until the range_invalidate 
runs.

I would prefer a solution that does not require taking refcounts (pins) 
for establishing an external pte and for release (like what the GRU does).

If we could effectively determine that there are no external ptes in a 
range then the invalidate_page() call may return immediately. Maybe it is 
then effective to do these gazillions of invalidate_page() calls when a 
process terminates or an remap is performed.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 2/6] mmu_notifier: Callbacks to invalidate address ra..., Christoph Lameter, (Mon Jan 28, 4:28 pm)
Re: [patch 2/6] mmu_notifier: Callbacks to invalidate addres..., Andrea Arcangeli, (Tue Jan 29, 12:20 pm)
Re: [patch 2/6] mmu_notifier: Callbacks to invalidate addres..., Christoph Lameter, (Tue Jan 29, 3:55 pm)
Re: [patch 2/6] mmu_notifier: Callbacks to invalidate addres..., Christoph Lameter, (Tue Jan 29, 5:35 pm)
Re: [patch 2/6] mmu_notifier: Callbacks to invalidate addres..., Christoph Lameter, (Tue Jan 29, 6:39 pm)
Re: [patch 2/6] mmu_notifier: Callbacks to invalidate addres..., Christoph Lameter, (Wed Jan 30, 3:35 pm)
Re: [patch 2/6] mmu_notifier: Callbacks to invalidate addres..., Christoph Lameter, (Wed Jan 30, 3:50 pm)
Re: [patch 2/6] mmu_notifier: Callbacks to invalidate addres..., Christoph Lameter, (Wed Jan 30, 8:01 pm)
Re: [kvm-devel] [patch 2/6] mmu_notifier: Callbacks to inval..., Christoph Lameter, (Wed Jan 30, 10:08 pm)
Re: [kvm-devel] [patch 2/6] mmu_notifier: Callbacks to inval..., Andrea Arcangeli, (Wed Jan 30, 10:42 pm)
Re: [kvm-devel] [patch 2/6] mmu_notifier: Callbacks to inval..., Christoph Lameter, (Wed Jan 30, 10:51 pm)
Re: [kvm-devel] [patch 2/6] mmu_notifier: Callbacks to inval..., Christoph Lameter, (Wed Jan 30, 9:46 pm)
Re: [kvm-devel] mmu_notifier: invalidate_range_start with lo..., Christoph Lameter, (Wed Jan 30, 10:56 pm)
Re: [kvm-devel] [patch 2/6] mmu_notifier: Callbacks to inval..., Christoph Lameter, (Wed Jan 30, 10:37 pm)
Re: [patch 2/6] mmu_notifier: Callbacks to invalidate addres..., Christoph Lameter, (Tue Jan 29, 8:20 pm)
Re: [patch 2/6] mmu_notifier: Callbacks to invalidate addres..., Christoph Lameter, (Wed Jan 30, 3:41 pm)
Re: [patch 2/6] mmu_notifier: Callbacks to invalidate addres..., Christoph Lameter, (Wed Jan 30, 4:55 pm)
Re: [patch 2/6] mmu_notifier: Callbacks to invalidate addres..., Christoph Lameter, (Tue Jan 29, 8:35 pm)
Re: [patch 2/6] mmu_notifier: Callbacks to invalidate addres..., Christoph Lameter, (Tue Jan 29, 8:22 pm)
Re: [patch 2/6] mmu_notifier: Callbacks to invalidate addres..., Christoph Lameter, (Tue Jan 29, 4:30 pm)
Re: [patch 2/6] mmu_notifier: Callbacks to invalidate addres..., Christoph Lameter, (Tue Jan 29, 5:53 pm)
Re: [patch 2/6] mmu_notifier: Callbacks to invalidate addres..., Christoph Lameter, (Tue Jan 29, 6:55 pm)
Re: [patch 2/6] mmu_notifier: Callbacks to invalidate addres..., Christoph Lameter, (Tue Jan 29, 8:34 pm)