Skip to content

Commit

Permalink
PM / hibernate: Documentation: Fix script for unswapping
Browse files Browse the repository at this point in the history
System can have mmaped also character devices (e.g dri devices by X) or deleted
files. Running cat on character devices is really bad idea (system can hang) so
run cat only on regular files. Also mmaped files can have spaces in filenames.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
[rjw: Subject]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
pali authored and rafaeljw committed May 6, 2014
1 parent aa9abe2 commit 8a54cd5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Documentation/power/swsusp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ Q: After resuming, system is paging heavily, leading to very bad interactivity.

A: Try running

cat `cat /proc/[0-9]*/maps | grep / | sed 's:.* /:/:' | sort -u` > /dev/null
cat /proc/[0-9]*/maps | grep / | sed 's:.* /:/:' | sort -u | while read file
do
test -f "$file" && cat "$file" > /dev/null
done

after resume. swapoff -a; swapon -a may also be useful.

Expand Down

0 comments on commit 8a54cd5

Please sign in to comment.