Messages in this thread | | | Date | Wed, 13 Jul 2011 15:31:52 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH 1/4] sparc64: Kill page table quicklists. |
| |
On Tue, 12 Jul 2011 14:26:09 +0200 Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> --- linux-2.6.orig/arch/sparc/mm/tsb.c > +++ linux-2.6/arch/sparc/mm/tsb.c > @@ -236,6 +236,8 @@ static void setup_tsb_params(struct mm_s > } > } > > +struct kmem_cache *pgtable_cache __read_mostly; > + > static struct kmem_cache *tsb_caches[8] __read_mostly; > > static const char *tsb_cache_names[8] = { > @@ -253,6 +255,15 @@ void __init pgtable_cache_init(void) > { > unsigned long i; > > + pgtable_cache = kmem_cache_create("pgtable_cache", > + PAGE_SIZE, PAGE_SIZE, > + 0, > + _clear_page);
The use of slab constructors is often dubious from a cache usage POV. But the lifecycle of a page-table page might well be that it slowly gets non-zeroes written into it and then slowly gets zeroes written into it until it is all-zeroes and then we free it up. And often only a subset of the page will ever be written.
So it could be that the slab constructor behaviour is a good match here. And not just for sparc!
Did such thinking and/or any testing go into this decision?
> + if (!pgtable_cache) { > + prom_printf("pgtable_cache_init(): Could not create!\n"); > + prom_halt(); > + } > +
| |