[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171228051419epcms5p1ba575801dccdf1ebbefa956a80be231d@epcms5p1>
Date: Thu, 28 Dec 2017 05:14:19 +0000
From: NAMIT GUPTA <gupta.namit@...sung.com>
To: "rostedt@...dmis.org" <rostedt@...dmis.org>
CC: "mingo@...hat.com" <mingo@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
PANKAJ MISHRA <pankaj.m@...sung.com>,
AMIT SAHRAWAT <a.sahrawat@...sung.com>
Subject: RE: [PATCH v2] ftrace/module: Move ftrace_release_mod to
ddebug_cleanup label
Hello Steve,
As per the discussion I sent patch v2.
Please find.
Thanks,
Namit Gupta
--------- Original Message ---------
Sender : NAMIT GUPTA <gupta.namit@...sung.com> ./Senior Chief Engineer/SRI-Delhi-Platform S/W 1 Team/Samsung Electronics
Date : 2017-12-12 17:29 (GMT+5:30)
Title : [PATCH v2] ftrace/module: Move ftrace_release_mod to ddebug_cleanup label
ftrace_module_init happen after dynamic_debug_setup, it is desired that
cleanup should be called after this label however in current implementation
it is called in free module label,ie:even though ftrace in not initialized,
from so many fail case ftrace_release_mod() will be called and unnecessary
traverse the whole list.
In below patch we moved ftrace_release_mod() from free_module label to
ddebug_cleanup label. that is the best possible location, other solution
is to make new label to ftrace_release_mod() but since ftrace_module_init()
is not return with minimum changes it should be in ddebug_cleanup label.
Signed-off-by: Namit Gupta <gupta.namit@...sung.com>
---
kernel/module.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/kernel/module.c b/kernel/module.c
index 0d1cb8d..4be966a 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3523,6 +3523,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
unset_module_core_ro_nx(mod);
ddebug_cleanup:
+ ftrace_release_mod(mod);
dynamic_debug_remove(info->debug);
synchronize_sched();
kfree(mod->args);
@@ -3541,12 +3542,6 @@ static int load_module(struct load_info *info, const char __user *uargs,
synchronize_rcu();
mutex_unlock(&module_mutex);
free_module:
- /*
- * Ftrace needs to clean up what it initialized.
- * This does nothing if ftrace_module_init() wasn't called,
- * but it must be called outside of module_mutex.
- */
- ftrace_release_mod(mod);
/* Free lock-classes; relies on the preceding sync_rcu() */
lockdep_free_key_range(mod->module_core, mod->core_size);
--
1.9.1
Powered by blists - more mailing lists