Message ID | 20250319060041.2737320-1-marc.herbert@linux.intel.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mm/hugetlb: move hugetlb_sysctl_init() to the __init section | expand |
On 3/19/25 11:30, marc.herbert@linux.intel.com wrote: > From: Marc Herbert <Marc.Herbert@linux.intel.com> > > hugetlb_sysctl_init() is only invoked once by an __init function and is > merely a wrapper around another __init function so there is not reason > to keep it. > > Fixes the following warning when toning down some GCC inline options: > > WARNING: modpost: vmlinux: section mismatch in reference: > hugetlb_sysctl_init+0x1b (section: .text) -> > __register_sysctl_init (section: .init.text) > > Signed-off-by: Marc Herbert <Marc.Herbert@linux.intel.com> > --- > mm/hugetlb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index 65068671e460..a2850b26aed9 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -4900,7 +4900,7 @@ static const struct ctl_table hugetlb_table[] = { > }, > }; > > -static void hugetlb_sysctl_init(void) > +static void __init hugetlb_sysctl_init(void) > { > register_sysctl_init("vm", hugetlb_table); > } LGTM Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
On Wed, 19 Mar 2025 06:00:30 +0000 marc.herbert@linux.intel.com wrote: > From: Marc Herbert <Marc.Herbert@linux.intel.com> > > hugetlb_sysctl_init() is only invoked once by an __init function and is > merely a wrapper around another __init function so there is not reason > to keep it. > > Fixes the following warning when toning down some GCC inline options: > > WARNING: modpost: vmlinux: section mismatch in reference: > hugetlb_sysctl_init+0x1b (section: .text) -> > __register_sysctl_init (section: .init.text) > Huh. I wonder why this just started happening.
> On Mar 19, 2025, at 14:00, marc.herbert@linux.intel.com wrote: > > From: Marc Herbert <Marc.Herbert@linux.intel.com> > > hugetlb_sysctl_init() is only invoked once by an __init function and is > merely a wrapper around another __init function so there is not reason > to keep it. > > Fixes the following warning when toning down some GCC inline options: > > WARNING: modpost: vmlinux: section mismatch in reference: > hugetlb_sysctl_init+0x1b (section: .text) -> > __register_sysctl_init (section: .init.text) > > Signed-off-by: Marc Herbert <Marc.Herbert@linux.intel.com> Reviewed-by: Muchun Song <muchun.song@linux.dev> Thanks.
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 65068671e460..a2850b26aed9 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4900,7 +4900,7 @@ static const struct ctl_table hugetlb_table[] = { }, }; -static void hugetlb_sysctl_init(void) +static void __init hugetlb_sysctl_init(void) { register_sysctl_init("vm", hugetlb_table); }