Re: invalidate_inode_pages in 2.5.32/3

From: Daniel Phillips (phillips@arcor.de)
Date: Thu Sep 12 2002 - 17:43:20 EST


On Friday 13 September 2002 00:30, Rik van Riel wrote:
> On Thu, 12 Sep 2002, Andrew Morton wrote:
>
> > Well the lazy invalidation would be OK - defer that to the next
> > userspace access,
>
> I think I have an idea on how to do that, here's some pseudocode:
>
> invalidate_page(struct page * page) {
> SetPageInvalidated(page);
> rmap_lock(page);
> for_each_pte(pte, page) {
> make pte PROT_NONE;
> flush TLBs for this virtual address;
> }
> rmap_unlock(page);
> }
>
> And in the page fault path:
>
> if (pte_protection(pte) == PROT_NONE && PageInvalidated(pte_page_pte)) {
> clear_pte(ptep);
> page_cache_release(page);
> mm->rss--;
> }
>
> What do you think, is this simple enough that it would work ? ;)

This is very promising. Actually, we'd only need to do that for
pages that are currently skipped in invalidate_inode_pages. Have
to think about possible interactions now...

-- 
Daniel
-
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/



This archive was generated by hypermail 2b29 : Sun Sep 15 2002 - 22:00:31 EST