The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Jiri Olsa <olsajiri@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	bpf@vger.kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	martin.lau@kernel.org, peterz@infradead.org, kuba@kernel.org,
	linux-kernel@vger.kernel.org, mingo@kernel.org,
	netdev@vger.kernel.org
Subject: Re: [GIT PULL] BPF changes for 6.18
Date: Wed, 1 Oct 2025 14:26:16 +0200	[thread overview]
Message-ID: <aN0d6PAFg5UTKuOc@krava> (raw)
In-Reply-To: <aN0JVRynHxqKy4lw@krava>

On Wed, Oct 01, 2025 at 12:58:29PM +0200, Jiri Olsa wrote:
> On Tue, Sep 30, 2025 at 07:09:43PM -0700, Linus Torvalds wrote:
> > [ Jiri added to participants ]
> > 
> > On Sun, 28 Sept 2025 at 08:46, Alexei Starovoitov
> > <alexei.starovoitov@gmail.com> wrote:
> > >
> > > Note, there is a trivial conflict between tip and bpf-next trees:
> > > in kernel/events/uprobes.c between commit:
> > >   4363264111e12 ("uprobe: Do not emulate/sstep original instruction when ip is changed")
> > > from the bpf-next tree and commit:
> > >   ba2bfc97b4629 ("uprobes/x86: Add support to optimize uprobes")
> > > from the tip tree:
> > > https://lore.kernel.org/all/aNVMR5rjA2geHNLn@sirena.org.uk/
> > > since Jiri's two separate uprobe/bpf related patch series landed
> > > in different trees. One was mostly uprobe. Another was mostly bpf.
> > 
> > So the conflict isn't complicated and I did it the way linux-next did
> > it, but honestly, the placement of that arch_uprobe_optimize() thing
> > isn't obvious.
> > 
> > My first reaction was to put it before the instruction_pointer()
> > check, because it seems like whatever rewriting the arch wants to do
> > might as well be done regardless.
> > 
> > It's very confusing how it's sometimes skipped, and sometimes not
> > skipped. For example. if the uprobe is skipped because of
> > single-stepping disabling it, the arch optimization still *will* be
> > done, because the "skip_sstep()" test is done after - but other
> > skipping tests are done before.
> > 
> > Jiri, it would be good to just add a note about when that optimization
> > is done and when not done. Because as-is, it's very confusing.
> > 
> > The answer may well be "it doesn't matter, semantics are the same" (I
> > suspect that _is_ the answer), but even so that current ordering is
> > just confusing when it sometimes goes through that
> > arch_uprobe_optimize() and sometimes skips it.
> 
> yes, either way will work fine, but perhaps the other way round to
> first optimize and then skip uprobe if needed is less confusing
> 
> > 
> > Side note: the conflict in the selftests was worse, and the magic to
> > build it is not obvious. It errors out randomly with various kernel
> > configs with useless error messages, and I eventually just gave up
> > entirely with a
> > 
> >    attempt to use poisoned ‘gettid’
> > 
> > error.
> > 
> >              Linus
> 
> I ended up with changes below, should I send formal patches?

I sent out the bpf selftest fixes:
  https://lore.kernel.org/bpf/20251001122223.170830-1-jolsa@kernel.org/T/#t

will send the uprobe fix shortly

jirka

  reply	other threads:[~2025-10-01 12:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-28 15:46 [GIT PULL] BPF changes for 6.18 Alexei Starovoitov
2025-10-01  2:09 ` Linus Torvalds
2025-10-01 10:58   ` Jiri Olsa
2025-10-01 12:26     ` Jiri Olsa [this message]
2025-10-01 14:02       ` Alexei Starovoitov
2025-10-01 15:16     ` Linus Torvalds
2025-10-01  2:10 ` pr-tracker-bot

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=aN0d6PAFg5UTKuOc@krava \
    --to=olsajiri@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=mingo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.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