Skip to content

Commit 8a54cd5

Browse files
palirafaeljw
authored andcommitted
PM / hibernate: Documentation: Fix script for unswapping
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>
1 parent aa9abe2 commit 8a54cd5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Documentation/power/swsusp.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,10 @@ Q: After resuming, system is paging heavily, leading to very bad interactivity.
220220

221221
A: Try running
222222

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

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

0 commit comments

Comments
 (0)