* [RFC][PATCH] tracepoint: Do not waste memory on mods with no tracepoints
@ 2014-02-26 16:03 Steven Rostedt
2014-02-26 17:20 ` Mathieu Desnoyers
2014-02-27 0:30 ` Rusty Russell
0 siblings, 2 replies; 4+ messages in thread
From: Steven Rostedt @ 2014-02-26 16:03 UTC (permalink / raw)
To: LKML
Cc: Ingo Molnar, Rusty Russell, Peter Zijlstra, Mathieu Desnoyers,
Andrew Morton
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+
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [RFC][PATCH] tracepoint: Do not waste memory on mods with no tracepoints
2014-02-26 16:03 [RFC][PATCH] tracepoint: Do not waste memory on mods with no tracepoints Steven Rostedt
@ 2014-02-26 17:20 ` Mathieu Desnoyers
2014-02-27 0:30 ` Rusty Russell
1 sibling, 0 replies; 4+ messages in thread
From: Mathieu Desnoyers @ 2014-02-26 17:20 UTC (permalink / raw)
To: Steven Rostedt
Cc: LKML, Ingo Molnar, Rusty Russell, Peter Zijlstra, Andrew Morton
----- Original Message -----
> From: "Steven Rostedt" <rostedt@goodmis.org>
> To: "LKML" <linux-kernel@vger.kernel.org>
> Cc: "Ingo Molnar" <mingo@kernel.org>, "Rusty Russell" <rusty@rustcorp.com.au>, "Peter Zijlstra"
> <peterz@infradead.org>, "Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>, "Andrew Morton"
> <akpm@linux-foundation.org>
> Sent: Wednesday, February 26, 2014 11:03:13 AM
> Subject: [RFC][PATCH] tracepoint: Do not waste memory on mods with no tracepoints
>
>
> No reason to allocate tp_module structures for modules that have no
> tracepoints. This just wastes memory.
Good catch! Thanks!
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
>
> Fixes: b75ef8b44b1c "Tracepoint: Dissociate from module mutex"
> Cc: stable@vger.kernel.org # 3.2+
> 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
>
>
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC][PATCH] tracepoint: Do not waste memory on mods with no tracepoints
2014-02-26 16:03 [RFC][PATCH] tracepoint: Do not waste memory on mods with no tracepoints Steven Rostedt
2014-02-26 17:20 ` Mathieu Desnoyers
@ 2014-02-27 0:30 ` Rusty Russell
2014-02-27 1:42 ` Steven Rostedt
1 sibling, 1 reply; 4+ messages in thread
From: Rusty Russell @ 2014-02-27 0:30 UTC (permalink / raw)
To: Steven Rostedt, LKML
Cc: Ingo Molnar, Peter Zijlstra, Mathieu Desnoyers, Andrew Morton
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC][PATCH] tracepoint: Do not waste memory on mods with no tracepoints
2014-02-27 0:30 ` Rusty Russell
@ 2014-02-27 1:42 ` Steven Rostedt
0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2014-02-27 1:42 UTC (permalink / raw)
To: Rusty Russell
Cc: LKML, Ingo Molnar, Peter Zijlstra, Mathieu Desnoyers, Andrew Morton
On Thu, 27 Feb 2014 11:00:35 +1030
Rusty Russell <rusty@rustcorp.com.au> wrote:
> 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?
I agree that this rational alone is not sufficient for stable. But this
is required for another patch that warns when tracepoints are not
loaded by a module due to taints. We don't want to warn on all modules.
>
> The definition of stable seems to be shifting away from "fixes for
> problems with significant effects". I obviously missed the memo.
Not telling users that tracepoints were not activated, but acting in
every other way like they are is to me a "significant effect". This
just happened to be something that fixing this depended on.
-- Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-02-27 1:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-26 16:03 [RFC][PATCH] tracepoint: Do not waste memory on mods with no tracepoints Steven Rostedt
2014-02-26 17:20 ` Mathieu Desnoyers
2014-02-27 0:30 ` Rusty Russell
2014-02-27 1:42 ` Steven Rostedt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.