Hugepages demand paging V2 [7/8]: sh64 arch modifications

From: Christoph Lameter
Date: Mon Oct 25 2004 - 21:28:57 EST


Changelog
* Provide huge_update_mmu_cache through update_mmu_cache (which is just counting
the number of calls)
* Extend flush_dcache_page to handle compound pages
* Not build and not tested


Index: linux-2.6.9/include/asm-sh64/pgtable.h
===================================================================
--- linux-2.6.9.orig/include/asm-sh64/pgtable.h 2004-10-21 12:01:24.000000000 -0700
+++ linux-2.6.9/include/asm-sh64/pgtable.h 2004-10-25 14:55:29.000000000 -0700
@@ -462,6 +462,7 @@

extern void update_mmu_cache(struct vm_area_struct * vma,
unsigned long address, pte_t pte);
+#define huge_update_mmu_cache update_mmu_cache

/* Encode and decode a swap entry */
#define __swp_type(x) (((x).val & 3) + (((x).val >> 1) & 0x3c))
Index: linux-2.6.9/arch/sh64/mm/cache.c
===================================================================
--- linux-2.6.9.orig/arch/sh64/mm/cache.c 2004-10-25 15:02:58.000000000 -0700
+++ linux-2.6.9/arch/sh64/mm/cache.c 2004-10-25 15:03:16.000000000 -0700
@@ -990,7 +990,16 @@

void flush_dcache_page(struct page *page)
{
- sh64_dcache_purge_phy_page(page_to_phys(page));
+ if (likely(!PageCompound))
+ sh64_dcache_purge_phy_page(page_to_phys(page));
+ else {
+ int nr;
+
+ page = page->private;
+ nr = 1 << page[1].index;
+ while (nr--)
+ sh64_dcache_purge_phy_page(page_to_phys(page++));
+ }
wmb();
}


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