Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56319
b: refs/heads/master
c: f1d1a84
h: refs/heads/master
i:
  56317: d0fa070
  56315: cc14d97
  56311: 544f854
  56303: 43836a7
  56287: 3299f03
  56255: 9d99402
  56191: 94a04c7
  56063: 88196c3
  55807: d3f5cf8
  55295: 2e7066a
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed May 12, 2007
1 parent f3941fc commit 9c4eda5
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8df767dd759c1390f604814ee5b2d1489f9a59f7
refs/heads/master: f1d1a842d85acf34dd185027cb2c9b4fd13130ef
8 changes: 4 additions & 4 deletions trunk/arch/i386/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ config ZONE_DMA
bool
default y

config QUICKLIST
bool
default y

config SBUS
bool

Expand All @@ -79,10 +83,6 @@ config ARCH_MAY_HAVE_PC_FDC
bool
default y

config ARCH_USES_SLAB_PAGE_STRUCT
bool
default y

config DMI
bool
default y
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/i386/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ void cpu_idle(void)
if (__get_cpu_var(cpu_idle_state))
__get_cpu_var(cpu_idle_state) = 0;

check_pgt_cache();
rmb();
idle = pm_idle;

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/i386/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ void flush_tlb_mm (struct mm_struct * mm)
}
if (!cpus_empty(cpu_mask))
flush_tlb_others(cpu_mask, mm, TLB_FLUSH_ALL);

check_pgt_cache();
preempt_enable();
}

Expand Down
7 changes: 0 additions & 7 deletions trunk/arch/i386/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,6 @@ int remove_memory(u64 start, u64 size)
EXPORT_SYMBOL_GPL(remove_memory);
#endif

struct kmem_cache *pgd_cache;
struct kmem_cache *pmd_cache;

void __init pgtable_cache_init(void)
Expand All @@ -764,12 +763,6 @@ void __init pgtable_cache_init(void)
pgd_size = PAGE_SIZE;
}
}
pgd_cache = kmem_cache_create("pgd",
pgd_size,
pgd_size,
SLAB_PANIC,
pgd_ctor,
(!SHARED_KERNEL_PMD) ? pgd_dtor : NULL);
}

/*
Expand Down
26 changes: 17 additions & 9 deletions trunk/arch/i386/mm/pgtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/pagemap.h>
#include <linux/spinlock.h>
#include <linux/module.h>
#include <linux/quicklist.h>

#include <asm/system.h>
#include <asm/pgtable.h>
Expand Down Expand Up @@ -205,8 +206,6 @@ void pmd_ctor(void *pmd, struct kmem_cache *cache, unsigned long flags)
* against pageattr.c; it is the unique case in which a valid change
* of kernel pagetables can't be lazily synchronized by vmalloc faults.
* vmalloc faults work because attached pagetables are never freed.
* The locking scheme was chosen on the basis of manfred's
* recommendations and having no core impact whatsoever.
* -- wli
*/
DEFINE_SPINLOCK(pgd_lock);
Expand All @@ -232,9 +231,11 @@ static inline void pgd_list_del(pgd_t *pgd)
set_page_private(next, (unsigned long)pprev);
}



#if (PTRS_PER_PMD == 1)
/* Non-PAE pgd constructor */
void pgd_ctor(void *pgd, struct kmem_cache *cache, unsigned long unused)
void pgd_ctor(void *pgd)
{
unsigned long flags;

Expand All @@ -256,7 +257,7 @@ void pgd_ctor(void *pgd, struct kmem_cache *cache, unsigned long unused)
}
#else /* PTRS_PER_PMD > 1 */
/* PAE pgd constructor */
void pgd_ctor(void *pgd, struct kmem_cache *cache, unsigned long unused)
void pgd_ctor(void *pgd)
{
/* PAE, kernel PMD may be shared */

Expand All @@ -275,11 +276,12 @@ void pgd_ctor(void *pgd, struct kmem_cache *cache, unsigned long unused)
}
#endif /* PTRS_PER_PMD */

void pgd_dtor(void *pgd, struct kmem_cache *cache, unsigned long unused)
void pgd_dtor(void *pgd)
{
unsigned long flags; /* can be called from interrupt context */

BUG_ON(SHARED_KERNEL_PMD);
if (SHARED_KERNEL_PMD)
return;

paravirt_release_pd(__pa(pgd) >> PAGE_SHIFT);
spin_lock_irqsave(&pgd_lock, flags);
Expand Down Expand Up @@ -321,7 +323,7 @@ static void pmd_cache_free(pmd_t *pmd, int idx)
pgd_t *pgd_alloc(struct mm_struct *mm)
{
int i;
pgd_t *pgd = kmem_cache_alloc(pgd_cache, GFP_KERNEL);
pgd_t *pgd = quicklist_alloc(0, GFP_KERNEL, pgd_ctor);

if (PTRS_PER_PMD == 1 || !pgd)
return pgd;
Expand All @@ -344,7 +346,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
paravirt_release_pd(__pa(pmd) >> PAGE_SHIFT);
pmd_cache_free(pmd, i);
}
kmem_cache_free(pgd_cache, pgd);
quicklist_free(0, pgd_dtor, pgd);
return NULL;
}

Expand All @@ -361,5 +363,11 @@ void pgd_free(pgd_t *pgd)
pmd_cache_free(pmd, i);
}
/* in the non-PAE case, free_pgtables() clears user pgd entries */
kmem_cache_free(pgd_cache, pgd);
quicklist_free(0, pgd_dtor, pgd);
}

void check_pgt_cache(void)
{
quicklist_trim(0, pgd_dtor, 25, 16);
}

2 changes: 0 additions & 2 deletions trunk/include/asm-i386/pgalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,4 @@ do { \
#define pud_populate(mm, pmd, pte) BUG()
#endif

#define check_pgt_cache() do { } while (0)

#endif /* _I386_PGALLOC_H */
5 changes: 2 additions & 3 deletions trunk/include/asm-i386/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,16 @@ struct vm_area_struct;
#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
extern unsigned long empty_zero_page[1024];
extern pgd_t swapper_pg_dir[1024];
extern struct kmem_cache *pgd_cache;
extern struct kmem_cache *pmd_cache;
extern spinlock_t pgd_lock;
extern struct page *pgd_list;
void check_pgt_cache(void);

void pmd_ctor(void *, struct kmem_cache *, unsigned long);
void pgd_ctor(void *, struct kmem_cache *, unsigned long);
void pgd_dtor(void *, struct kmem_cache *, unsigned long);
void pgtable_cache_init(void);
void paging_init(void);


/*
* The Linux x86 paging architecture is 'compile-time dual-mode', it
* implements both the traditional 2-level x86 page tables and the
Expand Down

0 comments on commit 9c4eda5

Please sign in to comment.