[ofa-general] Re: [RFC] Notifier for Externally Mapped Memory (EMM)

Andrea Arcangeli andrea at qumranet.com
Tue Mar 4 05:30:20 PST 2008


On Mon, Mar 03, 2008 at 11:31:15PM -0800, Christoph Lameter wrote:
> @@ -446,6 +450,8 @@ static int page_mkclean_one(struct page 
>  	if (address == -EFAULT)
>  		goto out;
>  
> +	/* rmap lock held */
> +	emm_notify(mm, emm_invalidate_start, address, address + PAGE_SIZE);
>  	pte = page_check_address(page, mm, address, &ptl);
>  	if (!pte)
>  		goto out;
> @@ -462,6 +468,7 @@ static int page_mkclean_one(struct page 
>  	}
>  
>  	pte_unmap_unlock(pte, ptl);
> +	emm_notify(mm, emm_invalidate_end, address, address + PAGE_SIZE);
>  out:
>  	return ret;
>  }

I could have ripped invalidate_page from my patch too, except I didn't
want to slow down those paths for the known-common-users when not even
GRU would get any benefit from two hooks when only one is needed.

When working with single pages it's more efficient and preferable to
call invalidate_page and only later release the VM reference on the
page.



More information about the general mailing list