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

From: Andrea Arcangeli
Date: Tue Mar 04 2008 - 08:30:32 EST


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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/