From: Mike Rapoport <rppt@kernel.org>
To: x86@kernel.org
Cc: Andy Lutomirski <luto@kernel.org>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>,
Mike Rapoport <rppt@kernel.org>,
Mike Rapoport <rppt@linux.ibm.com>,
Peter Zijlstra <peterz@infradead.org>,
Rick Edgecombe <rick.p.edgecombe@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] x86/mm: replace GFP_ATOMIC with GFP_KERNEL for direct map allocations
Date: Thu, 11 Nov 2021 13:02:41 +0200 [thread overview]
Message-ID: <20211111110241.25968-5-rppt@kernel.org> (raw)
In-Reply-To: <20211111110241.25968-1-rppt@kernel.org>
From: Mike Rapoport <rppt@linux.ibm.com>
The allocations of the direct map pages are mostly happen very early during
the system boot and they use either the page table cache in brk area of bss
or memblock.
The few callers that effectively use page allocator for the direct map
updates are gart_iommu_init() and memory hotplug. Neither of them happen in
an atomic context so there is no reason to use GFP_ATOMIC for these
allocations.
Replace GFP_ATOMIC with GFP_KERNEL to avoid using atomic reserves for
allocations that do not require that.
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
arch/x86/mm/init.c | 2 +-
arch/x86/mm/init_64.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 1895986842b9..c01f144e0015 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -120,7 +120,7 @@ __ref void *alloc_low_pages(unsigned int num)
unsigned int order;
order = get_order((unsigned long)num << PAGE_SHIFT);
- return (void *)__get_free_pages(GFP_ATOMIC | __GFP_ZERO, order);
+ return (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, order);
}
if ((pgt_buf_end + num) > pgt_buf_top || !can_use_brk_pgt) {
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index e46d2f18d895..f3924f1a953d 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -227,7 +227,7 @@ static __ref void *spp_getpage(void)
void *ptr;
if (after_bootmem)
- ptr = (void *) get_zeroed_page(GFP_ATOMIC);
+ ptr = (void *) get_zeroed_page(GFP_KERNEL);
else
ptr = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
--
2.28.0
next prev parent reply other threads:[~2021-11-11 11:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-11 11:02 [PATCH 0/4] x86/mm: replace GFP_ATOMIC with GFP_KERNEL for direct map allocations Mike Rapoport
2021-11-11 11:02 ` [PATCH 1/4] x86/mm: make init_trampoline_kaslr() __init Mike Rapoport
2021-11-11 20:46 ` Edgecombe, Rick P
2021-11-11 11:02 ` [PATCH 2/4] x86/mm: make kernel_physical_mapping_change() __init Mike Rapoport
2021-11-11 20:47 ` Edgecombe, Rick P
2021-11-11 11:02 ` [PATCH 3/4] x86/mm: init_64: make set_pte_vaddr_p4d static Mike Rapoport
2021-11-11 20:48 ` Edgecombe, Rick P
2021-11-11 11:02 ` Mike Rapoport [this message]
2021-11-11 15:19 ` [PATCH 4/4] x86/mm: replace GFP_ATOMIC with GFP_KERNEL for direct map allocations Dave Hansen
2021-11-11 15:57 ` Mike Rapoport
2021-11-11 21:35 ` Edgecombe, Rick P
2021-11-12 12:30 ` Mike Rapoport
2021-11-12 22:39 ` Edgecombe, Rick P
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211111110241.25968-5-rppt@kernel.org \
--to=rppt@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rick.p.edgecombe@intel.com \
--cc=rppt@linux.ibm.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox