iowait:introduce pieces for iowait, also other bits for inode sleep
authorAlan Cox <alan@linux.intel.com>
Mon, 26 Mar 2018 19:52:38 +0000 (20:52 +0100)
committerAlan Cox <alan@linux.intel.com>
Mon, 26 Mar 2018 19:52:38 +0000 (20:52 +0100)
Applications/util/ps.c
Kernel/include/kernel.h

index b479ec9..3505aff 100644 (file)
@@ -17,11 +17,12 @@ int flags;
 char *mapstat(char s)
 {
     switch (s) {
-       case P_ZOMBIE: return "Defunct";
+       case P_ZOMBIE:  return "Defunct";
        case P_FORKING: return "Forking";
        case P_RUNNING: return "Running";
        case P_READY:   return "Ready";
        case P_SLEEP:   return "Asleep";
+       case P_IOWAIT:  return "I/O Wait";
        case P_STOPPED: return "Stopped";
     }
     return "?";
index 3eef225..f30a679 100644 (file)
@@ -291,6 +291,9 @@ typedef struct cinode {
 #define CFLOCK         0x0F    /* flock bits */
 #define CFLEX          0x0F    /* locked exclusive */
 #define CFMAX          0x0E    /* highest shared lock count permitted */
+#ifdef CONFIG_BLOCK_SLEEP
+   uint16_t    c_lock;         /* inode lock state */
+#endif
 } cinode, *inoptr;
 
 #define NULLINODE ((inoptr)NULL)
@@ -354,10 +357,11 @@ struct mount {
 /* The sleeping range must be together see swap.c */
 #define P_READY         2    /* Runnable   */
 #define P_SLEEP         3    /* Sleeping; can be awakened by signal */
-#define P_STOPPED       4    /* Sleeping, don't wake up for signal */
-#define P_FORKING       5    /* In process of forking; do not mess with */
-#define P_ZOMBIE        6    /* Exited. */
-#define P_NOSLEEP      7    /* In an internal state where sleep is forbidden */
+#define P_IOWAIT       4    /* Sleeping: don't wake for a signal */
+#define P_STOPPED       5    /* Sleeping, signal driven halt */
+#define P_FORKING       6    /* In process of forking; do not mess with */
+#define P_ZOMBIE        7    /* Exited. */
+#define P_NOSLEEP      8    /* In an internal state where sleep is forbidden */
 
 
 /* 0 is used to mean 'check we could signal this process' */
@@ -902,6 +906,7 @@ extern unsigned int ugetblk(bufptr bp, usize_t from, usize_t size);
 
 /* process.c */
 extern void psleep(void *event);
+extern void psleep_nosig(void *event);
 extern void wakeup(void *event);
 extern void pwake(ptptr p);
 extern ptptr getproc(void);