check_signal: system call restart is done only once
Fujitsu: POSTK_TEMP_FIX_66 Refs: #1009 Change-Id: Ic0f04ac6b7f6c6bb01b55fb389bf9befd56b1dd9
This commit is contained in:
committed by
Masamichi Takagi
parent
c25fb2aa39
commit
e4da71010c
49
test/issues/1009/C1009.patch
Normal file
49
test/issues/1009/C1009.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
diff --git a/arch/x86_64/kernel/syscall.c b/arch/x86_64/kernel/syscall.c
|
||||
index 4b2742b..a3173c9 100644
|
||||
--- a/arch/x86_64/kernel/syscall.c
|
||||
+++ b/arch/x86_64/kernel/syscall.c
|
||||
@@ -1670,6 +1670,11 @@ long do_arch_prctl(unsigned long code, unsigned long address)
|
||||
break;
|
||||
case ARCH_SET_GS:
|
||||
return -ENOTSUPP;
|
||||
+ case 999: {
|
||||
+ struct thread *thread = cpu_local_var(current);
|
||||
+ thread->proc->dblsig = (int)address;
|
||||
+ return 0;
|
||||
+ }
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
diff --git a/kernel/include/process.h b/kernel/include/process.h
|
||||
index 24acf1f..dd94469 100644
|
||||
--- a/kernel/include/process.h
|
||||
+++ b/kernel/include/process.h
|
||||
@@ -580,6 +580,8 @@ struct process {
|
||||
#endif // PROFILE_ENABLE
|
||||
int nr_processes; /* For partitioned execution */
|
||||
int process_rank; /* Rank in partition */
|
||||
+
|
||||
+ int dblsig;
|
||||
};
|
||||
|
||||
/*
|
||||
diff --git a/kernel/syscall.c b/kernel/syscall.c
|
||||
index 15d4593..3d03fad 100644
|
||||
--- a/kernel/syscall.c
|
||||
+++ b/kernel/syscall.c
|
||||
@@ -9632,6 +9632,15 @@ long syscall(int num, ihk_mc_user_context_t *ctx)
|
||||
|
||||
if (!list_empty(&thread->sigpending) ||
|
||||
!list_empty(&thread->sigcommon->sigpending)) {
|
||||
+ if (!list_empty(&thread->sigcommon->sigpending) &&
|
||||
+ thread->proc->dblsig) {
|
||||
+ kprintf("have a signal, waiting arrive more signal\n");
|
||||
+ while (list_is_singular(
|
||||
+ &thread->sigcommon->sigpending)) {
|
||||
+ schedule();
|
||||
+ }
|
||||
+ kprintf("have some signals\n");
|
||||
+ }
|
||||
check_signal(l, NULL, num);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user