From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 13 Mar 2013 22:34:12 +1100 From: Paul Mackerras To: "Aneesh Kumar K.V" Subject: Re: [PATCH -V2 07/26] powerpc: Add size argument to pgtable_cache_add Message-ID: <20130313113412.GA29597@iris.ozlabs.ibm.com> References: <1362550227-575-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1362550227-575-8-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <20130313024725.GA21125@iris.ozlabs.ibm.com> <877glbd536.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <877glbd536.fsf@linux.vnet.ibm.com> Cc: linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, Mar 13, 2013 at 02:55:17PM +0530, Aneesh Kumar K.V wrote: > Paul Mackerras 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.