diff mbox series

mm: page_alloc: use the correct type of list for free pages

Message ID 7e7ab533247d40c0ea0373c18a6a48e5667f9e10.1687333557.git.baolin.wang@linux.alibaba.com (mailing list archive)
State New
Headers show
Series mm: page_alloc: use the correct type of list for free pages | expand

Commit Message

Baolin Wang June 21, 2023, 8:14 a.m. UTC
Commit bf75f200569d ("mm/page_alloc: add page->buddy_list and page->pcp_list")
introduces page->buddy_list and page->pcp_list as a union with page->lru, but
missed to change get_page_from_free_area() to use page->buddy_list to clarify
the correct type of list for a free page.

Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
---
 mm/page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mel Gorman June 21, 2023, 10:45 a.m. UTC | #1
On Wed, Jun 21, 2023 at 04:14:28PM +0800, Baolin Wang wrote:
> Commit bf75f200569d ("mm/page_alloc: add page->buddy_list and page->pcp_list")
> introduces page->buddy_list and page->pcp_list as a union with page->lru, but
> missed to change get_page_from_free_area() to use page->buddy_list to clarify
> the correct type of list for a free page.
> 
> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>

Acked-by: Mel Gorman <mgorman@techsingularity.net>
David Hildenbrand June 21, 2023, 11:16 a.m. UTC | #2
On 21.06.23 10:14, Baolin Wang wrote:
> Commit bf75f200569d ("mm/page_alloc: add page->buddy_list and page->pcp_list")
> introduces page->buddy_list and page->pcp_list as a union with page->lru, but
> missed to change get_page_from_free_area() to use page->buddy_list to clarify
> the correct type of list for a free page.
> 
> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> ---
>   mm/page_alloc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 5c691426822a..c1839a53326c 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -727,7 +727,7 @@ 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);
> +					struct page, buddy_list);
>   }
>   
>   /*

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 5c691426822a..c1839a53326c 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -727,7 +727,7 @@  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);
+					struct page, buddy_list);
 }
 
 /*