Re: [PATCH 4/4] mm/page_alloc: no need to ClearPageReserved on giving page to buddy system

Wei Yang
2024-06-29T08:44:17Z

On Sat, Jun 29, 2024 at 04:21:59AM +0100, Matthew Wilcox wrote:
>On Sat, Jun 29, 2024 at 01:33:22AM +0000, Wei Yang wrote:
>> +++ b/mm/page_alloc.c
>> @@ -1232,10 +1232,8 @@ void __meminit __free_pages_core(struct page *page, unsigned int order)
>> prefetchw(p);
>> for (loop = 0; loop < (nr_pages - 1); loop++, p++) {
>> prefetchw(p + 1);
>> - __ClearPageReserved(p);
>> set_page_count(p, 0);
>> }
>> - __ClearPageReserved(p);
>> set_page_count(p, 0);
>
>Is the prefetchw() still useful? Any remotely competent CPU should
>be able to figure out this loop ...

Hi, Matthew

Thanks for your question. But to be honest, I am not fully understand it.

Per my understanding, prefetchw() is trying to load data to cache before we
really accessing it. By doing so, we won't hit a cache miss when we really
need it.

This looks useful for me. And how remote competent CPU is involved in this
process?

--
Wei Yang
Help you, Help me