* [PATCH] hugetlb: call arch_prepare_hugepage() for surplus pages
@ 2008-08-05 15:29 ` Gerald Schaefer
0 siblings, 0 replies; 10+ messages in thread
From: Gerald Schaefer, Gerald Schaefer @ 2008-08-05 15:29 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, linux-mm, linux-s390, schwidefsky, heiko.carstens,
Nishanth Aravamudan, Adam Litke
The s390 software large page emulation implements shared page tables
by using page->index of the first tail page from a compound large page
to store page table information. This is set up in arch_prepare_hugepage(),
which is called from alloc_fresh_huge_page_node().
A similar call to arch_prepare_hugepage() is missing for surplus large
pages that are allocated in alloc_buddy_huge_page(), which breaks the
software emulation mode for (surplus) large pages on s390. This patch
adds the missing call to arch_prepare_hugepage(). It will have no effect
on other architectures where arch_prepare_hugepage() is a nop.
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
---
mm/hugetlb.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Index: linux/mm/hugetlb.c
===================================================================
--- linux.orig/mm/hugetlb.c
+++ linux/mm/hugetlb.c
@@ -565,7 +565,7 @@ static struct page *alloc_fresh_huge_pag
huge_page_order(h));
if (page) {
if (arch_prepare_hugepage(page)) {
- __free_pages(page, HUGETLB_PAGE_ORDER);
+ __free_pages(page, huge_page_order(h));
return NULL;
}
prep_new_huge_page(h, page, nid);
@@ -665,6 +665,11 @@ static struct page *alloc_buddy_huge_pag
__GFP_REPEAT|__GFP_NOWARN,
huge_page_order(h));
+ if (page && arch_prepare_hugepage(page)) {
+ __free_pages(page, huge_page_order(h));
+ return NULL;
+ }
+
spin_lock(&hugetlb_lock);
if (page) {
/*
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] hugetlb: call arch_prepare_hugepage() for surplus pages
@ 2008-08-05 15:29 ` Gerald Schaefer
0 siblings, 0 replies; 10+ messages in thread
From: Gerald Schaefer @ 2008-08-05 15:29 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, linux-mm, linux-s390, schwidefsky, heiko.carstens,
Nishanth Aravamudan, Adam Litke
From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
The s390 software large page emulation implements shared page tables
by using page->index of the first tail page from a compound large page
to store page table information. This is set up in arch_prepare_hugepage(),
which is called from alloc_fresh_huge_page_node().
A similar call to arch_prepare_hugepage() is missing for surplus large
pages that are allocated in alloc_buddy_huge_page(), which breaks the
software emulation mode for (surplus) large pages on s390. This patch
adds the missing call to arch_prepare_hugepage(). It will have no effect
on other architectures where arch_prepare_hugepage() is a nop.
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
---
mm/hugetlb.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Index: linux/mm/hugetlb.c
===================================================================
--- linux.orig/mm/hugetlb.c
+++ linux/mm/hugetlb.c
@@ -565,7 +565,7 @@ static struct page *alloc_fresh_huge_pag
huge_page_order(h));
if (page) {
if (arch_prepare_hugepage(page)) {
- __free_pages(page, HUGETLB_PAGE_ORDER);
+ __free_pages(page, huge_page_order(h));
return NULL;
}
prep_new_huge_page(h, page, nid);
@@ -665,6 +665,11 @@ static struct page *alloc_buddy_huge_pag
__GFP_REPEAT|__GFP_NOWARN,
huge_page_order(h));
+ if (page && arch_prepare_hugepage(page)) {
+ __free_pages(page, huge_page_order(h));
+ return NULL;
+ }
+
spin_lock(&hugetlb_lock);
if (page) {
/*
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] hugetlb: call arch_prepare_hugepage() for surplus pages
2008-08-05 15:29 ` Gerald Schaefer
@ 2008-08-05 15:36 ` Nick Piggin
-1 siblings, 0 replies; 10+ messages in thread
From: Nick Piggin @ 2008-08-05 15:36 UTC (permalink / raw)
To: Gerald Schaefer
Cc: Andrew Morton, linux-kernel, linux-mm, linux-s390, schwidefsky,
heiko.carstens, Nishanth Aravamudan, Adam Litke
On Wednesday 06 August 2008 01:29, Gerald Schaefer wrote:
> From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
>
> The s390 software large page emulation implements shared page tables
> by using page->index of the first tail page from a compound large page
> to store page table information. This is set up in arch_prepare_hugepage(),
> which is called from alloc_fresh_huge_page_node().
>
> A similar call to arch_prepare_hugepage() is missing for surplus large
> pages that are allocated in alloc_buddy_huge_page(), which breaks the
> software emulation mode for (surplus) large pages on s390. This patch
> adds the missing call to arch_prepare_hugepage(). It will have no effect
> on other architectures where arch_prepare_hugepage() is a nop.
>
> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
> ---
>
> mm/hugetlb.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> Index: linux/mm/hugetlb.c
> ===================================================================
> --- linux.orig/mm/hugetlb.c
> +++ linux/mm/hugetlb.c
> @@ -565,7 +565,7 @@ static struct page *alloc_fresh_huge_pag
> huge_page_order(h));
> if (page) {
> if (arch_prepare_hugepage(page)) {
> - __free_pages(page, HUGETLB_PAGE_ORDER);
> + __free_pages(page, huge_page_order(h));
> return NULL;
> }
> prep_new_huge_page(h, page, nid);
This looks like a seperate bugfix?
> @@ -665,6 +665,11 @@ static struct page *alloc_buddy_huge_pag
> __GFP_REPEAT|__GFP_NOWARN,
> huge_page_order(h));
>
> + if (page && arch_prepare_hugepage(page)) {
> + __free_pages(page, huge_page_order(h));
> + return NULL;
> + }
> +
> spin_lock(&hugetlb_lock);
> if (page) {
> /*
Acked-by: Nick Piggin <npiggin@suse.de>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] hugetlb: call arch_prepare_hugepage() for surplus pages
@ 2008-08-05 15:36 ` Nick Piggin
0 siblings, 0 replies; 10+ messages in thread
From: Nick Piggin @ 2008-08-05 15:36 UTC (permalink / raw)
To: Gerald Schaefer
Cc: Andrew Morton, linux-kernel, linux-mm, linux-s390, schwidefsky,
heiko.carstens, Nishanth Aravamudan, Adam Litke
On Wednesday 06 August 2008 01:29, Gerald Schaefer wrote:
> From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
>
> The s390 software large page emulation implements shared page tables
> by using page->index of the first tail page from a compound large page
> to store page table information. This is set up in arch_prepare_hugepage(),
> which is called from alloc_fresh_huge_page_node().
>
> A similar call to arch_prepare_hugepage() is missing for surplus large
> pages that are allocated in alloc_buddy_huge_page(), which breaks the
> software emulation mode for (surplus) large pages on s390. This patch
> adds the missing call to arch_prepare_hugepage(). It will have no effect
> on other architectures where arch_prepare_hugepage() is a nop.
>
> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
> ---
>
> mm/hugetlb.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> Index: linux/mm/hugetlb.c
> ===================================================================
> --- linux.orig/mm/hugetlb.c
> +++ linux/mm/hugetlb.c
> @@ -565,7 +565,7 @@ static struct page *alloc_fresh_huge_pag
> huge_page_order(h));
> if (page) {
> if (arch_prepare_hugepage(page)) {
> - __free_pages(page, HUGETLB_PAGE_ORDER);
> + __free_pages(page, huge_page_order(h));
> return NULL;
> }
> prep_new_huge_page(h, page, nid);
This looks like a seperate bugfix?
> @@ -665,6 +665,11 @@ static struct page *alloc_buddy_huge_pag
> __GFP_REPEAT|__GFP_NOWARN,
> huge_page_order(h));
>
> + if (page && arch_prepare_hugepage(page)) {
> + __free_pages(page, huge_page_order(h));
> + return NULL;
> + }
> +
> spin_lock(&hugetlb_lock);
> if (page) {
> /*
Acked-by: Nick Piggin <npiggin@suse.de>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] hugetlb: call arch_prepare_hugepage() for surplus pages
2008-08-05 15:29 ` Gerald Schaefer
@ 2008-08-05 15:43 ` Adam Litke
-1 siblings, 0 replies; 10+ messages in thread
From: Adam Litke @ 2008-08-05 15:43 UTC (permalink / raw)
To: Gerald Schaefer
Cc: Andrew Morton, linux-kernel, linux-mm, linux-s390, schwidefsky,
heiko.carstens, Nishanth Aravamudan
On Tue, 2008-08-05 at 17:29 +0200, Gerald Schaefer wrote:
> From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
>
> The s390 software large page emulation implements shared page tables
> by using page->index of the first tail page from a compound large page
> to store page table information. This is set up in arch_prepare_hugepage(),
> which is called from alloc_fresh_huge_page_node().
>
> A similar call to arch_prepare_hugepage() is missing for surplus large
> pages that are allocated in alloc_buddy_huge_page(), which breaks the
> software emulation mode for (surplus) large pages on s390. This patch
> adds the missing call to arch_prepare_hugepage(). It will have no effect
> on other architectures where arch_prepare_hugepage() is a nop.
>
> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Seems fine.
Acked-by: Adam Litke <agl@us.ibm.com>
--
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] hugetlb: call arch_prepare_hugepage() for surplus pages
@ 2008-08-05 15:43 ` Adam Litke
0 siblings, 0 replies; 10+ messages in thread
From: Adam Litke @ 2008-08-05 15:43 UTC (permalink / raw)
To: Gerald Schaefer
Cc: Andrew Morton, linux-kernel, linux-mm, linux-s390, schwidefsky,
heiko.carstens, Nishanth Aravamudan
On Tue, 2008-08-05 at 17:29 +0200, Gerald Schaefer wrote:
> From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
>
> The s390 software large page emulation implements shared page tables
> by using page->index of the first tail page from a compound large page
> to store page table information. This is set up in arch_prepare_hugepage(),
> which is called from alloc_fresh_huge_page_node().
>
> A similar call to arch_prepare_hugepage() is missing for surplus large
> pages that are allocated in alloc_buddy_huge_page(), which breaks the
> software emulation mode for (surplus) large pages on s390. This patch
> adds the missing call to arch_prepare_hugepage(). It will have no effect
> on other architectures where arch_prepare_hugepage() is a nop.
>
> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Seems fine.
Acked-by: Adam Litke <agl@us.ibm.com>
--
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] hugetlb: call arch_prepare_hugepage() for surplus pages
2008-08-05 15:29 ` Gerald Schaefer
@ 2008-08-05 20:32 ` Andrew Morton
-1 siblings, 0 replies; 10+ messages in thread
From: Andrew Morton @ 2008-08-05 20:32 UTC (permalink / raw)
To: Gerald Schaefer
Cc: linux-kernel, linux-mm, linux-s390, schwidefsky, heiko.carstens,
nacc, agl
On Tue, 05 Aug 2008 17:29:07 +0200
Gerald Schaefer <gerald.schaefer@de.ibm.com> wrote:
> From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
>
> The s390 software large page emulation implements shared page tables
> by using page->index of the first tail page from a compound large page
> to store page table information. This is set up in arch_prepare_hugepage(),
> which is called from alloc_fresh_huge_page_node().
>
> A similar call to arch_prepare_hugepage() is missing for surplus large
> pages that are allocated in alloc_buddy_huge_page(), which breaks the
> software emulation mode for (surplus) large pages on s390. This patch
> adds the missing call to arch_prepare_hugepage(). It will have no effect
> on other architectures where arch_prepare_hugepage() is a nop.
>
> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
> ---
>
> mm/hugetlb.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> Index: linux/mm/hugetlb.c
> ===================================================================
> --- linux.orig/mm/hugetlb.c
> +++ linux/mm/hugetlb.c
> @@ -565,7 +565,7 @@ static struct page *alloc_fresh_huge_pag
> huge_page_order(h));
> if (page) {
> if (arch_prepare_hugepage(page)) {
> - __free_pages(page, HUGETLB_PAGE_ORDER);
> + __free_pages(page, huge_page_order(h));
As Nick pointed out, this is an unrelated bugfix. I changelogged it.
Really it should have been two patches.
> return NULL;
> }
> prep_new_huge_page(h, page, nid);
> @@ -665,6 +665,11 @@ static struct page *alloc_buddy_huge_pag
> __GFP_REPEAT|__GFP_NOWARN,
> huge_page_order(h));
>
> + if (page && arch_prepare_hugepage(page)) {
> + __free_pages(page, huge_page_order(h));
> + return NULL;
> + }
> +
> spin_lock(&hugetlb_lock);
> if (page) {
> /*
afaict the second fix is needed in 2.6.26.x (but not 2.6.25.x), but
this patch is not applicable to 2.6.26.x.
So if you want this fix to be backported into 2.6.26.x, please send a
suitable version of it to stable@kernel.org.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] hugetlb: call arch_prepare_hugepage() for surplus pages
@ 2008-08-05 20:32 ` Andrew Morton
0 siblings, 0 replies; 10+ messages in thread
From: Andrew Morton @ 2008-08-05 20:32 UTC (permalink / raw)
To: Gerald Schaefer
Cc: linux-kernel, linux-mm, linux-s390, schwidefsky, heiko.carstens,
nacc, agl
On Tue, 05 Aug 2008 17:29:07 +0200
Gerald Schaefer <gerald.schaefer@de.ibm.com> wrote:
> From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
>
> The s390 software large page emulation implements shared page tables
> by using page->index of the first tail page from a compound large page
> to store page table information. This is set up in arch_prepare_hugepage(),
> which is called from alloc_fresh_huge_page_node().
>
> A similar call to arch_prepare_hugepage() is missing for surplus large
> pages that are allocated in alloc_buddy_huge_page(), which breaks the
> software emulation mode for (surplus) large pages on s390. This patch
> adds the missing call to arch_prepare_hugepage(). It will have no effect
> on other architectures where arch_prepare_hugepage() is a nop.
>
> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
> ---
>
> mm/hugetlb.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> Index: linux/mm/hugetlb.c
> ===================================================================
> --- linux.orig/mm/hugetlb.c
> +++ linux/mm/hugetlb.c
> @@ -565,7 +565,7 @@ static struct page *alloc_fresh_huge_pag
> huge_page_order(h));
> if (page) {
> if (arch_prepare_hugepage(page)) {
> - __free_pages(page, HUGETLB_PAGE_ORDER);
> + __free_pages(page, huge_page_order(h));
As Nick pointed out, this is an unrelated bugfix. I changelogged it.
Really it should have been two patches.
> return NULL;
> }
> prep_new_huge_page(h, page, nid);
> @@ -665,6 +665,11 @@ static struct page *alloc_buddy_huge_pag
> __GFP_REPEAT|__GFP_NOWARN,
> huge_page_order(h));
>
> + if (page && arch_prepare_hugepage(page)) {
> + __free_pages(page, huge_page_order(h));
> + return NULL;
> + }
> +
> spin_lock(&hugetlb_lock);
> if (page) {
> /*
afaict the second fix is needed in 2.6.26.x (but not 2.6.25.x), but
this patch is not applicable to 2.6.26.x.
So if you want this fix to be backported into 2.6.26.x, please send a
suitable version of it to stable@kernel.org.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] hugetlb: call arch_prepare_hugepage() for surplus pages
2008-08-05 20:32 ` Andrew Morton
@ 2008-08-06 13:48 ` gerald_IMAP
-1 siblings, 0 replies; 10+ messages in thread
From: gerald_IMAP @ 2008-08-06 13:48 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, linux-mm, linux-s390, schwidefsky, heiko.carstens,
nacc, agl, Nick Piggin
On Tue, 2008-08-05 at 13:32 -0700, Andrew Morton wrote:
> > ---
> >
> > mm/hugetlb.c | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > Index: linux/mm/hugetlb.c
> > ===================================================================
> > --- linux.orig/mm/hugetlb.c
> > +++ linux/mm/hugetlb.c
> > @@ -565,7 +565,7 @@ static struct page *alloc_fresh_huge_pag
> > huge_page_order(h));
> > if (page) {
> > if (arch_prepare_hugepage(page)) {
> > - __free_pages(page, HUGETLB_PAGE_ORDER);
> > + __free_pages(page, huge_page_order(h));
>
> As Nick pointed out, this is an unrelated bugfix. I changelogged it.
> Really it should have been two patches.
Ok, thanks. I didn't see it as a bugfix because it doesn't make any
difference on s390, and nobody else is using arch_prepare_hugepage()
so far. But of course this may change, so I should have made two
patches.
> afaict the second fix is needed in 2.6.26.x (but not 2.6.25.x), but
> this patch is not applicable to 2.6.26.x.
>
> So if you want this fix to be backported into 2.6.26.x, please send a
> suitable version of it to stable@kernel.org.
Right, this was missing from the beginning. It affects s390 only,
so I'll check if we need a backport.
Thanks,
Gerald
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] hugetlb: call arch_prepare_hugepage() for surplus pages
@ 2008-08-06 13:48 ` gerald_IMAP
0 siblings, 0 replies; 10+ messages in thread
From: gerald_IMAP @ 2008-08-06 13:48 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, linux-mm, linux-s390, schwidefsky, heiko.carstens,
nacc, agl, Nick Piggin
On Tue, 2008-08-05 at 13:32 -0700, Andrew Morton wrote:
> > ---
> >
> > mm/hugetlb.c | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > Index: linux/mm/hugetlb.c
> > ===================================================================
> > --- linux.orig/mm/hugetlb.c
> > +++ linux/mm/hugetlb.c
> > @@ -565,7 +565,7 @@ static struct page *alloc_fresh_huge_pag
> > huge_page_order(h));
> > if (page) {
> > if (arch_prepare_hugepage(page)) {
> > - __free_pages(page, HUGETLB_PAGE_ORDER);
> > + __free_pages(page, huge_page_order(h));
>
> As Nick pointed out, this is an unrelated bugfix. I changelogged it.
> Really it should have been two patches.
Ok, thanks. I didn't see it as a bugfix because it doesn't make any
difference on s390, and nobody else is using arch_prepare_hugepage()
so far. But of course this may change, so I should have made two
patches.
> afaict the second fix is needed in 2.6.26.x (but not 2.6.25.x), but
> this patch is not applicable to 2.6.26.x.
>
> So if you want this fix to be backported into 2.6.26.x, please send a
> suitable version of it to stable@kernel.org.
Right, this was missing from the beginning. It affects s390 only,
so I'll check if we need a backport.
Thanks,
Gerald
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-08-06 13:49 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-05 15:29 [PATCH] hugetlb: call arch_prepare_hugepage() for surplus pages Gerald Schaefer, Gerald Schaefer
2008-08-05 15:29 ` Gerald Schaefer
2008-08-05 15:36 ` Nick Piggin
2008-08-05 15:36 ` Nick Piggin
2008-08-05 15:43 ` Adam Litke
2008-08-05 15:43 ` Adam Litke
2008-08-05 20:32 ` Andrew Morton
2008-08-05 20:32 ` Andrew Morton
2008-08-06 13:48 ` gerald_IMAP
2008-08-06 13:48 ` gerald_IMAP
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.