Message ID | 20240527044523.29207-1-osalvador@suse.de (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | arch/x86: Do not explicitly clear Reserved flag in free_pagetable | expand |
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@suse.de> > --- > 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@redhat.com>
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 7e177856ee4f..9f4778c2cf9f 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -980,8 +980,6 @@ static void __meminit free_pagetable(struct page *page, int order) /* bootmem page has reserved flag */ if (PageReserved(page)) { - __ClearPageReserved(page); - magic = page->index; if (magic == SECTION_INFO || magic == MIX_SECTION_INFO) { while (nr_pages--)
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@suse.de> --- 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. --- arch/x86/mm/init_64.c | 2 -- 1 file changed, 2 deletions(-)