public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	songliubraving@fb.com, rostedt@goodmis.org, mingo@redhat.com,
	mhiramat@kernel.org, alexei.starovoitov@gmail.com
Subject: Re: [PATCH v4 1/1] perf/kprobe: maxactive for fd-based kprobe
Date: Wed, 20 Jul 2022 16:07:36 +0200	[thread overview]
Message-ID: <YtgMKDgNLnMIkHLI@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20220715095236.ywv37a556ktl5oif@ddolgov.remote.csb>

On Fri, Jul 15, 2022 at 11:52:36AM +0200, Dmitry Dolgov wrote:
> > On Thu, Jul 14, 2022 at 09:57:48PM +0200, Peter Zijlstra wrote:
> > On Thu, Jul 14, 2022 at 09:34:03PM +0200, Dmitrii Dolgov wrote:
> > > From: Song Liu <songliubraving@fb.com>
> > >
> > > Enable specifying maxactive for fd based kretprobe. This will be useful
> > > for tracing tools like bcc and bpftrace (see for example discussion [1]).
> > > Use highest 4 bit (bit 59-63) to allow specifying maxactive by log2.
> >
> > What's maxactive? This doesn't really tell me much.
> 
> Maxactive allows specifying how many instances of the specified function
> can be probed simultaneously, it would indeed make sense to mention this
> in the commit message.

But why would we need per-fd configurability? Isn't a global sysctrl
good enough?

> > Why are the top 4 bits the best to use?
> 
> This format exists mostly on proposal rights. Per previous discussions,
> 4 bits seem to be enough to cover reasonable range of maxactive values.
> Top bits seems like a natural place to me following perf_probe_config
> enum, but I would love to hear if there are any alternative suggestions?

I think the precedent you're referring to is UPROBE_REF_CTR, which is a
full 32bit. That lives in the upper half of the word because bit0 is
already taken and using the upper half makes the thing naturally
aligned.

If we only need 4 bits it's must simpler to simply stick it at the
bottom or so.

> 
> > > Note that changes in rethook implementation may render maxactive
> > > obsolete.
> >
> > Then why bother creating an ABI for it?
> 
> If I got Masami right, those potential changes mentioned above are only
> on the planning stage. At the same time the issue is annoying enough to
> try to solve it already now.

Masami; how hard would it be to do this? Creating an ABI for something
that's already planned to be removed seems unfortunate, it would be best
to see if we can find someone to accelerate this work.

  reply	other threads:[~2022-07-20 14:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14 19:34 [PATCH v4 1/1] perf/kprobe: maxactive for fd-based kprobe Dmitrii Dolgov
2022-07-14 19:42 ` Steven Rostedt
2022-07-14 19:57 ` Peter Zijlstra
2022-07-15  9:52   ` Dmitry Dolgov
2022-07-20 14:07     ` Peter Zijlstra [this message]
2022-07-24 10:36       ` Dmitry Dolgov

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=YtgMKDgNLnMIkHLI@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=9erthalion6@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=songliubraving@fb.com \
    /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