* [patch 1/1] powerpc: hugetlb pgtable cache access cleanup
@ 2008-10-29 21:18 akpm
2008-10-29 23:35 ` David Gibson
2008-10-30 2:03 ` Paul Mackerras
0 siblings, 2 replies; 3+ messages in thread
From: akpm @ 2008-10-29 21:18 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev, akpm, kniht, nickpiggin
From: Jon Tollefson <kniht@linux.vnet.ibm.com>
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>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
arch/powerpc/mm/hugetlbpage.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff -puN arch/powerpc/mm/hugetlbpage.c~powerpc-hugetlb-pgtable-cache-access-cleanup arch/powerpc/mm/hugetlbpage.c
--- a/arch/powerpc/mm/hugetlbpage.c~powerpc-hugetlb-pgtable-cache-access-cleanup
+++ a/arch/powerpc/mm/hugetlbpage.c
@@ -53,8 +53,7 @@ unsigned int mmu_huge_psizes[MMU_PAGE_CO
/* 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(huge
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 @@ static int __hugepte_alloc(struct mm_str
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);
@@ -760,13 +759,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,
- 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] 3+ messages in thread
* Re: [patch 1/1] powerpc: hugetlb pgtable cache access cleanup
2008-10-29 21:18 [patch 1/1] powerpc: hugetlb pgtable cache access cleanup akpm
@ 2008-10-29 23:35 ` David Gibson
2008-10-30 2:03 ` Paul Mackerras
1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2008-10-29 23:35 UTC (permalink / raw)
To: akpm; +Cc: linuxppc-dev, kniht, paulus, nickpiggin
On Wed, Oct 29, 2008 at 02:18:30PM -0700, akpm@linux-foundation.org wrote:
> From: Jon Tollefson <kniht@linux.vnet.ibm.com>
>
> 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>
> Cc: Nick Piggin <nickpiggin@yahoo.com.au>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Well, I'm not entirely sure I see the point. But I don't see anything
broken about it.
Acked-by: David Gibson <david@gibson.dropbear.id.au>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch 1/1] powerpc: hugetlb pgtable cache access cleanup
2008-10-29 21:18 [patch 1/1] powerpc: hugetlb pgtable cache access cleanup akpm
2008-10-29 23:35 ` David Gibson
@ 2008-10-30 2:03 ` Paul Mackerras
1 sibling, 0 replies; 3+ messages in thread
From: Paul Mackerras @ 2008-10-30 2:03 UTC (permalink / raw)
To: akpm; +Cc: linuxppc-dev, kniht, nickpiggin
akpm@linux-foundation.org writes:
> From: Jon Tollefson <kniht@linux.vnet.ibm.com>
>
> 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>
> Cc: Nick Piggin <nickpiggin@yahoo.com.au>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
As David Gibson noted, the patch description fails to tell us why this
is a good thing to do (and it isn't immediately obvious to me why it
would be good to make this change). Jon, please resubmit with a
description that includes the motivation for the change.
Paul.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-10-30 2:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-29 21:18 [patch 1/1] powerpc: hugetlb pgtable cache access cleanup akpm
2008-10-29 23:35 ` David Gibson
2008-10-30 2:03 ` Paul Mackerras
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).