* [patch] powerpc: hugetlb pgtable cache access cleanup [not found] ` <20080604113113.648031825@amd.local0.net> @ 2008-07-14 16:32 ` Jon Tollefson 2008-07-14 22:56 ` Andrew Morton 0 siblings, 1 reply; 4+ messages in thread From: Jon Tollefson @ 2008-07-14 16:32 UTC (permalink / raw) To: npiggin Cc: akpm, Alexey Dobriyan, penberg, mpm, Linux Memory Management List, Linux Kernel Mailing List, cl Cleaned up use of macro. We now reference the pgtable_cache array directly instead of using a macro. Signed-off-by: Jon Tollefson <kniht@linux.vnet.ibm.com> --- arch/powerpc/mm/hugetlbpage.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index fb42c4d..2184fc0 100644 --- a/arch/powerpc/mm/hugetlbpage.c +++ b/arch/powerpc/mm/hugetlbpage.c @@ -53,8 +53,7 @@ unsigned int mmu_huge_psizes[MMU_PAGE_COUNT] = { }; /* initialize all to 0 */ /* Subtract one from array size because we don't need a cache for 4K since * is not a huge page size */ -#define huge_pgtable_cache(psize) (pgtable_cache[HUGEPTE_CACHE_NUM \ - + psize-1]) +#define HUGE_PGTABLE_INDEX(psize) (HUGEPTE_CACHE_NUM + psize - 1) #define HUGEPTE_CACHE_NAME(psize) (huge_pgtable_cache_name[psize]) static const char *huge_pgtable_cache_name[MMU_PAGE_COUNT] = { @@ -113,7 +112,7 @@ static inline pte_t *hugepte_offset(hugepd_t *hpdp, unsigned long addr, static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp, unsigned long address, unsigned int psize) { - pte_t *new = kmem_cache_alloc(huge_pgtable_cache(psize), + pte_t *new = kmem_cache_alloc(pgtable_cache[HUGE_PGTABLE_INDEX(psize)], GFP_KERNEL|__GFP_REPEAT); if (! new) @@ -121,7 +120,7 @@ static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp, spin_lock(&mm->page_table_lock); if (!hugepd_none(*hpdp)) - kmem_cache_free(huge_pgtable_cache(psize), new); + kmem_cache_free(pgtable_cache[HUGE_PGTABLE_INDEX(psize)], new); else hpdp->pd = (unsigned long)new | HUGEPD_OK; spin_unlock(&mm->page_table_lock); @@ -751,13 +750,14 @@ static int __init hugetlbpage_init(void) for (psize = 0; psize < MMU_PAGE_COUNT; ++psize) { if (mmu_huge_psizes[psize]) { - huge_pgtable_cache(psize) = kmem_cache_create( - HUGEPTE_CACHE_NAME(psize), - HUGEPTE_TABLE_SIZE(psize), - HUGEPTE_TABLE_SIZE(psize), - 0, - zero_ctor); - if (!huge_pgtable_cache(psize)) + pgtable_cache[HUGE_PGTABLE_INDEX(psize)] = + kmem_cache_create( + HUGEPTE_CACHE_NAME(psize), + HUGEPTE_TABLE_SIZE(psize), + HUGEPTE_TABLE_SIZE(psize), + 0, + zero_ctor); + if (!pgtable_cache[HUGE_PGTABLE_INDEX(psize)]) panic("hugetlbpage_init(): could not create %s"\ "\n", HUGEPTE_CACHE_NAME(psize)); } ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [patch] powerpc: hugetlb pgtable cache access cleanup 2008-07-14 16:32 ` [patch] powerpc: hugetlb pgtable cache access cleanup Jon Tollefson @ 2008-07-14 22:56 ` Andrew Morton 2008-07-15 22:49 ` [patch v2] " Jon Tollefson 0 siblings, 1 reply; 4+ messages in thread From: Andrew Morton @ 2008-07-14 22:56 UTC (permalink / raw) To: Jon Tollefson Cc: npiggin, adobriyan, penberg, mpm, linux-mm, linux-kernel, cl On Mon, 14 Jul 2008 11:32:22 -0500 Jon Tollefson <kniht@linux.vnet.ibm.com> wrote: > Cleaned up use of macro. We now reference the pgtable_cache array directly instead of using a macro. This clashes rather a lot with all the other hugetlb things which we have queued. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [patch v2] powerpc: hugetlb pgtable cache access cleanup 2008-07-14 22:56 ` Andrew Morton @ 2008-07-15 22:49 ` Jon Tollefson 2008-07-15 22:57 ` Andrew Morton 0 siblings, 1 reply; 4+ messages in thread From: Jon Tollefson @ 2008-07-15 22:49 UTC (permalink / raw) To: Andrew Morton Cc: npiggin, adobriyan, penberg, mpm, linux-mm, linux-kernel, cl Andrew Morton wrote: > On Mon, 14 Jul 2008 11:32:22 -0500 > Jon Tollefson <kniht@linux.vnet.ibm.com> wrote: > > >> Cleaned up use of macro. We now reference the pgtable_cache array directly instead of using a macro. >> > > This clashes rather a lot with all the other hugetlb things which we > have queued. > > oops. new version below here should be based on mmotm. --- Cleaned up use of macro. We now reference the pgtable_cache array directly instead of using a macro. Signed-off-by: Jon Tollefson <kniht@linux.vnet.ibm.com> --- arch/powerpc/mm/hugetlbpage.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) --- a/arch/powerpc/mm/hugetlbpage.c 2008-07-15 17:17:42.741035616 -0500 +++ b/arch/powerpc/mm/hugetlbpage.c 2008-07-15 17:36:48.959015872 -0500 @@ -53,8 +53,7 @@ /* Subtract one from array size because we don't need a cache for 4K since * is not a huge page size */ -#define huge_pgtable_cache(psize) (pgtable_cache[HUGEPTE_CACHE_NUM \ - + psize-1]) +#define HUGE_PGTABLE_INDEX(psize) (HUGEPTE_CACHE_NUM + psize - 1) #define HUGEPTE_CACHE_NAME(psize) (huge_pgtable_cache_name[psize]) static const char *huge_pgtable_cache_name[MMU_PAGE_COUNT] = { @@ -113,7 +112,7 @@ static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp, unsigned long address, unsigned int psize) { - pte_t *new = kmem_cache_zalloc(huge_pgtable_cache(psize), + pte_t *new = kmem_cache_zalloc(pgtable_cache[HUGE_PGTABLE_INDEX(psize)], GFP_KERNEL|__GFP_REPEAT); if (! new) @@ -121,7 +120,7 @@ spin_lock(&mm->page_table_lock); if (!hugepd_none(*hpdp)) - kmem_cache_free(huge_pgtable_cache(psize), new); + kmem_cache_free(pgtable_cache[HUGE_PGTABLE_INDEX(psize)], new); else hpdp->pd = (unsigned long)new | HUGEPD_OK; spin_unlock(&mm->page_table_lock); @@ -746,13 +745,14 @@ for (psize = 0; psize < MMU_PAGE_COUNT; ++psize) { if (mmu_huge_psizes[psize]) { - huge_pgtable_cache(psize) = kmem_cache_create( - HUGEPTE_CACHE_NAME(psize), - HUGEPTE_TABLE_SIZE(psize), - HUGEPTE_TABLE_SIZE(psize), - 0, - NULL); - if (!huge_pgtable_cache(psize)) + pgtable_cache[HUGE_PGTABLE_INDEX(psize)] = + kmem_cache_create( + HUGEPTE_CACHE_NAME(psize), + HUGEPTE_TABLE_SIZE(psize), + HUGEPTE_TABLE_SIZE(psize), + 0, + NULL); + if (!pgtable_cache[HUGE_PGTABLE_INDEX(psize)]) panic("hugetlbpage_init(): could not create %s"\ "\n", HUGEPTE_CACHE_NAME(psize)); } ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch v2] powerpc: hugetlb pgtable cache access cleanup 2008-07-15 22:49 ` [patch v2] " Jon Tollefson @ 2008-07-15 22:57 ` Andrew Morton 0 siblings, 0 replies; 4+ messages in thread From: Andrew Morton @ 2008-07-15 22:57 UTC (permalink / raw) To: Jon Tollefson Cc: npiggin, adobriyan, penberg, mpm, linux-mm, linux-kernel, cl, Benjamin Herrenschmidt, Stephen Rothwell On Tue, 15 Jul 2008 17:49:38 -0500 Jon Tollefson <kniht@linux.vnet.ibm.com> wrote: > Andrew Morton wrote: > > On Mon, 14 Jul 2008 11:32:22 -0500 > > Jon Tollefson <kniht@linux.vnet.ibm.com> wrote: > > > > > >> Cleaned up use of macro. We now reference the pgtable_cache array directly instead of using a macro. > >> > > > > This clashes rather a lot with all the other hugetlb things which we > > have queued. > > > > > oops. new version below here should be based on mmotm. Yup, thanks. > > > Cleaned up use of macro. We now reference the pgtable_cache array directly instead of using a macro. I queued this after its prerequisites. Once those prerequisites have reached mainline I'll send this patch in to the powerpc maintainers for processing. Unless they ack it and ask me to merge it, which is the least-hassle option. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-07-15 22:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20080604112939.789444496@amd.local0.net>
[not found] ` <20080604113113.648031825@amd.local0.net>
2008-07-14 16:32 ` [patch] powerpc: hugetlb pgtable cache access cleanup Jon Tollefson
2008-07-14 22:56 ` Andrew Morton
2008-07-15 22:49 ` [patch v2] " Jon Tollefson
2008-07-15 22:57 ` Andrew Morton
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox