summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Aksenov <a.aksenov@samsung.com>2015-09-09 12:09:21 +0300
committerDmitry Kovalenko <d.kovalenko@samsung.com>2015-09-10 08:20:49 -0700
commit3492892392c58113bf0ea4b7d16932033d53f3a6 (patch)
tree5cdc2efac70eee9cade3209589ff923a5173791f
parent9d699f0dd8f976169edc1733ac1fd709fbc70a05 (diff)
downloadswap-modules-tizen_2.4_300.tar.gz
swap-modules-tizen_2.4_300.tar.bz2
swap-modules-tizen_2.4_300.zip
[FIX] Task_data: helper probe reg/unregtizen_2.4_300
Remove probe's register/unregister away from stop_machine() Change-Id: I25cce0c65fa70af04ba7de7b5b504d20e4894e7d Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
-rw-r--r--task_data/task_data.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/task_data/task_data.c b/task_data/task_data.c
index 6f31155c..7dba5c1c 100644
--- a/task_data/task_data.c
+++ b/task_data/task_data.c
@@ -114,9 +114,8 @@ static struct kprobe do_exit_probe = {
.pre_handler = do_exit_handler
};
-static int __task_data_init(void *data)
+static int __set_helper_probes(void)
{
- struct task_struct *g, *t;
unsigned long addr;
int ret;
@@ -140,10 +139,6 @@ static int __task_data_init(void *data)
if (ret)
goto unreg_copy_process;
- do_each_thread(g, t) {
- swap_task_data_clean(t);
- } while_each_thread(g, t);
-
return 0;
unreg_copy_process:
@@ -155,13 +150,30 @@ reg_failed:
return ret;
}
+static void __remove_helper_probes(void)
+{
+ swap_unregister_kretprobe(&copy_process_rp);
+ swap_unregister_kprobe(&do_exit_probe);
+}
+
+static int __task_data_init(void *data)
+{
+ struct task_struct *g, *t;
+
+ do_each_thread(g, t) {
+ swap_task_data_clean(t);
+ } while_each_thread(g, t);
+
+ return 0;
+
+
+}
+
static int __task_data_exit(void *data)
{
struct task_struct *g, *t;
struct task_data *td;
- swap_unregister_kprobe(&do_exit_probe);
-
do_each_thread(g, t) {
td = __td(t);
__td_free(td);
@@ -174,6 +186,10 @@ static void task_data_start(void)
{
int ret;
+ ret = __set_helper_probes();
+ if (ret)
+ return;
+
/* stop_machine: cannot get tasklist_lock from module */
ret = stop_machine(__task_data_init, NULL, NULL);
if (ret)
@@ -184,7 +200,7 @@ static void task_data_stop(void)
{
int ret;
- swap_unregister_kretprobe(&copy_process_rp);
+ __remove_helper_probes();
/* stop_machine: the same here */
ret = stop_machine(__task_data_exit, NULL, NULL);