Re: [RFC] Distributed mmap API

From: Daniel Phillips
Date: Wed Feb 25 2004 - 18:02:06 EST


On Wednesday 25 February 2004 17:16, Andrew Morton wrote:
> > but how can we legitimately get !pfn_valid there?
>
> A mapping of some I/O region?

With MAP_PRIVATE, on a distributed filesystem? OK...

Can we recognize those I/O vmas and handle them with their own separate loop,
saving a few cycles for the common case? Or just:

if (pte_present(pte)) {
unsigned long pfn = pte_pfn(pte);
struct page *page;
if (unlikely(!pfn_valid(pfn))) {
ptep_get_and_clear(ptep);
tlb_remove_tlb_entry(tlb, ptep, address+offset);
continue;
}
page = pfn_to_page(pfn);
if (unlikely(!all) && is_anon(page))
continue;
pte = ptep_get_and_clear(ptep); /* get dirty bit atomically */
tlb_remove_tlb_entry(tlb, ptep, address+offset);
if (PageReserved(page))
continue;
if (pte_dirty(pte))
set_page_dirty(page);
if (page->mapping && pte_young(pte) && !PageSwapCache(page))
mark_page_accessed(page);
tlb->freed++;
page_remove_rmap(page, ptep);
tlb_remove_page(tlb, page);
} else {

Regards,

Daniel

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