Re: [RFC v3 PATCH 1/5] mm/page_alloc: use helper functions to add/remove a page to/from buddy

From: Matthew Wilcox
Date: Thu May 17 2018 - 06:51:34 EST


On Wed, May 09, 2018 at 04:54:46PM +0800, Aaron Lu wrote:
> +static inline void add_to_buddy_head(struct page *page, struct zone *zone,
> + unsigned int order, int mt)
> +{
> + add_to_buddy_common(page, zone, order);
> + list_add(&page->lru, &zone->free_area[order].free_list[mt]);
> +}

Isn't this function (and all of its friends) misnamed? We're not adding
this page to the buddy allocator, we're adding it to the freelist. It
doesn't go to the buddy allocator until later, if at all.