linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] x86/mm: replace GFP_ATOMIC with GFP_KERNEL for direct map allocations
@ 2021-11-11 11:02 Mike Rapoport
  2021-11-11 11:02 ` [PATCH 1/4] x86/mm: make init_trampoline_kaslr() __init Mike Rapoport
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Mike Rapoport @ 2021-11-11 11:02 UTC (permalink / raw)
  To: x86
  Cc: Andy Lutomirski, Borislav Petkov, Dave Hansen, H. Peter Anvin,
	Ingo Molnar, Mike Rapoport, Mike Rapoport, Peter Zijlstra,
	Rick Edgecombe, Thomas Gleixner, linux-kernel

From: Mike Rapoport <rppt@linux.ibm.com>

Hi,

The direct map pages on x86 that are allocated using alloc_low_pages() and
spp_getpage() functions. When these functions take 'after_bootmem' branch,
the memory is allocated from buddy with GFP_ATOMIC and I could not find any
reason for this.

Since most of the kernel page tables are anyway allocated really early,
only GART IOMMU initialization and memory hotplug would actually use
get_free_pages() to allocate direct map entries and neither of them happen
in an atomic context, so it would be fine to use GFP_KERNEL. This will give
the page allocator more flexibility when memory hotplug creates the direct
map for hot-added memory and won't use precious atomic memory resources.

The first three patches are trivial cleanups I've encountered while
analysing call paths of alloc_low_pages() and spp_getpage() and the fourth
patch actually replaces GFP_ATOMIC with GFP_KERNEL in those functions.

Mike Rapoport (4):
  x86/mm: make init_trampoline_kaslr() __init
  x86/mm: make kernel_physical_mapping_change() __init
  x86/mm: init_64: make set_pte_vaddr_p4d static
  x86/mm: replace GFP_ATOMIC with GFP_KERNEL for direct map allocations

 arch/x86/include/asm/pgtable_64.h | 1 -
 arch/x86/mm/init.c                | 2 +-
 arch/x86/mm/init_64.c             | 7 ++++---
 arch/x86/mm/kaslr.c               | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)


base-commit: d2f38a3c6507b2520101f9a3807ed98f1bdc545a
-- 
2.28.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-11-12 22:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 4/4] x86/mm: replace GFP_ATOMIC with GFP_KERNEL for direct map allocations Mike Rapoport
2021-11-11 15:19   ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).