kill system call offloading from interrupt_syscall (tid == -1) change to one sided communication

refs #889
This commit is contained in:
Tomoki Shirasawa
2017-07-03 14:48:42 +09:00
parent 6e23b07b20
commit 5a9bee55c9
2 changed files with 11 additions and 4 deletions

View File

@ -1770,6 +1770,9 @@ void __return_syscall(ihk_os_t os, struct ikc_scd_packet *packet,
unsigned long phys; unsigned long phys;
struct syscall_response *res; struct syscall_response *res;
if (stid == -1)
return;
phys = ihk_device_map_memory(ihk_os_to_dev(os), phys = ihk_device_map_memory(ihk_os_to_dev(os),
packet->resp_pa, sizeof(*res)); packet->resp_pa, sizeof(*res));
res = ihk_device_map_virtual(ihk_os_to_dev(os), res = ihk_device_map_virtual(ihk_os_to_dev(os),

View File

@ -140,11 +140,8 @@ static void send_syscall(struct syscall_request *req, int cpu, int pid, struct s
if(req->number == __NR_exit_group || if(req->number == __NR_exit_group ||
req->number == __NR_kill){ // interrupt syscall req->number == __NR_kill){ // interrupt syscall
/* XXX: is this really going to work if multiple processes
* exit/receive signals at the same time?? */
if (req->number == __NR_kill) { if (req->number == __NR_kill) {
req->rtid = -1; req->rtid = -1; // no response
pid = req->args[0]; pid = req->args[0];
} }
if (req->number == __NR_gettid) if (req->number == __NR_gettid)
@ -213,6 +210,11 @@ long do_syscall(struct syscall_request *req, int cpu, int pid)
res.req_thread_status = IHK_SCD_REQ_THREAD_SPINNING; res.req_thread_status = IHK_SCD_REQ_THREAD_SPINNING;
send_syscall(req, cpu, pid, &res); send_syscall(req, cpu, pid, &res);
if (req->rtid == -1) {
rc = 0;
goto out;
}
dkprintf("%s: syscall num: %d waiting for Linux.. \n", dkprintf("%s: syscall num: %d waiting for Linux.. \n",
__FUNCTION__, req->number); __FUNCTION__, req->number);
@ -381,6 +383,8 @@ if(req->number == __NR_sched_setaffinity)kprintf("do_syscall 2 offload=%d\n", th
terminate(0, SIGKILL); terminate(0, SIGKILL);
} }
out:
#ifdef PROFILE_ENABLE #ifdef PROFILE_ENABLE
if (req->number < PROFILE_SYSCALL_MAX) { if (req->number < PROFILE_SYSCALL_MAX) {
profile_event_add(profile_syscall2offload(req->number), profile_event_add(profile_syscall2offload(req->number),