Revert "[FIX] sending unmap message" 64/55264/1
authorAlexander Aksenov <a.aksenov@samsung.com>
Tue, 22 Dec 2015 15:06:39 +0000 (18:06 +0300)
committerAlexander Aksenov <a.aksenov@samsung.com>
Tue, 22 Dec 2015 15:08:14 +0000 (18:08 +0300)
This reverts commit 008d1e6444ca222ea8378640a68010f74730a616.

Change-Id: I879828b4525be9b2e106bb596e01371524baf319
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
us_manager/helper.c

index f439d37..51b4566 100644 (file)
@@ -528,14 +528,18 @@ static void msg_unmap(struct sspt_filter *f, void *data)
 static void __remove_unmap_probes(struct sspt_proc *proc,
                                  struct unmap_data *umd)
 {
+       struct task_struct *task = proc->task;
        unsigned long start = umd->start;
-       size_t len = umd->len;
+       size_t len = PAGE_ALIGN(umd->len);
        LIST_HEAD(head);
 
        if (sspt_proc_get_files_by_region(proc, &head, start, len)) {
                struct sspt_file *file, *n;
                unsigned long end = start + len;
-               struct task_struct *task = proc->task;
+               struct msg_unmap_data msg_data = {
+                       .start = start,
+                       .end = end
+               };
 
                list_for_each_entry_safe(file, n, &head, list) {
                        if (file->vm_start >= end)
@@ -547,6 +551,8 @@ static void __remove_unmap_probes(struct sspt_proc *proc,
                }
 
                sspt_proc_insert_files(proc, &head);
+
+               sspt_proc_on_each_filter(proc, msg_unmap, (void *)&msg_data);
        }
 }
 
@@ -558,18 +564,9 @@ static void remove_unmap_probes(struct task_struct *task,
        sspt_proc_write_lock();
 
        proc = sspt_proc_get_by_task_no_lock(task);
-       if (proc) {
-               struct msg_unmap_data msg_data = {
-                       .start = umd->start,
-                       .end = umd->start + umd->len,
-               };
-
+       if (proc)
                __remove_unmap_probes(proc, umd);
 
-               /* send unmap region */
-               sspt_proc_on_each_filter(proc, msg_unmap, (void *)&msg_data);
-       }
-
        sspt_proc_write_unlock();
 }
 
@@ -582,7 +579,7 @@ static int entry_handler_unmap(struct kretprobe_instance *ri,
        atomic_inc(&unmap_cnt);
 
        data->start = swap_get_karg(regs, 1);
-       data->len = (size_t)PAGE_ALIGN(swap_get_karg(regs, 2));
+       data->len = (size_t)swap_get_karg(regs, 2);
 
        if (!is_kthread(task) && atomic_read(&stop_flag))
                remove_unmap_probes(task, data);