Re: [patch 2/6] hugetlb: Fix section mismatches

David Rientjes
2010-01-13T09:28:50Z

On Tue, 12 Jan 2010, Jeff Mahoney wrote:

> hugetlb_register_node calls hugetlb_sysfs_add_hstate, which is marked with
> __init. Since hugetlb_register_node is only called by
> hugetlb_register_all_nodes, which in turn is only called by hugetlb_init,
> it's safe to mark both of them as __init.
>
> Signed-off-by: Jeff Mahoney <jeffm@suse.com>
> ---
> mm/hugetlb.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1630,7 +1630,7 @@ void hugetlb_unregister_node(struct node
> * hugetlb module exit: unregister hstate attributes from node sysdevs
> * that have them.
> */
> -static void hugetlb_unregister_all_nodes(void)
> +static void __init hugetlb_unregister_all_nodes(void)
> {
> int nid;
>

This is wrong, you want to move hugetlb_register_all_nodes() to
.init.text, not hugetlb_unregister_all_nodes().

> @@ -1650,7 +1650,7 @@ static void hugetlb_unregister_all_nodes
> * Register hstate attributes for a single node sysdev.
> * No-op if attributes already registered.
> */
> -void hugetlb_register_node(struct node *node)
> +void __init hugetlb_register_node(struct node *node)
> {
> struct hstate *h;
> struct node_hstate *nhs = &node_hstates[node->sysdev.id];