[PATCH -V2 07/26] powerpc: Add size argument to pgtable_cache_add

Paul Mackerras paulus at samba.org
Wed Mar 13 22:34:12 EST 2013


On Wed, Mar 13, 2013 at 02:55:17PM +0530, Aneesh Kumar K.V wrote:
> Paul Mackerras <paulus at samba.org> writes:
> > NAK to this (and in fact the rest of this patch).
> >
> > If you need twice the size, use the next slot along in pgtable_cache,
> > which will give you the size you need, rather than breaking the
> > relationship between slot index and allocation size.
> 
> That would mean we will have to do 
> 
>  static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
>  {
> -	return kmem_cache_alloc(PGT_CACHE(PMD_INDEX_SIZE),
> +	return kmem_cache_alloc(PGT_CACHE(PMD_INDEX_SIZE + 1),
>  				GFP_KERNEL|__GFP_REPEAT);
>  }
> 
> is that ok ?

I would define a symbol such as PMD_CACHE_INDEX and arrange for that
to be either PMD_INDEX_SIZE or PMD_INDEX_SIZE + 1, as needed, and then
use PGT_CACHE(PMD_CACHE_INDEX) everywhere instead of
PGT_CACHE(PMD_INDEX_SIZE).  If you want, you could also do
PUD_CACHE_INDEX and PGD_CACHE_INDEX for consistency, but it's not
totally necessary.

Paul.


More information about the Linuxppc-dev mailing list