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:
@@ -1302,7 +1302,7 @@ done:
|
|||||||
if (status != PS_RUNNING) {
|
if (status != PS_RUNNING) {
|
||||||
if(sig == SIGKILL){
|
if(sig == SIGKILL){
|
||||||
/* Wake up the target only when stopped by ptrace-reporting */
|
/* 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){
|
else if(sig == SIGCONT || ptracecont == 1){
|
||||||
/* Wake up the target only when stopped by SIGSTOP */
|
/* Wake up the target only when stopped by SIGSTOP */
|
||||||
|
|||||||
@@ -2716,9 +2716,11 @@ sched_wakeup_thread(struct thread *thread, int valid_states)
|
|||||||
int spin_slept = 0;
|
int spin_slept = 0;
|
||||||
unsigned long irqstate;
|
unsigned long irqstate;
|
||||||
struct cpu_local_var *v = get_cpu_local_var(thread->cpu_id);
|
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",
|
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));
|
irqstate = ihk_mc_spinlock_lock(&(thread->spin_sleep_lock));
|
||||||
if (thread->spin_sleep > 0) {
|
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));
|
irqstate = ihk_mc_spinlock_lock(&(v->runq_lock));
|
||||||
|
|
||||||
if (thread->status & valid_states) {
|
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);
|
xchg4((int *)(&thread->status), PS_RUNNING);
|
||||||
status = 0;
|
status = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user