linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jon Tollefson <kniht@linux.vnet.ibm.com>,
	Adam Litke <agl@us.ibm.com>,
	Nishanth Aravamudan <nacc@us.ibm.com>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [patch] hugetlb: override default huge page size non-const fix
Date: Wed, 23 Jul 2008 06:06:44 +0200	[thread overview]
Message-ID: <20080723040644.GA18119@wotan.suse.de> (raw)

Hi,

I revisited the multi-size hugetlb patches, and realised I forgot one small
outstanding issue. Your
hugetlb-override-default-huge-page-size-ia64-build.patch
fix basically disallows overriding of the default hugetlb size, because we
always set the default back to HPAGE_SIZE.

A better fix I think is just to initialize the default_hstate_size to an
invalid value, which the init code checks for and reverts to HPAGE_SIZE
anyway. So please replace that patch with this one.

Overriding of the default hugepage size is not of major importance, but it
can allow legacy code (providing it is well written), including the hugetlb
regression suite to be run with different hugepage sizes (so actually it is
quite important for developers at least).

I don't have access to such a machine, but I hope (with this patch), the
powerpc developers can run the libhugetlb regression suite one last time
against a range of page sizes and ensure the results look reasonable.

Thanks,
Nick

--

If HPAGE_SIZE is not constant (eg. on ia64), then the initialiser does not
work. Fix this by making default_hstate_size == 0, then if it isn't set
from the cmdline, hugetlb_init will still do the right thing and set up the
default hstate as (the now initialized) HPAGE_SIZE.

Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/mm/hugetlb.c
===================================================================
--- linux-2.6.orig/mm/hugetlb.c
+++ linux-2.6/mm/hugetlb.c
@@ -34,7 +34,7 @@ struct hstate hstates[HUGE_MAX_HSTATE];
 /* for command line parsing */
 static struct hstate * __initdata parsed_hstate;
 static unsigned long __initdata default_hstate_max_huge_pages;
-static unsigned long __initdata default_hstate_size = HPAGE_SIZE;
+static unsigned long __initdata default_hstate_size = 0;
 
 #define for_each_hstate(h) \
 	for ((h) = hstates; (h) < &hstates[max_hstate]; (h)++)

--
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>

             reply	other threads:[~2008-07-23  4:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-23  4:06 Nick Piggin [this message]
2008-07-24  7:29 ` Jon Tollefson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080723040644.GA18119@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=agl@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=kniht@linux.vnet.ibm.com \
    --cc=linux-mm@kvack.org \
    --cc=nacc@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox