Unpause requests (to FS) can be generated in parallel to other requests.
This commit is contained in:
parent
f0186f4179
commit
c9ff3994f1
3 changed files with 33 additions and 14 deletions
|
@ -216,6 +216,7 @@ PRIVATE void pm_init()
|
||||||
tmr_inittimer(&rmp->mp_timer);
|
tmr_inittimer(&rmp->mp_timer);
|
||||||
|
|
||||||
rmp->mp_fs_call= PM_IDLE;
|
rmp->mp_fs_call= PM_IDLE;
|
||||||
|
rmp->mp_fs_call2= PM_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Build the set of signals which cause core dumps, and the set of signals
|
/* Build the set of signals which cause core dumps, and the set of signals
|
||||||
|
@ -518,6 +519,8 @@ PRIVATE void send_work()
|
||||||
for (rmp= mproc; rmp < &mproc[NR_PROCS]; rmp++)
|
for (rmp= mproc; rmp < &mproc[NR_PROCS]; rmp++)
|
||||||
{
|
{
|
||||||
call= rmp->mp_fs_call;
|
call= rmp->mp_fs_call;
|
||||||
|
if (call == PM_IDLE)
|
||||||
|
call= rmp->mp_fs_call2;
|
||||||
if (call == PM_IDLE)
|
if (call == PM_IDLE)
|
||||||
continue;
|
continue;
|
||||||
switch(call)
|
switch(call)
|
||||||
|
@ -605,6 +608,20 @@ PRIVATE void send_work()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PM_UNPAUSE:
|
case PM_UNPAUSE:
|
||||||
|
m.m_type= call;
|
||||||
|
m.PM_UNPAUSE_PROC= rmp->mp_endpoint;
|
||||||
|
|
||||||
|
/* FS does not reply */
|
||||||
|
rmp->mp_fs_call2= PM_IDLE;
|
||||||
|
|
||||||
|
/* Ask the kernel to deliver the signal */
|
||||||
|
r= sys_sigsend(rmp->mp_endpoint,
|
||||||
|
&rmp->mp_sigmsg);
|
||||||
|
if (r != OK)
|
||||||
|
panic(__FILE__,"sys_sigsend failed",r);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
case PM_UNPAUSE_TR:
|
case PM_UNPAUSE_TR:
|
||||||
m.m_type= call;
|
m.m_type= call;
|
||||||
m.PM_UNPAUSE_PROC= rmp->mp_endpoint;
|
m.PM_UNPAUSE_PROC= rmp->mp_endpoint;
|
||||||
|
@ -612,15 +629,6 @@ PRIVATE void send_work()
|
||||||
/* FS does not reply */
|
/* FS does not reply */
|
||||||
rmp->mp_fs_call= PM_IDLE;
|
rmp->mp_fs_call= PM_IDLE;
|
||||||
|
|
||||||
if (call == PM_UNPAUSE)
|
|
||||||
{
|
|
||||||
/* Ask the kernel to deliver the signal */
|
|
||||||
r= sys_sigsend(rmp->mp_endpoint,
|
|
||||||
&rmp->mp_sigmsg);
|
|
||||||
if (r != OK)
|
|
||||||
panic(__FILE__,"sys_sigsend failed",r);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PM_EXEC:
|
case PM_EXEC:
|
||||||
|
@ -675,6 +683,7 @@ PRIVATE void send_work()
|
||||||
if (m.m_type != PM_IDLE)
|
if (m.m_type != PM_IDLE)
|
||||||
{
|
{
|
||||||
if (rmp->mp_fs_call == PM_IDLE &&
|
if (rmp->mp_fs_call == PM_IDLE &&
|
||||||
|
rmp->mp_fs_call2 == PM_IDLE &&
|
||||||
(rmp->mp_flags & PM_SIG_PENDING))
|
(rmp->mp_flags & PM_SIG_PENDING))
|
||||||
{
|
{
|
||||||
rmp->mp_flags &= ~PM_SIG_PENDING;
|
rmp->mp_flags &= ~PM_SIG_PENDING;
|
||||||
|
|
|
@ -54,7 +54,8 @@ EXTERN struct mproc {
|
||||||
message mp_reply; /* reply message to be sent to one */
|
message mp_reply; /* reply message to be sent to one */
|
||||||
|
|
||||||
/* Communication with FS */
|
/* Communication with FS */
|
||||||
int mp_fs_call;
|
int mp_fs_call; /* Record the call for normal system calls */
|
||||||
|
int mp_fs_call2; /* Record the call for signals */
|
||||||
char *mp_exec_path; /* Path of executable */
|
char *mp_exec_path; /* Path of executable */
|
||||||
vir_bytes mp_exec_path_len; /* Length of path (including nul) */
|
vir_bytes mp_exec_path_len; /* Length of path (including nul) */
|
||||||
char *mp_exec_frame; /* Arguments */
|
char *mp_exec_frame; /* Arguments */
|
||||||
|
|
|
@ -420,7 +420,7 @@ int signo; /* signal to send to process (1 to _NSIG) */
|
||||||
signo, (rmp->mp_flags & ZOMBIE) ? "zombie" : "dead", slot);
|
signo, (rmp->mp_flags & ZOMBIE) ? "zombie" : "dead", slot);
|
||||||
panic(__FILE__,"", NO_NUM);
|
panic(__FILE__,"", NO_NUM);
|
||||||
}
|
}
|
||||||
if (rmp->mp_fs_call != PM_IDLE)
|
if (rmp->mp_fs_call != PM_IDLE || rmp->mp_fs_call2 != PM_IDLE)
|
||||||
{
|
{
|
||||||
sigaddset(&rmp->mp_sigpending, signo);
|
sigaddset(&rmp->mp_sigpending, signo);
|
||||||
rmp->mp_flags |= PM_SIG_PENDING;
|
rmp->mp_flags |= PM_SIG_PENDING;
|
||||||
|
@ -661,9 +661,18 @@ int for_trace; /* for tracing */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process is not hanging on an PM call. Ask FS to take a look. */
|
/* Process is not hanging on an PM call. Ask FS to take a look. */
|
||||||
if (rmp->mp_fs_call != PM_IDLE)
|
if (for_trace)
|
||||||
panic("pm", "unpause: not idle", rmp->mp_fs_call);
|
{
|
||||||
rmp->mp_fs_call= (for_trace ? PM_UNPAUSE_TR : PM_UNPAUSE);
|
if (rmp->mp_fs_call != PM_IDLE)
|
||||||
|
panic( __FILE__, "unpause: not idle", rmp->mp_fs_call);
|
||||||
|
rmp->mp_fs_call= PM_UNPAUSE_TR;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (rmp->mp_fs_call2 != PM_IDLE)
|
||||||
|
panic( __FILE__, "unpause: not idle", rmp->mp_fs_call2);
|
||||||
|
rmp->mp_fs_call2= PM_UNPAUSE;
|
||||||
|
}
|
||||||
r= notify(FS_PROC_NR);
|
r= notify(FS_PROC_NR);
|
||||||
if (r != OK) panic("pm", "unpause: unable to notify FS", r);
|
if (r != OK) panic("pm", "unpause: unable to notify FS", r);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue