Index: linux-2.6.11/include/asm-ia64/pgalloc.h =================================================================== --- linux-2.6.11.orig/include/asm-ia64/pgalloc.h 2005-03-30 09:54:58.000000000 -0800 +++ linux-2.6.11/include/asm-ia64/pgalloc.h 2005-03-30 15:45:11.000000000 -0800 @@ -22,57 +22,16 @@ #include -/* - * Very stupidly, we used to get new pgd's and pmd's, init their contents - * to point to the NULL versions of the next level page table, later on - * completely re-init them the same way, then free them up. This wasted - * a lot of work and caused unnecessary memory traffic. How broken... - * We fix this by caching them. - */ -#define pgd_quicklist (local_cpu_data->pgd_quick) -#define pmd_quicklist (local_cpu_data->pmd_quick) -#define pgtable_cache_size (local_cpu_data->pgtable_cache_sz) - -static inline pgd_t* -pgd_alloc_one_fast (struct mm_struct *mm) -{ - unsigned long *ret = NULL; - - preempt_disable(); - - ret = pgd_quicklist; - if (likely(ret != NULL)) { - pgd_quicklist = (unsigned long *)(*ret); - ret[0] = 0; - --pgtable_cache_size; - } else - ret = NULL; - - preempt_enable(); - - return (pgd_t *) ret; -} - static inline pgd_t* pgd_alloc (struct mm_struct *mm) { - /* the VM system never calls pgd_alloc_one_fast(), so we do it here. */ - pgd_t *pgd = pgd_alloc_one_fast(mm); - - if (unlikely(pgd == NULL)) { - pgd = (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO); - } - return pgd; + return (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO); } static inline void pgd_free (pgd_t *pgd) { - preempt_disable(); - *(unsigned long *)pgd = (unsigned long) pgd_quicklist; - pgd_quicklist = (unsigned long *) pgd; - ++pgtable_cache_size; - preempt_enable(); + free_hot_zeroed_page(virt_to_page(pgd)); } static inline void @@ -82,25 +41,6 @@ pud_populate (struct mm_struct *mm, pud_ } static inline pmd_t* -pmd_alloc_one_fast (struct mm_struct *mm, unsigned long addr) -{ - unsigned long *ret = NULL; - - preempt_disable(); - - ret = (unsigned long *)pmd_quicklist; - if (likely(ret != NULL)) { - pmd_quicklist = (unsigned long *)(*ret); - ret[0] = 0; - --pgtable_cache_size; - } - - preempt_enable(); - - return (pmd_t *)ret; -} - -static inline pmd_t* pmd_alloc_one (struct mm_struct *mm, unsigned long addr) { pmd_t *pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); @@ -111,11 +51,7 @@ pmd_alloc_one (struct mm_struct *mm, uns static inline void pmd_free (pmd_t *pmd) { - preempt_disable(); - *(unsigned long *)pmd = (unsigned long) pmd_quicklist; - pmd_quicklist = (unsigned long *) pmd; - ++pgtable_cache_size; - preempt_enable(); + free_hot_zeroed_page(virt_to_page(pmd)); } #define __pmd_free_tlb(tlb, pmd) pmd_free(pmd) @@ -162,6 +98,4 @@ pte_free_kernel (pte_t *pte) #define __pte_free_tlb(tlb, pte) tlb_remove_page((tlb), (pte)) -extern void check_pgt_cache (void); - #endif /* _ASM_IA64_PGALLOC_H */ Index: linux-2.6.11/include/asm-ia64/processor.h =================================================================== --- linux-2.6.11.orig/include/asm-ia64/processor.h 2005-03-01 23:37:58.000000000 -0800 +++ linux-2.6.11/include/asm-ia64/processor.h 2005-03-30 15:45:11.000000000 -0800 @@ -145,8 +145,6 @@ struct cpuinfo_ia64 { __u64 nsec_per_cyc; /* (1000000000< (u64) high) { - do { - if (pgd_quicklist) - free_page((unsigned long)pgd_alloc_one_fast(NULL)); - if (pmd_quicklist) - free_page((unsigned long)pmd_alloc_one_fast(NULL, 0)); - } while (pgtable_cache_size > (u64) low); - } - preempt_enable(); -} - -void lazy_mmu_prot_update (pte_t pte) { unsigned long addr; Index: linux-2.6.11/include/asm-ia64/tlb.h =================================================================== --- linux-2.6.11.orig/include/asm-ia64/tlb.h 2005-03-30 09:54:58.000000000 -0800 +++ linux-2.6.11/include/asm-ia64/tlb.h 2005-03-30 15:45:11.000000000 -0800 @@ -171,9 +171,6 @@ tlb_finish_mmu (struct mmu_gather *tlb, * tlb->end_addr. */ ia64_tlb_flush_mmu(tlb, start, end); - - /* keep the page table cache within bounds */ - check_pgt_cache(); } static inline unsigned int Index: linux-2.6.11/arch/ia64/kernel/process.c =================================================================== --- linux-2.6.11.orig/arch/ia64/kernel/process.c 2005-03-01 23:38:08.000000000 -0800 +++ linux-2.6.11/arch/ia64/kernel/process.c 2005-03-30 15:49:33.000000000 -0800 @@ -280,7 +280,6 @@ cpu_idle (void) normal_xtp(); #endif schedule(); - check_pgt_cache(); if (cpu_is_offline(smp_processor_id())) play_dead(); }