linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: linux-perf-users@vger.kernel.org, bpf@vger.kernel.org,
	songliubraving@fb.com, rostedt@goodmis.org, peterz@infradead.org,
	mingo@redhat.com, alexei.starovoitov@gmail.com
Subject: Re: [PATCH v3 1/1] perf/kprobe: maxactive for fd-based kprobe
Date: Thu, 23 Jun 2022 23:47:27 +0900	[thread overview]
Message-ID: <20220623234727.db1dda76c11d660200b2b804@kernel.org> (raw)
In-Reply-To: <20220622085421.k2kikjndluxfmf7q@ddolgov.remote.csb>

On Wed, 22 Jun 2022 10:54:21 +0200
Dmitry Dolgov <9erthalion6@gmail.com> wrote:

> > On Sun, Jun 19, 2022 at 01:31:37AM +0900, Masami Hiramatsu wrote:
> > On Wed, 15 Jun 2022 23:15:59 +0200
> > Dmitrii Dolgov <9erthalion6@gmail.com> 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 12 bit (bit 52-63) to allow maximal maxactive of 4095.
> >
> > I'm not sure what environment you are considering to use this
> > feature, but is 4095 enough, and are you really need to specify
> > the maxactive by linear digit?
> > I mean you may need the logarithm of maxactive? In this case, you
> > only need 4 bits for 2 - 65546 (1 = 2^0 will be used for the default
> > value).
> 
> From what I see it's capped by KRETPROBE_MAXACTIVE_MAX anyway, which
> value is 4096. Do I miss something, is it possible to use maxactive with
> larger values down the line?

Ah, I forgot to cap the maxactive in trace_kprobe. Yes, kretprobe's
maxactive has no limitation check (it depends on how much memory you
can allocate in the kernel.) If you think that is not enough, you
can expand the maximum number. Unless a huge system which runs
a ten thoudsands of similar process/threads, 4096 will be a good
number. So, it up to you. But personally I think the maxactive
should be specified by log2. 

Thank you,

-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

  reply	other threads:[~2022-06-23 14:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 21:15 [PATCH v3 1/1] perf/kprobe: maxactive for fd-based kprobe Dmitrii Dolgov
2022-06-18 16:31 ` Masami Hiramatsu
2022-06-22  8:54   ` Dmitry Dolgov
2022-06-23 14:47     ` Masami Hiramatsu [this message]
2022-06-25 15:21       ` 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=20220623234727.db1dda76c11d660200b2b804@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=9erthalion6@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --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;
as well as URLs for NNTP newsgroup(s).