[PATCH] lazy_mmu_prot_update needs to be aware of huge pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Zhang, Yanmin <yanmin.zhang@xxxxxxxxx>

Function lazy_mmu_prot_update is also used on huge pages when it is called
by set_huge_ptep_writable, but it isn’t aware of huge pages.

The patch against 2.6.16-rc4 fixes it. Thank Ken for good suggestions.

Signed-off-by: Zhang Yanmin <yanmin.zhang@xxxxxxxxx> 

---

diff -Nraup linux-2.6.16-rc4/arch/ia64/mm/init.c linux-2.6.16-rc4_lazy_mmu/arch/ia64/mm/init.c
--- linux-2.6.16-rc4/arch/ia64/mm/init.c	2006-02-22 19:19:02.000000000 +0800
+++ linux-2.6.16-rc4_lazy_mmu/arch/ia64/mm/init.c	2006-02-23 18:29:00.000000000 +0800
@@ -109,6 +109,7 @@ lazy_mmu_prot_update (pte_t pte)
 {
 	unsigned long addr;
 	struct page *page;
+	unsigned long order;
 
 	if (!pte_exec(pte))
 		return;				/* not an executable page... */
@@ -119,7 +120,12 @@ lazy_mmu_prot_update (pte_t pte)
 	if (test_bit(PG_arch_1, &page->flags))
 		return;				/* i-cache is already coherent with d-cache */
 
-	flush_icache_range(addr, addr + PAGE_SIZE);
+	if (PageCompound(page)) {
+		order = (unsigned long) (page[1].lru.prev);
+		flush_icache_range(addr, addr + (1UL << order << PAGE_SHIFT));
+	}
+	else
+		flush_icache_range(addr, addr + PAGE_SIZE);
 	set_bit(PG_arch_1, &page->flags);	/* mark page as clean */
 }
 


-
: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Sparc Linux]     [DCCP]     [Linux ARM]     [Yosemite News]     [Linux SCSI]     [Linux x86_64]     [Linux for Ham Radio]

  Powered by Linux