mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Andrew Morton <akpm@osdl.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Pavel Machek <pavel@suse.cz>
Subject: [PATCH 1/2][Fix][mm] swsusp: fix counting of highmem pages
Date: Sun, 4 Dec 2005 23:49:13 +0100	[thread overview]
Message-ID: <200512042349.13588.rjw@sisk.pl> (raw)
In-Reply-To: <200512042346.11731.rjw@sisk.pl>

This patch fixes a problem with swsusp that causes suspend to
fail on systems with the highmem zone, if many highmem pages are in use.

The patch makes swsusp count the non-free highmem pages in a correct way
and, consequently, release a sufficient amount of memory before suspend.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

 kernel/power/swsusp.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6.15-rc3-mm1/kernel/power/swsusp.c
===================================================================
--- linux-2.6.15-rc3-mm1.orig/kernel/power/swsusp.c	2005-12-04 14:24:10.000000000 +0100
+++ linux-2.6.15-rc3-mm1/kernel/power/swsusp.c	2005-12-04 14:42:08.000000000 +0100
@@ -635,7 +635,8 @@
 	printk("Shrinking memory...  ");
 	do {
 #ifdef FAST_FREE
-		tmp = count_data_pages() + count_highmem_pages();
+		tmp = 2 * count_highmem_pages();
+		tmp += tmp / 50 + count_data_pages();
 		tmp += (tmp + PBES_PER_PAGE - 1) / PBES_PER_PAGE +
 			PAGES_FOR_IO;
 		for_each_zone (zone)


  reply	other threads:[~2005-12-04 23:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-04 22:46 [PATCH 0/2][Fix][mm] swsusp: fix handling of highmem Rafael J. Wysocki
2005-12-04 22:49 ` Rafael J. Wysocki [this message]
2005-12-04 23:00 ` [PATCH 2/2][Fix][mm] swsusp: fix enough_free_mem Rafael J. Wysocki
2005-12-04 23:41 ` [PATCH 0/2][Fix][mm] swsusp: fix handling of highmem Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200512042349.13588.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®