From patchwork Tue May 6 11:01:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 4120331 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 38260BFF02 for ; Tue, 6 May 2014 11:02:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 69FEE201FB for ; Tue, 6 May 2014 11:02:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A87F201EF for ; Tue, 6 May 2014 11:02:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934686AbaEFLCg (ORCPT ); Tue, 6 May 2014 07:02:36 -0400 Received: from mail-ee0-f41.google.com ([74.125.83.41]:54881 "EHLO mail-ee0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934579AbaEFLCf (ORCPT ); Tue, 6 May 2014 07:02:35 -0400 Received: by mail-ee0-f41.google.com with SMTP id t10so2715965eei.28 for ; Tue, 06 May 2014 04:02:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=HoFQ0wRXfSwy0Qu/z6a7Ft+uNry/LlbgHRxY6nHdPNU=; b=PBD+UBn4tomeCGvIV5FzMlB383iOt0bGR8DBAvz2+GpXkxgjlGlqEaUUg4Enopgfjn qTa5rR8hF7fgKv6D8IOG0Bsl6aBmZWqHTzQvgErjNkme6BDrCkgijEqk4kk9JAPplw4s ursUVZNTo3jzTrnZQaUrd5bgcxjTR60m6kw1UsTjaAUXKlgvHW8oWSBSkonRY2lVxmtq f9ypAQLVYFCOuOPV0Pl+gL8F3esFYa7aH1nd2Oz9g24VUgn9oiikAQjOK7NIkbYM/viO KZfG2+HeaheV89wt8VwoFdlXjdlZeFTEBLCs5oUN7A3yIhQa10xJAh09NYi6zTM6afSO ceyg== X-Received: by 10.14.108.198 with SMTP id q46mr8652071eeg.31.1399374153869; Tue, 06 May 2014 04:02:33 -0700 (PDT) Received: from Pali-Latitude.ms.mff.cuni.cz (eduroam11.ms.mff.cuni.cz. [195.113.16.11]) by mx.google.com with ESMTPSA id u46sm37566682eel.1.2014.05.06.04.02.29 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 May 2014 04:02:32 -0700 (PDT) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Randy Dunlap Cc: linux-pm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH] Documentation: power: swsusp: Fix script for unswapping Date: Tue, 6 May 2014 13:01:56 +0200 Message-Id: <1399374116-12400-1-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Pavel Machek --- 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.