This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH -tip v9 25/26] kprobes: Introduce kprobe cache to reduce cache misshits
- From: Masami Hiramatsu <masami dot hiramatsu dot pt at hitachi dot com>
- To: Ingo Molnar <mingo at kernel dot org>
- Cc: linux-kernel at vger dot kernel dot org, Andi Kleen <andi at firstfloor dot org>, Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>, Sandeepa Prabhu <sandeepa dot prabhu at linaro dot org>, Frederic Weisbecker <fweisbec at gmail dot com>, x86 at kernel dot org, Steven Rostedt <rostedt at goodmis dot org>, fche at redhat dot com, mingo at redhat dot com, systemtap at sourceware dot org, "H. Peter Anvin" <hpa at zytor dot com>, Thomas Gleixner <tglx at linutronix dot de>
- Date: Sun, 27 Apr 2014 21:49:37 +0900
- Subject: Re: [PATCH -tip v9 25/26] kprobes: Introduce kprobe cache to reduce cache misshits
- Authentication-results: sourceware.org; auth=none
- References: <20140417081636 dot 26341 dot 87858 dot stgit at ltc230 dot yrl dot intra dot hitachi dot co dot jp> <20140417081931 dot 26341 dot 47154 dot stgit at ltc230 dot yrl dot intra dot hitachi dot co dot jp> <20140424090134 dot GC7768 at gmail dot com> <5358F7A3 dot 1000108 at hitachi dot com> <20140425082056 dot GB24829 at gmail dot com> <535A2E41 dot 40005 at hitachi dot com> <20140426071214 dot GA2374 at gmail dot com>
(2014/04/26 16:12), Ingo Molnar wrote:
>
> * Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> wrote:
>
>> (2014/04/25 17:20), Ingo Molnar wrote:
>>>
>>> * Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> wrote:
>>>
>>>>> So I don't think this should be a Kconfig entry, just enable it
>>>>> unconditionally. That will further simplify the code.
>>>>
>>>> Hmm, it consumes some amount of memory (36KB/core) just for the
>>>> case of several thousand of kprobes. On enterprise servers and
>>>> desktop it's OK, no problem. But I think, some embedded systems
>>>> with small resources will not want that. [...]
>>>
>>> They'll just disable kprobes in general.
>>
>> No, I'd like to provide kprobes (and dynamic events) to them
>> (including me) for debugging and dynamic monitoring, instead of
>> modifying code for adding events on their kernel. To solve some
>> specific issues, specific events (not generic events) are required.
>> Making local patches to add such events is an option, but it
>> increases maintenance cost for rebasing. It is better to pay cost to
>> maintain this kconfig on upstream as the maintainer for me instead
>> of paying such ugly local cost. :(
>>
>> Anyway, this option is not easy for beginners, I think it should be
>> defined with "if EXPERT" option and make it enabled by default.
>>
>>> Really, at this point complexity is our main concern.
>>
>> Agreed about complexity issue. However, even if we remove the
>> Kconfig, we can just save 6 lines of the code, and one #ifdef block.
>> Can that really solve the complexity problem?
>
> It's more about the mental picture about how kprobes works. The fewer
> binary state flags, the better.
OK, how much the amount of code is changed is not a matter.
Hmm, at this point, I'll update it to remove the Kconfig. And also I'd like
to add a note that this makes kprobes bigger, since without kpcache kprobe
hash table is just 4KB, but with kpcache, it consumes 4KB + 36KB/core
(10 times bigger at single core.)
Of course, it is still enough small for many systems which have 256MB or
more DRAM.
And I'll give smaller systems (such as controller/sensor boards for IoT etc.)
an out-of-tree kconfig patch to disable kpcache if they need... That's better
than maintaining additional-event patches.
Thank you,
--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com