]> Zhao Yanbai Git Server - minix.git/commitdiff
Unpause requests (to FS) can be generated in parallel to other requests.
authorPhilip Homburg <philip@cs.vu.nl>
Mon, 15 May 2006 12:06:19 +0000 (12:06 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Mon, 15 May 2006 12:06:19 +0000 (12:06 +0000)
servers/pm/main.c
servers/pm/mproc.h
servers/pm/signal.c

index 62aa53beba5908986b0659fac5809e190ed35e6a..22b973ae4ac26070e2ace0ae88c7e5e34f76a794 100644 (file)
@@ -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;
index 1c9543d921e3ab34f8fdce54a69a2adb76501616..c99dd33cfbe4feafbc7d84e818a20499371953bb 100644 (file)
@@ -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 */
index c3ae020de3c91fefd7390b80f26294972dc4d18c..6332a12eff4f30e4243edaffa6b3421e3c4a3200 100644 (file)
@@ -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);
 }