do_kill: wake PS_INTERRUPTIBLE process when send SIGKILL

sched_wakeup_thread: don't change process status if process status is PS_EXITED
This commit is contained in:
Tomoki Shirasawa
2016-07-13 14:06:32 +09:00
parent 01d9d9a5ba
commit f6908f21a8
2 changed files with 8 additions and 3 deletions

View File

@@ -1302,7 +1302,7 @@ done:
if (status != PS_RUNNING) {
if(sig == SIGKILL){
/* Wake up the target only when stopped by ptrace-reporting */
sched_wakeup_thread(tthread, PS_TRACED | PS_STOPPED);
sched_wakeup_thread(tthread, PS_TRACED | PS_STOPPED | PS_INTERRUPTIBLE);
}
else if(sig == SIGCONT || ptracecont == 1){
/* Wake up the target only when stopped by SIGSTOP */

View File

@@ -2716,9 +2716,11 @@ sched_wakeup_thread(struct thread *thread, int valid_states)
int spin_slept = 0;
unsigned long irqstate;
struct cpu_local_var *v = get_cpu_local_var(thread->cpu_id);
struct process *proc = thread->proc;
struct mcs_rwlock_node updatelock;
dkprintf("sched_wakeup_process,proc->pid=%d,valid_states=%08x,proc->status=%08x,proc->cpu_id=%d,my cpu_id=%d\n",
thread->proc->pid, valid_states, thread->status, thread->cpu_id, ihk_mc_get_processor_id());
proc->pid, valid_states, thread->status, thread->cpu_id, ihk_mc_get_processor_id());
irqstate = ihk_mc_spinlock_lock(&(thread->spin_sleep_lock));
if (thread->spin_sleep > 0) {
@@ -2738,7 +2740,10 @@ sched_wakeup_thread(struct thread *thread, int valid_states)
irqstate = ihk_mc_spinlock_lock(&(v->runq_lock));
if (thread->status & valid_states) {
xchg4((int *)(&thread->proc->status), PS_RUNNING);
mcs_rwlock_writer_lock_noirq(&proc->update_lock, &updatelock);
if(proc->status != PS_EXITED)
proc->status = PS_RUNNING;
mcs_rwlock_writer_unlock_noirq(&proc->update_lock, &updatelock);
xchg4((int *)(&thread->status), PS_RUNNING);
status = 0;
}