mm: move get_page_from_free_area() to mm/page_alloc.c
Subsystems (4)
Mike Rapoport
reviewerPATCH 1/1 mm: move get_page_from_free_area() to mm/page_alloc.c
From: "Mike Rapoport (IBM)" <[email protected]>
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
--- include/linux/mmzone.h | 7 ------- mm/page_alloc.c | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-)
include/linux/mmzone.h +0 -7
@@ -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]);
mm/page_alloc.c +7 -0
@@ -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
base-commit: 4018ab1f7cec061b8425737328edefebdc0ab832
Signature · 1 line
2.35.1
Quoted 48 lines · Mike Rapoport
From: "Mike Rapoport (IBM)" <[email protected]>
The
get_page_from_free_area()helper is only used inmm/page_alloc.cso move it there to reduce noise ininclude/linux/mmzone.hSigned-off-by Mike Rapoport (IBM) <[email protected]>--- include/linux/mmzone.h | 7 ------- mm/page_alloc.c | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-)include/linux/mmzone.h +0
-7@@ -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]);mm/page_alloc.c +7
-0@@ -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
Quoted 4 lines
base-commit:
4018ab1f7cec061b8425737328edefebdc0ab832--
2.35.1
Good catch, I wonder if there are more functions like this that can be dropped from headers?
Matthew Wilcox
Reviewed-byQuoted 5 lines · Lorenzo Stoakes
Quoted 4 lines · Mike Rapoport
From: "Mike Rapoport (IBM)" <[email protected]>
The
get_page_from_free_area()helper is only used inmm/page_alloc.cso move it there to reduce noise ininclude/linux/mmzone.h
Quoted 2 lines
Good catch, I wonder if there are more functions like this that can be dropped from headers?
I don't think anything outside mm/ has any reason to see 'struct free_area'. Unfortunately, it's a field in struct zone, so moving it out of mmzone.h will be hard (unless we can move struct zone out of mmzone.h?)
free_area_empty() can move to mm/internal.h though
Mike Rapoport
reviewerQuoted 9 lines · Matthew Wilcox
Quoted 5 lines · Lorenzo Stoakes
Quoted 4 lines · Mike Rapoport
From: "Mike Rapoport (IBM)" <[email protected]>
The
get_page_from_free_area()helper is only used inmm/page_alloc.cso move it there to reduce noise ininclude/linux/mmzone.hReviewed-by Matthew Wilcox (Oracle) <[email protected]>
Quoted 7 lines
Quoted 2 lines
Good catch, I wonder if there are more functions like this that can be dropped from headers?
I don't think anything outside
mm/has any reason to see 'structfree_area'. Unfortunately, it's a field in struct zone, so moving it out ofmmzone.hwill be hard (unless we can move struct zone out ofmmzone.h?)
Seems possible but not trivial.
Quoted 1 line
free_area_empty()can move tomm/internal.hthough
Yes.
Signature · 2 lines
Sincerely yours, Mike.
Quoted 6 lines · Mike Rapoport
From: "Mike Rapoport (IBM)" <[email protected]>
The
get_page_from_free_area()helper is only used inmm/page_alloc.cso move it there to reduce noise ininclude/linux/mmzone.hSigned-off-by Mike Rapoport (IBM) <[email protected]>
Signature · 1 line
Kiryl Shutsemau / Kirill A. Shutemov