lkml.org 
[lkml]   [2008]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subjectmm/hugetlb: Don't crash when HPAGE_SHIFT is 0
From
Date
Some platform decide whether they support huge pages at boot
time. On these, such as powerpc, HPAGE_SHIFT is a variable, not
a constant, and is set to 0 when there is no such support.

The patches to introduce multiple huge pages support broke that
causing the kernel to crash at boot time on machines such as
POWER3 which lack support for multiple page sizes.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

Please apply upstream ASAP.

(resent with more useful mailing list address)

Index: linux-work/mm/hugetlb.c
===================================================================
--- linux-work.orig/mm/hugetlb.c 2008-07-31 15:28:03.000000000 +1000
+++ linux-work/mm/hugetlb.c 2008-07-31 15:31:29.000000000 +1000
@@ -1283,7 +1283,12 @@ module_exit(hugetlb_exit);

static int __init hugetlb_init(void)
{
- BUILD_BUG_ON(HPAGE_SHIFT == 0);
+ /* Some platform decide whether they support huge pages at boot
+ * time. On these, such as powerpc, HPAGE_SHIFT is set to 0 when
+ * there is no such support
+ */
+ if (HPAGE_SHIFT == 0)
+ return 0;

if (!size_to_hstate(default_hstate_size)) {
default_hstate_size = HPAGE_SIZE;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2008-07-31 08:07    [W:0.021 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site