BPF List
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: bot+bpf-ci@kernel.org
Cc: ast@kernel.org, andrii@kernel.org, bp@alien8.de,
	daniel@iogearbox.net, dave.hansen@linux.intel.com,
	eddyz87@gmail.com, mingo@redhat.com, memxor@gmail.com,
	song@kernel.org, tglx@kernel.org, emil@etsalapatis.com,
	hpa@zytor.com, jolsa@kernel.org, john.fastabend@gmail.com,
	martin.lau@linux.dev, yonghong.song@linux.dev,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	x86@kernel.org, olsajiri@gmail.com, martin.lau@kernel.org,
	clm@meta.com, ihor.solodrai@linux.dev
Subject: Re: [PATCH] x86/bpf: make arch_bpf_trampoline_size allocate from EXECMEM_MODULE_DATA
Date: Wed, 19 Aug 2026 09:42:41 +0300	[thread overview]
Message-ID: <aoVQYYzUt_eCG4Ek@kernel.org> (raw)
In-Reply-To: <9b5c48df2b9e1f49191a459c822608751240e2243ae0cebb96bae0939037aadc@mail.kernel.org>

On Tue, Aug 18, 2026 at 02:07:23PM +0000, bot+bpf-ci@kernel.org wrote:
> >     x86/bpf: make arch_bpf_trampoline_size allocate from EXECMEM_MODULE_DATA
> >
> >     Jiri Olsa reports slowdown of tracing_multi benchmark that allocates huge
> >     number of trampolines [1].
> >
> >     The slowdown caused by extra protection changes in execmem_alloc_rw() and
> >     execmem_free().
> >
> >     With ROX caches enabled, all execmem allocations except EXECMEM_MODULE_DATA
> >     are ROX after the allocation. execmem_alloc_rw() temporarily sets them to
> >     W+NX and execmem_free() resets them back to ROX.
> >
> >     The only user of bpf_jit_alloc_exec_rw() is x86::arch_bpf_trampoline_size()
> >     that only needs a temporary writable buffer in the modules address space.
> >
> >     On x86 executable memory and module data are constrained to the same
> >     address range, so x86::arch_bpf_trampoline_size() can directly use
> >     execmem_alloc(EXECMEM_MODULE_DATA)
> >
> >     Replace the call to bpf_jit_alloc_exec_rw() with a call to
> >     execmem_alloc(EXECMEM_MODULE_DATA) in x86::arch_bpf_trampoline_size() and
> >     drop bpf_jit_alloc_exec_rw() helper.
> >
> >     Reported-by: Jiri Olsa <olsajiri@gmail.com>
> >     Link: https://lore.kernel.org/all/an8r7EODLIL-bZM3@krava
> >     Fixes: f0334294a428 ("bpf, x86: make sure allocation in arch_bpf_trampoline_size() is writable")
>              ^^^^^^^^^^^^
> 
> The Fixes tag references commit f0334294a428, which does not exist in
> this repository. Should this be:
> 
>   Fixes: 5bf02dbf39fa ("bpf, x86: Make sure allocation in arch_bpf_trampoline_size() is writable")

Argh, checked the log on a wrong branch.

Can you folks fix it up when applying or you'd need v3?
 
> That commit introduced bpf_jit_alloc_exec_rw() and the performance issue
> being addressed here.

-- 
Sincerely yours,
Mike.

  reply	other threads:[~2026-08-19  6:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18 13:05 [PATCH] x86/bpf: make arch_bpf_trampoline_size allocate from EXECMEM_MODULE_DATA Mike Rapoport
2026-08-18 14:07 ` bot+bpf-ci
2026-08-19  6:42   ` Mike Rapoport [this message]
2026-08-19  7:34     ` Daniel Borkmann
2026-08-18 20:51 ` Jiri Olsa

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=aoVQYYzUt_eCG4Ek@kernel.org \
    --to=rppt@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bot+bpf-ci@kernel.org \
    --cc=bp@alien8.de \
    --cc=bpf@vger.kernel.org \
    --cc=clm@meta.com \
    --cc=daniel@iogearbox.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=hpa@zytor.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=mingo@redhat.com \
    --cc=olsajiri@gmail.com \
    --cc=song@kernel.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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