From: Andrew Morton <akpm@linux-foundation.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [patch] hugetlbfs: fix build failure on 64-bit x86
Date: Sat, 26 Jul 2008 02:58:39 -0700 [thread overview]
Message-ID: <20080726025839.39a11b66.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080726091654.GA18341@elte.hu>
On Sat, 26 Jul 2008 11:16:54 +0200 Ingo Molnar <mingo@elte.hu> wrote:
>
> [resend, still relevant to -git]
>
> >From 5215af24a20e5f448ee45cd1d97c4118b876c0f6 Mon Sep 17 00:00:00 2001
> From: Ingo Molnar <mingo@elte.hu>
> Date: Fri, 25 Jul 2008 20:45:52 +0200
> Subject: [PATCH] hugetlbfs: fix build failure on 64-bit x86
>
> fix:
>
> arch/x86/mm/built-in.o: In function `setup_hugepagesz':
> hugetlbpage.c:(.init.text+0xb49): undefined reference to `hugetlb_add_hstate'
>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> ---
> arch/x86/mm/hugetlbpage.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
> index 8f307d9..977d185 100644
> --- a/arch/x86/mm/hugetlbpage.c
> +++ b/arch/x86/mm/hugetlbpage.c
> @@ -425,7 +425,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
>
> #endif /*HAVE_ARCH_HUGETLB_UNMAPPED_AREA*/
>
> -#ifdef CONFIG_X86_64
> +#if defined(CONFIG_X86_64) && defined(CONFIG_SYSCTL)
> static __init int setup_hugepagesz(char *opt)
> {
> unsigned long ps = memparse(opt, &opt);
Seems wrong that a __setup handler would vanish if CONFIG_SYSCTL=n.
I think Nishanth's patch (sent to Linus a few hours ago) fixes this
correctly, by making hugetlb_add_hstate available if CONFIG_SYSCTL=n:
From: Nishanth Aravamudan <nacc@us.ibm.com>
Fixes a build failure reported by Alan Cox:
mm/hugetlb.c: In function `hugetlb_acct_memory': mm/hugetlb.c:1507:
error: implicit declaration of function `cpuset_mems_nr'
Also reverts Ingo's
commit e44d1b2998d62a1f2f4d7eb17b56ba396535509f
Author: Ingo Molnar <mingo@elte.hu>
Date: Fri Jul 25 12:57:41 2008 +0200
mm/hugetlb.c: fix build failure with !CONFIG_SYSCTL
which fixed the build error but added some unused-static-function warnings.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/hugetlb.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff -puN mm/hugetlb.c~hugetlb-fix-config_sysctl=n-build mm/hugetlb.c
--- a/mm/hugetlb.c~hugetlb-fix-config_sysctl=n-build
+++ a/mm/hugetlb.c
@@ -1026,18 +1026,6 @@ static void __init report_hugepages(void
}
}
-static unsigned int cpuset_mems_nr(unsigned int *array)
-{
- int node;
- unsigned int nr = 0;
-
- for_each_node_mask(node, cpuset_current_mems_allowed)
- nr += array[node];
-
- return nr;
-}
-
-#ifdef CONFIG_SYSCTL
#ifdef CONFIG_HIGHMEM
static void try_to_free_low(struct hstate *h, unsigned long count)
{
@@ -1386,6 +1374,18 @@ static int __init hugetlb_default_setup(
}
__setup("default_hugepagesz=", hugetlb_default_setup);
+static unsigned int cpuset_mems_nr(unsigned int *array)
+{
+ int node;
+ unsigned int nr = 0;
+
+ for_each_node_mask(node, cpuset_current_mems_allowed)
+ nr += array[node];
+
+ return nr;
+}
+
+#ifdef CONFIG_SYSCTL
int hugetlb_sysctl_handler(struct ctl_table *table, int write,
struct file *file, void __user *buffer,
size_t *length, loff_t *ppos)
_
next prev parent reply other threads:[~2008-07-26 9:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-26 9:16 [patch] hugetlbfs: fix build failure on 64-bit x86 Ingo Molnar
2008-07-26 9:58 ` Andrew Morton [this message]
2008-07-26 11:22 ` Ingo Molnar
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=20080726025839.39a11b66.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=torvalds@linux-foundation.org \
/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