[PATCH] stop swapoff 2/3 EINTR

From: Hugh Dickins (hugh@veritas.com)
Date: Thu Apr 17 2003 - 15:47:25 EST


Sometimes you start a swapoff and, seeing how long it takes,
wish you had not: allow signal to interrupt and stop swapoff.

--- swapoff1/mm/swapfile.c Thu Apr 17 18:32:40 2003
+++ swapoff2/mm/swapfile.c Thu Apr 17 18:32:50 2003
@@ -592,6 +592,11 @@
          * to swapoff for a while, then reappear - but that is rare.
          */
         while ((i = find_next_to_unuse(si, i))) {
+ if (signal_pending(current)) {
+ retval = -EINTR;
+ break;
+ }
+
                 /*
                  * Get a page for the entry, using the existing swap
                  * cache page if there is one. Otherwise, get a clean
@@ -761,8 +766,7 @@
 
                 /*
                  * Make sure that we aren't completely killing
- * interactive performance. Interruptible check on
- * signal_pending() would be nice, but changes the spec?
+ * interactive performance.
                  */
                 cond_resched();
         }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Apr 23 2003 - 22:00:22 EST