From c9ff3994f17ef1e3704edd369d5184a296965d3a Mon Sep 17 00:00:00 2001 From: Philip Homburg Date: Mon, 15 May 2006 12:06:19 +0000 Subject: [PATCH] Unpause requests (to FS) can be generated in parallel to other requests. --- servers/pm/main.c | 27 ++++++++++++++++++--------- servers/pm/mproc.h | 3 ++- servers/pm/signal.c | 17 +++++++++++++---- 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/servers/pm/main.c b/servers/pm/main.c index 62aa53beb..22b973ae4 100644 --- a/servers/pm/main.c +++ b/servers/pm/main.c @@ -216,6 +216,7 @@ PRIVATE void pm_init() tmr_inittimer(&rmp->mp_timer); 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 @@ -518,6 +519,8 @@ PRIVATE void send_work() for (rmp= mproc; rmp < &mproc[NR_PROCS]; rmp++) { call= rmp->mp_fs_call; + if (call == PM_IDLE) + call= rmp->mp_fs_call2; if (call == PM_IDLE) continue; switch(call) @@ -605,6 +608,20 @@ PRIVATE void send_work() break; 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: m.m_type= call; m.PM_UNPAUSE_PROC= rmp->mp_endpoint; @@ -612,15 +629,6 @@ PRIVATE void send_work() /* FS does not reply */ 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; case PM_EXEC: @@ -675,6 +683,7 @@ PRIVATE void send_work() if (m.m_type != 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; diff --git a/servers/pm/mproc.h b/servers/pm/mproc.h index 1c9543d92..c99dd33cf 100644 --- a/servers/pm/mproc.h +++ b/servers/pm/mproc.h @@ -54,7 +54,8 @@ EXTERN struct mproc { message mp_reply; /* reply message to be sent to one */ /* 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 */ vir_bytes mp_exec_path_len; /* Length of path (including nul) */ char *mp_exec_frame; /* Arguments */ diff --git a/servers/pm/signal.c b/servers/pm/signal.c index c3ae020de..6332a12ef 100644 --- a/servers/pm/signal.c +++ b/servers/pm/signal.c @@ -420,7 +420,7 @@ int signo; /* signal to send to process (1 to _NSIG) */ signo, (rmp->mp_flags & ZOMBIE) ? "zombie" : "dead", slot); 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); 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. */ - if (rmp->mp_fs_call != PM_IDLE) - panic("pm", "unpause: not idle", rmp->mp_fs_call); - rmp->mp_fs_call= (for_trace ? PM_UNPAUSE_TR : PM_UNPAUSE); + if (for_trace) + { + 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); if (r != OK) panic("pm", "unpause: unable to notify FS", r); } -- 2.44.0