lkml.org 
[lkml]   [2014]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC][PATCH] tracepoint: Do not waste memory on mods with no tracepoints
Date
Steven Rostedt <rostedt@goodmis.org> writes:
> No reason to allocate tp_module structures for modules that have no
> tracepoints. This just wastes memory.
>
> Fixes: b75ef8b44b1c "Tracepoint: Dissociate from module mutex"
> Cc: stable@vger.kernel.org # 3.2+

Really? CC:stable? To save an insignificant amount of memory?

The definition of stable seems to be shifting away from "fixes for
problems with significant effects". I obviously missed the memo.

Rusty.



> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
> kernel/tracepoint.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
> index 29f2654..0d4ef26 100644
> --- a/kernel/tracepoint.c
> +++ b/kernel/tracepoint.c
> @@ -636,6 +636,9 @@ static int tracepoint_module_coming(struct module *mod)
> struct tp_module *tp_mod, *iter;
> int ret = 0;
>
> + if (!mod->num_tracepoints)
> + return 0;
> +
> /*
> * We skip modules that taint the kernel, especially those with different
> * module headers (for forced load), to make sure we don't cause a crash.
> @@ -679,6 +682,9 @@ static int tracepoint_module_going(struct module *mod)
> {
> struct tp_module *pos;
>
> + if (!mod->num_tracepoints)
> + return 0;
> +
> mutex_lock(&tracepoints_mutex);
> tracepoint_update_probe_range(mod->tracepoints_ptrs,
> mod->tracepoints_ptrs + mod->num_tracepoints);
> --
> 1.8.1.4


\
 
 \ /
  Last update: 2014-02-27 02:21    [W:0.699 / U:0.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site