Re: [PATCH] arch/x86: Do not explicitly clear Reserved flag in free_pagetable

From: David Hildenbrand
Date: Mon May 27 2024 - 03:46:48 EST


Am 27.05.24 um 06:45 schrieb Oscar Salvador:
In free_pagetable() we use the non-atomic version for clearing the
PageReserved bit from the page.
free_pagetable() will either call free_reserved_page() or
put_page_bootmem(), which will eventually end up calling
free_serverd_page(), and in there we already clear the PageReserved flag.

Signed-off-by: Oscar Salvador <osalvador@xxxxxxx>
---
This has been like this since commit ae9aae9eda2d ("memory-hotplug: common APIs to
support page tables hot-remove"), so I might be missing something obvious, but
I cannot explain why we would need that __ClearPageReserved upfront, when
free_reserved_pages() already does that for us.

Especially, we only call it on the first page (in case we'd have order>0).

Acked-by: David Hildenbrand <david@xxxxxxxxxx>

--
Thanks,

David / dhildenb