Commit 6bf11a46 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Permit interruption of swapoff

From: Hugh Dickins <hugh@veritas.com>

Sometimes you start a swapoff and, seeing how long it takes, wish you had
not: allow signal to interrupt and stop swapoff.
parent 464f4e78
...@@ -590,6 +590,11 @@ static int try_to_unuse(unsigned int type) ...@@ -590,6 +590,11 @@ static int try_to_unuse(unsigned int type)
* to swapoff for a while, then reappear - but that is rare. * to swapoff for a while, then reappear - but that is rare.
*/ */
while ((i = find_next_to_unuse(si, i))) { 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 * Get a page for the entry, using the existing swap
* cache page if there is one. Otherwise, get a clean * cache page if there is one. Otherwise, get a clean
...@@ -759,8 +764,7 @@ static int try_to_unuse(unsigned int type) ...@@ -759,8 +764,7 @@ static int try_to_unuse(unsigned int type)
/* /*
* Make sure that we aren't completely killing * Make sure that we aren't completely killing
* interactive performance. Interruptible check on * interactive performance.
* signal_pending() would be nice, but changes the spec?
*/ */
cond_resched(); cond_resched();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment