FW: [PATCH] powerpc/mm: Export HPAGE_SHIFT

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

5 messages, 5 authors, 2009-02-04 · open the first message on its own page

FW: [PATCH] powerpc/mm: Export HPAGE_SHIFT

From: Roland Dreier <hidden>
Date: 2009-02-04 01:09:09

Forwarding Eli's patch below, since PowerPC guys may have missed it.  I
guess the question for Ben et al is whether there is any issue with
exporting HPAGE_SHIFT for modules (can be EXPORT_SYMBOL_GPL if you feel
it's an internal detail).  It would probably make sense to roll this
change into the mlx4 change that Eli alludes to below and merge through
my tree (with ppc maintainer acks of course), rather than splitting this
patch out and introducing cross-tree dependencies (and also separating
the rationale for the change from the change itself).

Thanks,
  Roland


Drivers may want to take advantage of the large pages used for memory obtained
from hugetlbfs. One example is mlx4_ib which can use much less MTT entries (in
the order of HPAGE_SIZE / PAGE_SIZE) when registering such memory, thus scale
significantly better when registering larger memory regions. Other drivers
could also benefit from this.

Signed-off-by: Eli Cohen <redacted>
---
 arch/powerpc/mm/hash_utils_64.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 8d5b475..6cff8c7 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -104,6 +104,7 @@ int mmu_highuser_ssize = MMU_SEGSIZE_256M;
 u16 mmu_slb_size = 64;
 #ifdef CONFIG_HUGETLB_PAGE
 unsigned int HPAGE_SHIFT;
+EXPORT_SYMBOL(HPAGE_SHIFT);
 #endif
 #ifdef CONFIG_PPC_64K_PAGES
 int mmu_ci_restrictions;
-- 
1.6.1

Re: FW: [PATCH] powerpc/mm: Export HPAGE_SHIFT

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2009-02-04 01:51:40

On Tue, 2009-02-03 at 17:08 -0800, Roland Dreier wrote:
Forwarding Eli's patch below, since PowerPC guys may have missed it.  I
guess the question for Ben et al is whether there is any issue with
exporting HPAGE_SHIFT for modules (can be EXPORT_SYMBOL_GPL if you feel
it's an internal detail).  It would probably make sense to roll this
change into the mlx4 change that Eli alludes to below and merge through
my tree (with ppc maintainer acks of course), rather than splitting this
patch out and introducing cross-tree dependencies (and also separating
the rationale for the change from the change itself).

Thanks,
  Roland


Drivers may want to take advantage of the large pages used for memory obtained
from hugetlbfs. One example is mlx4_ib which can use much less MTT entries (in
the order of HPAGE_SIZE / PAGE_SIZE) when registering such memory, thus scale
significantly better when registering larger memory regions. Other drivers
could also benefit from this.
Except that we support multiple large page sizes nowadays ... I think
the size can be specified per mountpoint of hugetlbfs no ? Thus things
like mellanox would have to query the page size used for a given
mapping.

Do the generic hugetlbfs code provides such an API ? If not, we may need
to add one.

Cheers,
Ben.
quoted hunk
Signed-off-by: Eli Cohen <redacted>
---
 arch/powerpc/mm/hash_utils_64.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 8d5b475..6cff8c7 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -104,6 +104,7 @@ int mmu_highuser_ssize = MMU_SEGSIZE_256M;
 u16 mmu_slb_size = 64;
 #ifdef CONFIG_HUGETLB_PAGE
 unsigned int HPAGE_SHIFT;
+EXPORT_SYMBOL(HPAGE_SHIFT);
 #endif
 #ifdef CONFIG_PPC_64K_PAGES
 int mmu_ci_restrictions;

Re: FW: [PATCH] powerpc/mm: Export HPAGE_SHIFT

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2009-02-04 05:14:29

On Wed, 04 Feb 2009 12:50:48 +1100 Benjamin Herrenschmidt [off-list ref] wrote:
On Tue, 2009-02-03 at 17:08 -0800, Roland Dreier wrote:
quoted
Forwarding Eli's patch below, since PowerPC guys may have missed it.  I
guess the question for Ben et al is whether there is any issue with
exporting HPAGE_SHIFT for modules (can be EXPORT_SYMBOL_GPL if you feel
it's an internal detail).  It would probably make sense to roll this
change into the mlx4 change that Eli alludes to below and merge through
my tree (with ppc maintainer acks of course), rather than splitting this
patch out and introducing cross-tree dependencies (and also separating
the rationale for the change from the change itself).

Thanks,
  Roland


Drivers may want to take advantage of the large pages used for memory obtained
from hugetlbfs. One example is mlx4_ib which can use much less MTT entries (in
the order of HPAGE_SIZE / PAGE_SIZE) when registering such memory, thus scale
significantly better when registering larger memory regions. Other drivers
could also benefit from this.
Except that we support multiple large page sizes nowadays ... I think
the size can be specified per mountpoint of hugetlbfs no ? Thus things
like mellanox would have to query the page size used for a given
mapping.

Do the generic hugetlbfs code provides such an API ? If not, we may need
to add one.
I think it's something like

	huge_page_size(page_hstate(page))

Re: FW: [PATCH] powerpc/mm: Export HPAGE_SHIFT

From: Nick Piggin <hidden>
Date: 2009-02-04 05:32:19

On Wednesday 04 February 2009 16:13:29 Andrew Morton wrote:
On Wed, 04 Feb 2009 12:50:48 +1100 Benjamin Herrenschmidt 
quoted
Do the generic hugetlbfs code provides such an API ? If not, we may need
to add one.
I think it's something like

	huge_page_size(page_hstate(page))
That would work if you have a page, yes. If you want to query which hugepage
sizes are available, then you probably want for_each_hstate() (which is only
within mm/hugetlb.c at the moment, but I have no objections to exporting it
and symbols it requires).

Re: FW: [PATCH] powerpc/mm: Export HPAGE_SHIFT

From: <hidden>
Date: 2009-02-04 06:18:35

On Wed, 04 Feb 2009 12:50:48 +1100 Benjamin Herrenschmidt 
quoted
quoted
Do the generic hugetlbfs code provides such an API ? If not, we may need
to add one.
On Wednesday 04 February 2009 16:13:29 Andrew Morton wrote:
quoted
I think it's something like
	huge_page_size(page_hstate(page))
On Wed, Feb 04, 2009 at 04:31:38PM +1100, Nick Piggin wrote:
That would work if you have a page, yes. If you want to query which hugepage
sizes are available, then you probably want for_each_hstate() (which is only
within mm/hugetlb.c at the moment, but I have no objections to exporting it
and symbols it requires).
Exciting things have happened in mm/hugetlb.c while I was out sick.
I've got quite some catching up to do.


-- wli
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help