diff options
author | Joonsoo Kim <iamjoonsoo.kim@lge.com> | 2016-03-17 17:18:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-17 18:09:34 -0400 |
commit | 21c647865a7d7b810aa94c32b40a4b9393ddfb85 (patch) | |
tree | 1fdaaad0cff02a9f7c593f3f60c8010ad056e96e /arch/tile | |
parent | e7df0d88c455c915376397b4bd72a83b9ed656f7 (diff) |
tile: query dynamic DEBUG_PAGEALLOC setting
We can disable debug_pagealloc processing even if the code is compiled
with CONFIG_DEBUG_PAGEALLOC. This patch changes the code to query
whether it is enabled or not in runtime.
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Takashi Iwai <tiwai@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/tile')
-rw-r--r-- | arch/tile/mm/init.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/tile/mm/init.c b/arch/tile/mm/init.c index d4e1fc41d06d..a0582b7f41d3 100644 --- a/arch/tile/mm/init.c +++ b/arch/tile/mm/init.c | |||
@@ -896,17 +896,15 @@ void __init pgtable_cache_init(void) | |||
896 | panic("pgtable_cache_init(): Cannot create pgd cache"); | 896 | panic("pgtable_cache_init(): Cannot create pgd cache"); |
897 | } | 897 | } |
898 | 898 | ||
899 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
900 | static long __write_once initfree; | ||
901 | #else | ||
902 | static long __write_once initfree = 1; | 899 | static long __write_once initfree = 1; |
903 | #endif | 900 | static bool __write_once set_initfree_done; |
904 | 901 | ||
905 | /* Select whether to free (1) or mark unusable (0) the __init pages. */ | 902 | /* Select whether to free (1) or mark unusable (0) the __init pages. */ |
906 | static int __init set_initfree(char *str) | 903 | static int __init set_initfree(char *str) |
907 | { | 904 | { |
908 | long val; | 905 | long val; |
909 | if (kstrtol(str, 0, &val) == 0) { | 906 | if (kstrtol(str, 0, &val) == 0) { |
907 | set_initfree_done = true; | ||
910 | initfree = val; | 908 | initfree = val; |
911 | pr_info("initfree: %s free init pages\n", | 909 | pr_info("initfree: %s free init pages\n", |
912 | initfree ? "will" : "won't"); | 910 | initfree ? "will" : "won't"); |
@@ -919,6 +917,11 @@ static void free_init_pages(char *what, unsigned long begin, unsigned long end) | |||
919 | { | 917 | { |
920 | unsigned long addr = (unsigned long) begin; | 918 | unsigned long addr = (unsigned long) begin; |
921 | 919 | ||
920 | /* Prefer user request first */ | ||
921 | if (!set_initfree_done) { | ||
922 | if (debug_pagealloc_enabled()) | ||
923 | initfree = 0; | ||
924 | } | ||
922 | if (kdata_huge && !initfree) { | 925 | if (kdata_huge && !initfree) { |
923 | pr_warn("Warning: ignoring initfree=0: incompatible with kdata=huge\n"); | 926 | pr_warn("Warning: ignoring initfree=0: incompatible with kdata=huge\n"); |
924 | initfree = 1; | 927 | initfree = 1; |