__NR_gettid: use regular offloading channel (fixes unknown PID bug)

This commit is contained in:
Balazs Gerofi
2016-10-15 11:46:01 +09:00
parent d2b677b6da
commit b88d75720f
2 changed files with 11 additions and 6 deletions

View File

@ -501,9 +501,10 @@ int mcexec_syscall(struct mcctrl_usrdata *ud, struct ikc_scd_packet *packet)
ppd = mcctrl_get_per_proc_data(ud, pid);
if (unlikely(!ppd)) {
kprintf("%s: ERROR: no per-process structure for PID %d??\n",
__FUNCTION__, task_tgid_vnr(current));
return 0;
kprintf("%s: ERROR: no per-process structure for PID %d, "
"syscall nr: %d\n",
__FUNCTION__, pid, packet->req.number);
return -1;
}
dprintk("%s: (packet_handler) rtid: %d, ttid: %d, sys nr: %d\n",

View File

@ -134,7 +134,6 @@ static void send_syscall(struct syscall_request *req, int cpu, int pid, struct s
int ret;
if(req->number == __NR_exit_group ||
req->number == __NR_gettid ||
req->number == __NR_kill){ // interrupt syscall
extern int num_processors;
@ -205,7 +204,6 @@ long do_syscall(struct syscall_request *req, int cpu, int pid)
}
if(req->number == __NR_exit_group ||
req->number == __NR_gettid ||
req->number == __NR_kill){ // interrupt syscall
islock = 1;
irqstate = ihk_mc_spinlock_lock(&syscall_lock);
@ -1491,6 +1489,7 @@ SYSCALL_DECLARE(getppid)
static void settid(struct thread *thread, int nr_tids, int *tids)
{
int ret;
struct syscall_request request IHK_DMA_ALIGN;
request.number = __NR_gettid;
@ -1500,7 +1499,11 @@ static void settid(struct thread *thread, int nr_tids, int *tids)
*/
request.args[4] = nr_tids;
request.args[5] = virt_to_phys(tids);
do_syscall(&request, ihk_mc_get_processor_id(), thread->proc->pid);
if ((ret = do_syscall(&request, ihk_mc_get_processor_id(),
thread->proc->pid)) < 0) {
kprintf("%s: WARNING: do_syscall returns %d\n",
__FUNCTION__, ret);
}
}
SYSCALL_DECLARE(gettid)
@ -1936,6 +1939,7 @@ unsigned long do_fork(int clone_flags, unsigned long newsp,
}
/* Find an unused TID */
new->tid = 0;
retry_tid:
for (i = 0; i < newproc->nr_tids; ++i) {
if (!newproc->tids[i].thread) {