Skip to content

Commit

Permalink
mm: move get_page_from_free_area() to mm/page_alloc.c
Browse files Browse the repository at this point in the history
The get_page_from_free_area() helper is only used in mm/page_alloc.c so
move it there to reduce noise in include/linux/mmzone.h

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Mike Rapoport (IBM) <[email protected]>
Reviewed-by: Lorenzo Stoakes <[email protected]>
Acked-by: Kirill A. Shutemov <[email protected]>
Reviewed-by: Matthew Wilcox (Oracle) <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
rppt authored and akpm00 committed Apr 6, 2023
1 parent 53d36a5 commit 5d671eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 0 additions & 7 deletions include/linux/mmzone.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,6 @@ struct free_area {
unsigned long nr_free;
};

static inline struct page *get_page_from_free_area(struct free_area *area,
int migratetype)
{
return list_first_entry_or_null(&area->free_list[migratetype],
struct page, lru);
}

static inline bool free_area_empty(struct free_area *area, int migratetype)
{
return list_empty(&area->free_list[migratetype]);
Expand Down
7 changes: 7 additions & 0 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,13 @@ static inline void del_page_from_free_list(struct page *page, struct zone *zone,
zone->free_area[order].nr_free--;
}

static inline struct page *get_page_from_free_area(struct free_area *area,
int migratetype)
{
return list_first_entry_or_null(&area->free_list[migratetype],
struct page, lru);
}

/*
* If this is not the largest possible page, check if the buddy
* of the next-highest order is free. If it is, it's possible
Expand Down

0 comments on commit 5d671eb

Please sign in to comment.