From: Hugh Dickins Sometimes you start a swapoff and, seeing how long it takes, wish you had not: allow signal to interrupt and stop swapoff. 25-akpm/mm/swapfile.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff -puN mm/swapfile.c~interruptible-swapoff mm/swapfile.c --- 25/mm/swapfile.c~interruptible-swapoff Thu Apr 17 15:03:05 2003 +++ 25-akpm/mm/swapfile.c Thu Apr 17 15:03:05 2003 @@ -591,6 +591,11 @@ static int try_to_unuse(unsigned int typ * 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 @@ -760,8 +765,7 @@ static int try_to_unuse(unsigned int typ /* * 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(); } _