]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
PM / hibernate: Documentation: Fix script for unswapping
authorPali Rohár <pali.rohar@gmail.com>
Tue, 6 May 2014 11:01:56 +0000 (13:01 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 6 May 2014 23:51:16 +0000 (01:51 +0200)
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>
Documentation/power/swsusp.txt

index 079160e22bcc0d1bf24be8b07bd93e5b2265970c..f732a8321e8a75274a308bf6a6220a588cf00780 100644 (file)
@@ -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.