Skip to content

Commit

Permalink
mm, hugetlb: mark some bootstrap functions as __init
Browse files Browse the repository at this point in the history
Both prep_compound_huge_page() and prep_compound_gigantic_page() are
only called at bootstrap and can be marked as __init.

The __SetPageTail(page) in prep_compound_gigantic_page() happening
before page->first_page is initialized is not concerning since this is
bootstrap.

Signed-off-by: David Rientjes <rientjes@google.com>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Reviewed-by: Davidlohr Bueso <davidlohr@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
David Rientjes authored and Linus Torvalds committed Apr 3, 2014
1 parent 449dd69 commit f412c97
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,8 @@ static void prep_new_huge_page(struct hstate *h, struct page *page, int nid)
put_page(page); /* free it into the hugepage allocator */
}

static void prep_compound_gigantic_page(struct page *page, unsigned long order)
static void __init prep_compound_gigantic_page(struct page *page,
unsigned long order)
{
int i;
int nr_pages = 1 << order;
Expand Down Expand Up @@ -1319,7 +1320,7 @@ int __weak alloc_bootmem_huge_page(struct hstate *h)
return 1;
}

static void prep_compound_huge_page(struct page *page, int order)
static void __init prep_compound_huge_page(struct page *page, int order)
{
if (unlikely(order > (MAX_ORDER - 1)))
prep_compound_gigantic_page(page, order);
Expand Down

0 comments on commit f412c97

Please sign in to comment.