destroy_thread(): disable IRQ while holding update lock
This commit is contained in:
@@ -2391,19 +2391,19 @@ void destroy_thread(struct thread *thread)
|
|||||||
void release_thread(struct thread *thread)
|
void release_thread(struct thread *thread)
|
||||||
{
|
{
|
||||||
struct process_vm *vm;
|
struct process_vm *vm;
|
||||||
struct mcs_rwlock_node lock;
|
struct mcs_rwlock_node_irqsave lock;
|
||||||
struct timespec ats;
|
struct timespec ats;
|
||||||
|
|
||||||
if (!ihk_atomic_dec_and_test(&thread->refcount)) {
|
if (!ihk_atomic_dec_and_test(&thread->refcount)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mcs_rwlock_writer_lock_noirq(&thread->proc->update_lock, &lock);
|
mcs_rwlock_writer_lock(&thread->proc->update_lock, &lock);
|
||||||
tsc_to_ts(thread->system_tsc, &ats);
|
tsc_to_ts(thread->system_tsc, &ats);
|
||||||
ts_add(&thread->proc->stime, &ats);
|
ts_add(&thread->proc->stime, &ats);
|
||||||
tsc_to_ts(thread->user_tsc, &ats);
|
tsc_to_ts(thread->user_tsc, &ats);
|
||||||
ts_add(&thread->proc->utime, &ats);
|
ts_add(&thread->proc->utime, &ats);
|
||||||
mcs_rwlock_writer_unlock_noirq(&thread->proc->update_lock, &lock);
|
mcs_rwlock_writer_unlock(&thread->proc->update_lock, &lock);
|
||||||
|
|
||||||
vm = thread->vm;
|
vm = thread->vm;
|
||||||
|
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ long do_syscall(struct syscall_request *req, int cpu, int pid)
|
|||||||
kprintf("%s: proxy PID %d is dead, terminate()\n",
|
kprintf("%s: proxy PID %d is dead, terminate()\n",
|
||||||
__FUNCTION__, thread->proc->pid);
|
__FUNCTION__, thread->proc->pid);
|
||||||
thread->proc->nohost = 1;
|
thread->proc->nohost = 1;
|
||||||
terminate(-1, 0);
|
terminate(0, SIGKILL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PROFILE_ENABLE
|
#ifdef PROFILE_ENABLE
|
||||||
|
|||||||
Reference in New Issue
Block a user