* [PATCH] arch/x86: Do not explicitly clear Reserved flag in free_pagetable
@ 2024-05-27 4:45 Oscar Salvador
2024-05-27 7:46 ` David Hildenbrand
0 siblings, 1 reply; 2+ messages in thread
From: Oscar Salvador @ 2024-05-27 4:45 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, linux-mm, David Hildenbrand, Dave Hansen, 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.
---
arch/x86/mm/init_64.c | 2 --
1 file changed, 2 deletions(-)
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--)
--
2.45.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] arch/x86: Do not explicitly clear Reserved flag in free_pagetable
2024-05-27 4:45 [PATCH] arch/x86: Do not explicitly clear Reserved flag in free_pagetable Oscar Salvador
@ 2024-05-27 7:46 ` David Hildenbrand
0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2024-05-27 7:46 UTC (permalink / raw)
To: Oscar Salvador, Andrew Morton; +Cc: linux-kernel, linux-mm, Dave Hansen
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>
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-27 7:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-27 4:45 [PATCH] arch/x86: Do not explicitly clear Reserved flag in free_pagetable Oscar Salvador
2024-05-27 7:46 ` David Hildenbrand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox