From: NIIBE Y. <gn...@m1...> - 2002-03-22 02:46:02
|
Other follow-up to 2.5.5. 2002-03-22 NIIBE Yutaka <gn...@m1...> * arch/sh/kernel/process.c (cpu_idle): Don't call check_pgt_cache. * include/asm-sh/pgalloc.h (pmd_populate_kernel): Renemed from pmd_populate. (pmd_populate): New function for U0 page. (do_check_pgt_cache): Removed. (pmd_free_slow, pmd_free_fast): Removed. (pmd_alloc_one_fast): Removed. (pte_free_slow): Renamed to pte_free. Macro removed. (pte_alloc_one_fast): Removed. (pte_alloc_one_kernel): New function. (pte_alloc_one): Call schedule_timeout and try again. Index: arch/sh/kernel/process.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/process.c,v retrieving revision 1.6 diff -u -3 -p -r1.6 process.c --- arch/sh/kernel/process.c 19 Mar 2002 23:48:06 -0000 1.6 +++ arch/sh/kernel/process.c 22 Mar 2002 02:42:15 -0000 @@ -55,7 +55,6 @@ void cpu_idle(void *unused) __sti(); } schedule(); - check_pgt_cache(); } } Index: include/asm-sh/pgalloc.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/pgalloc.h,v retrieving revision 1.2 diff -u -3 -p -r1.2 pgalloc.h --- include/asm-sh/pgalloc.h 24 Jan 2002 11:04:15 -0000 1.2 +++ include/asm-sh/pgalloc.h 22 Mar 2002 02:42:15 -0000 @@ -10,9 +10,15 @@ #define pte_quicklist ((unsigned long *)0) #define pgtable_cache_size 0L -#define pmd_populate(mm, pmd, pte) \ +#define pmd_populate_kernel(mm, pmd, pte) \ set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte))) +static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, + struct page *pte) +{ + set_pmd(pmd, __pmd(_PAGE_TABLE + page_to_phys(pte))); +} + /* * Allocate and free page tables. */ @@ -33,43 +39,58 @@ static inline void pgd_free(pgd_t *pgd) kfree(pgd); } -static inline pte_t *pte_alloc_one(struct mm_struct *mm, unsigned long address) +static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { - pte_t *pte = (pte_t *) __get_free_page(GFP_KERNEL); - if (pte) - clear_page(pte); + int count = 0; + pte_t *pte; + + do { + pte = (pte_t *) __get_free_page(GFP_KERNEL); + if (pte) + clear_page(pte); + else { + current->state = TASK_UNINTERRUPTIBLE; + schedule_timeout(HZ); + } + } while (!pte && (count++ < 10)); return pte; } -static inline pte_t *pte_alloc_one_fast(struct mm_struct *mm, unsigned long address) +static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) { - return 0; + int count = 0; + struct page *pte; + + do { + pte = alloc_pages(GFP_KERNEL, 0); + if (pte) + clear_page(pte); + else { + current->state = TASK_UNINTERRUPTIBLE; + schedule_timeout(HZ); + } + } while (!pte && (count++ < 10)); + return pte; } -static inline void pte_free_slow(pte_t *pte) +static inline void pte_free_kernel(pte_t *pte) { free_page((unsigned long)pte); } -#define pte_free(pte) pte_free_slow(pte) +static inline void pte_free(struct page *pte) +{ + __free_page(pte); +} /* * allocating and freeing a pmd is trivial: the 1-entry pmd is * inside the pgd, so has no extra memory associated with it. */ -static inline void pmd_free(pmd_t * pmd) -{ -} -#define pmd_alloc_one_fast(mm, addr) ({ BUG(); ((pmd_t *)1); }) #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) -#define pmd_free_slow(x) do { } while (0) -#define pmd_free_fast(x) do { } while (0) #define pmd_free(x) do { } while (0) #define pgd_populate(mm, pmd, pte) BUG() - -/* Do nothing */ -static inline int do_check_pgt_cache(int low, int high) { } /* * TLB flushing: |