destroy_thread(): disable IRQ while holding update lock

This commit is contained in:
Balazs Gerofi
2017-06-08 17:40:35 +09:00
parent 66fad4c7a4
commit 4d0e0728f4
2 changed files with 4 additions and 4 deletions

View File

@ -2391,19 +2391,19 @@ void destroy_thread(struct thread *thread)
void release_thread(struct thread *thread)
{
struct process_vm *vm;
struct mcs_rwlock_node lock;
struct mcs_rwlock_node_irqsave lock;
struct timespec ats;
if (!ihk_atomic_dec_and_test(&thread->refcount)) {
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);
ts_add(&thread->proc->stime, &ats);
tsc_to_ts(thread->user_tsc, &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;

View File

@ -307,7 +307,7 @@ long do_syscall(struct syscall_request *req, int cpu, int pid)
kprintf("%s: proxy PID %d is dead, terminate()\n",
__FUNCTION__, thread->proc->pid);
thread->proc->nohost = 1;
terminate(-1, 0);
terminate(0, SIGKILL);
}
#ifdef PROFILE_ENABLE