static inline pgd_t*
pgd_alloc_one_fast (struct mm_struct *mm)
{
- unsigned long *ret = pgd_quicklist;
+ 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 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();
}
static inline void
static inline pmd_t*
pmd_alloc_one_fast (struct mm_struct *mm, unsigned long addr)
{
- unsigned long *ret = (unsigned long *)pmd_quicklist;
+ 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 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();
}
#define __pmd_free_tlb(tlb, pmd) pmd_free(pmd)