do_syscall(): eliminate centralized lock for exit/kill code path (use IKC2 thread pool)
This commit is contained in:
@@ -336,11 +336,8 @@ static void post_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (find_command_line("hidos")) {
|
if (find_command_line("hidos")) {
|
||||||
extern ihk_spinlock_t syscall_lock;
|
|
||||||
|
|
||||||
init_host_syscall_channel();
|
init_host_syscall_channel();
|
||||||
init_host_syscall_channel2();
|
init_host_syscall_channel2();
|
||||||
ihk_mc_spinlock_init(&syscall_lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
arch_setup_vdso();
|
arch_setup_vdso();
|
||||||
|
|||||||
@@ -267,16 +267,12 @@ static void send_syscall(struct syscall_request *req, int cpu, int pid, struct s
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ihk_spinlock_t syscall_lock;
|
|
||||||
|
|
||||||
long do_syscall(struct syscall_request *req, int cpu, int pid)
|
long do_syscall(struct syscall_request *req, int cpu, int pid)
|
||||||
{
|
{
|
||||||
struct syscall_response res;
|
struct syscall_response res;
|
||||||
struct syscall_request req2 IHK_DMA_ALIGN;
|
struct syscall_request req2 IHK_DMA_ALIGN;
|
||||||
int error;
|
int error;
|
||||||
long rc;
|
long rc;
|
||||||
int islock = 0;
|
|
||||||
unsigned long irqstate;
|
|
||||||
struct thread *thread = cpu_local_var(current);
|
struct thread *thread = cpu_local_var(current);
|
||||||
struct process *proc = thread->proc;
|
struct process *proc = thread->proc;
|
||||||
#ifdef TRACK_SYSCALLS
|
#ifdef TRACK_SYSCALLS
|
||||||
@@ -288,7 +284,6 @@ long do_syscall(struct syscall_request *req, int cpu, int pid)
|
|||||||
ihk_mc_get_processor_id(),
|
ihk_mc_get_processor_id(),
|
||||||
req->number);
|
req->number);
|
||||||
|
|
||||||
irqstate = 0; /* for avoidance of warning */
|
|
||||||
barrier();
|
barrier();
|
||||||
|
|
||||||
if(req->number != __NR_exit_group){
|
if(req->number != __NR_exit_group){
|
||||||
@@ -299,11 +294,6 @@ long do_syscall(struct syscall_request *req, int cpu, int pid)
|
|||||||
++thread->in_syscall_offload;
|
++thread->in_syscall_offload;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(req->number == __NR_exit_group ||
|
|
||||||
req->number == __NR_kill){ // interrupt syscall
|
|
||||||
islock = 1;
|
|
||||||
irqstate = ihk_mc_spinlock_lock(&syscall_lock);
|
|
||||||
}
|
|
||||||
/* The current thread is the requester and any thread from
|
/* The current thread is the requester and any thread from
|
||||||
* the pool may serve the request */
|
* the pool may serve the request */
|
||||||
req->rtid = cpu_local_var(current)->tid;
|
req->rtid = cpu_local_var(current)->tid;
|
||||||
@@ -394,9 +384,6 @@ long do_syscall(struct syscall_request *req, int cpu, int pid)
|
|||||||
__FUNCTION__, req->number, res.ret);
|
__FUNCTION__, req->number, res.ret);
|
||||||
|
|
||||||
rc = res.ret;
|
rc = res.ret;
|
||||||
if(islock){
|
|
||||||
ihk_mc_spinlock_unlock(&syscall_lock, irqstate);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(req->number != __NR_exit_group){
|
if(req->number != __NR_exit_group){
|
||||||
--thread->in_syscall_offload;
|
--thread->in_syscall_offload;
|
||||||
|
|||||||
Reference in New Issue
Block a user