From 9102b176c4f1b6f738b1ec5bbc9a64d565405389 Mon Sep 17 00:00:00 2001 From: Masamichi Takagi Date: Fri, 31 Aug 2018 21:50:35 +0900 Subject: [PATCH] uti: Make per_proc_data of tracee survive over the signal-kill of the tracee Change-Id: I8ff1dddb526ef2fd948cfe1b8f3aa8403c2006d6 --- executer/kernel/mcctrl/control.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/executer/kernel/mcctrl/control.c b/executer/kernel/mcctrl/control.c index d72c4219..499d9baa 100644 --- a/executer/kernel/mcctrl/control.c +++ b/executer/kernel/mcctrl/control.c @@ -2415,6 +2415,11 @@ mcexec_util_thread2(ihk_os_t os, unsigned long arg, struct file *file) host_threads = thread; write_unlock_irqrestore(&host_thread_lock, flags); + /* Make per-proc-data survive over the signal-kill of tracee. Note + that the singal-kill calls close() and then release_hanlde() + destroys it. */ + ppd = mcctrl_get_per_proc_data(usrdata, task_tgid_vnr(current)); + return 0; } @@ -2483,6 +2488,12 @@ mcexec_terminate_thread(ihk_os_t os, unsigned long *param, struct file *file) (usrdata->ikc2linux[smp_processor_id()] ? usrdata->ikc2linux[smp_processor_id()] : usrdata->ikc2linux[0])); + + /* Destroy per_proc_data with the following two puts. Note that + it survived the signal-kill of tracee thanks to the additional put + done in mcexec_util_thread2 */ + mcctrl_put_per_proc_data(ppd); + err: if(ppd) mcctrl_put_per_proc_data(ppd);