> On Thu, Jun 23, 2022 at 11:47:27PM +0900, Masami Hiramatsu wrote: > On Wed, 22 Jun 2022 10:54:21 +0200 > Dmitry Dolgov <9erthalion6@xxxxxxxxx> 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@xxxxxxxxx> wrote: > > > > > > > From: Song Liu <songliubraving@xxxxxx> > > > > > > > > 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. Thanks for clarification. Yep, makes sense to me, I'll prepare a new version soon.