[PATCH] stop swapoff 2/3 EINTR

Hugh Dickins (hugh@veritas.com)
Thu, 17 Apr 2003 21:47:25 +0100 (BST)


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/