[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8e9a4427-3c95-22f5-1e0b-5e3c9fa86592@suse.cz>
Date: Fri, 25 Sep 2020 10:39:33 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: David Hildenbrand <david@...hat.com>,
Wei Yang <richard.weiyang@...ux.alibaba.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-hyperv@...r.kernel.org, xen-devel@...ts.xenproject.org,
linux-acpi@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Alexander Duyck <alexander.h.duyck@...ux.intel.com>,
Mel Gorman <mgorman@...hsingularity.net>,
Michal Hocko <mhocko@...nel.org>,
Dave Hansen <dave.hansen@...el.com>,
Oscar Salvador <osalvador@...e.de>,
Mike Rapoport <rppt@...nel.org>,
Scott Cheloha <cheloha@...ux.ibm.com>,
Michael Ellerman <mpe@...erman.id.au>
Subject: Re: [PATCH RFC 3/4] mm/page_alloc: always move pages to the tail of
the freelist in unset_migratetype_isolate()
On 9/25/20 10:05 AM, David Hildenbrand wrote:
>>>> static inline void del_page_from_free_list(struct page *page, struct zone *zone,
>>>> unsigned int order)
>>>> {
>>>> @@ -2323,7 +2332,7 @@ static inline struct page *__rmqueue_cma_fallback(struct zone *zone,
>>>> */
>>>> static int move_freepages(struct zone *zone,
>>>> struct page *start_page, struct page *end_page,
>>>> - int migratetype, int *num_movable)
>>>> + int migratetype, int *num_movable, bool to_tail)
>>>> {
>>>> struct page *page;
>>>> unsigned int order;
>>>> @@ -2354,7 +2363,10 @@ static int move_freepages(struct zone *zone,
>>>> VM_BUG_ON_PAGE(page_zone(page) != zone, page);
>>>>
>>>> order = page_order(page);
>>>> - move_to_free_list(page, zone, order, migratetype);
>>>> + if (to_tail)
>>>> + move_to_free_list_tail(page, zone, order, migratetype);
>>>> + else
>>>> + move_to_free_list(page, zone, order, migratetype);
>>>> page += 1 << order;
>>>> pages_moved += 1 << order;
>>>> }
>>>> @@ -2362,8 +2374,9 @@ static int move_freepages(struct zone *zone,
>>>> return pages_moved;
>>>> }
>>>>
>>>> -int move_freepages_block(struct zone *zone, struct page *page,
>>>> - int migratetype, int *num_movable)
>>>> +static int __move_freepages_block(struct zone *zone, struct page *page,
>>>> + int migratetype, int *num_movable,
>>>> + bool to_tail)
>>>> {
>>>> unsigned long start_pfn, end_pfn;
>>>> struct page *start_page, *end_page;
>>>> @@ -2384,7 +2397,20 @@ int move_freepages_block(struct zone *zone, struct page *page,
>>>> return 0;
>>>>
>>>> return move_freepages(zone, start_page, end_page, migratetype,
>>>> - num_movable);
>>>> + num_movable, to_tail);
>>>> +}
>>>> +
>>>> +int move_freepages_block(struct zone *zone, struct page *page,
>>>> + int migratetype, int *num_movable)
>>>> +{
>>>> + return __move_freepages_block(zone, page, migratetype, num_movable,
>>>> + false);
>>>> +}
>>>> +
>>>> +int move_freepages_block_tail(struct zone *zone, struct page *page,
>>>> + int migratetype)
>>>> +{
>>>> + return __move_freepages_block(zone, page, migratetype, NULL, true);
>>>> }
>>>
>>> Likewise, just 5 callers of move_freepages_block(), all in the files you're
>>> already changing, so no need for this wrappers IMHO.
>
> As long as we don't want to move the implementation to the header, we'll
> need it for the constant propagation to work at compile time (we don't
> really have link-time optimizations). Or am I missing something?
I guess move_freepages_block() is not exactly fast path, so we could do without it.
> Thanks!
>
Powered by blists - more mailing lists