diff mbox series

[bpf,3/4] x86: select HAVE_ARCH_HUGE_VMALLOC_FLAG for X86_64

Message ID 20220330225642.1163897-4-song@kernel.org (mailing list archive)
State New
Headers show
Series introduce HAVE_ARCH_HUGE_VMALLOC_FLAG for bpf_prog_pack | expand

Commit Message

Song Liu March 30, 2022, 10:56 p.m. UTC
As HAVE_ARCH_HUGE_VMALLOC is not ready for X86_64, enable
HAVE_ARCH_HUGE_VMALLOC_FLAG to allow bpf_prog_pack to allocate huge
pages.

Signed-off-by: Song Liu <song@kernel.org>
---
 arch/x86/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Thomas Gleixner March 30, 2022, 11:54 p.m. UTC | #1
On Wed, Mar 30 2022 at 15:56, Song Liu wrote:
> As HAVE_ARCH_HUGE_VMALLOC is not ready for X86_64, enable
> HAVE_ARCH_HUGE_VMALLOC_FLAG to allow bpf_prog_pack to allocate huge
> pages.

Despite HAVE_ARCH_HUGE_VMALLOC being not ready for X86_64 enable it
nevertheless?

I assume you wanted to say something like this:

  The shortcomings of huge vmalloc allocations have been fixed in the
  memory management core code, so reenable HAVE_ARCH_HUGE_VMALLOC.

Thanks,

        tglx
Song Liu March 31, 2022, 12:30 a.m. UTC | #2
> On Mar 30, 2022, at 4:54 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> 
> On Wed, Mar 30 2022 at 15:56, Song Liu wrote:
>> As HAVE_ARCH_HUGE_VMALLOC is not ready for X86_64, enable
>> HAVE_ARCH_HUGE_VMALLOC_FLAG to allow bpf_prog_pack to allocate huge
>> pages.
> 
> Despite HAVE_ARCH_HUGE_VMALLOC being not ready for X86_64 enable it
> nevertheless?

These are two different flags:

HAVE_ARCH_HUGE_VMALLOC allows vmalloc to try to allocate huge pages for
size >= PMD_SIZE, unless it is disabled with nohugeiomap or VM_NO_HUGE_VMAP.

HAVE_ARCH_HUGE_VMALLOC_FLAG allows vmalloc to try to allocate huge pages
for size >= PMD_SIZE, only when the user specifies VM_TRY_HUGE_VMAP. 

Recommendations for better naming will be highly appreciated..

Song


> 
> I assume you wanted to say something like this:
> 
>  The shortcomings of huge vmalloc allocations have been fixed in the
>  memory management core code, so reenable HAVE_ARCH_HUGE_VMALLOC.
> 
> Thanks,
> 
>        tglx
diff mbox series

Patch

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 4691d3aef681..2195120c8ebb 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -161,6 +161,7 @@  config X86
 	select HAVE_ALIGNED_STRUCT_PAGE		if SLUB
 	select HAVE_ARCH_AUDITSYSCALL
 	select HAVE_ARCH_HUGE_VMAP		if X86_64 || X86_PAE
+	select HAVE_ARCH_HUGE_VMALLOC_FLAG	if X86_64
 	select HAVE_ARCH_JUMP_LABEL
 	select HAVE_ARCH_JUMP_LABEL_RELATIVE
 	select HAVE_ARCH_KASAN			if X86_64