[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1399374116-12400-1-git-send-email-pali.rohar@gmail.com>
Date: Tue, 6 May 2014 13:01:56 +0200
From: Pali Rohár <pali.rohar@...il.com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
Randy Dunlap <rdunlap@...radead.org>
Cc: linux-pm@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org,
Pali Rohár <pali.rohar@...il.com>
Subject: [PATCH] Documentation: power: swsusp: 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@...il.com>
---
Documentation/power/swsusp.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt
index 079160e..f732a83 100644
--- a/Documentation/power/swsusp.txt
+++ b/Documentation/power/swsusp.txt
@@ -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.
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists