All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@suse.cz>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@zip.com.au>,
	agruen@suse.de
Subject: Re: swsusp: 8-order memory allocations problem (was: Re: Fix random crashes in x86-64 swsusp)
Date: Wed, 13 Oct 2004 19:24:34 +0200	[thread overview]
Message-ID: <200410131924.34337.rjw@sisk.pl> (raw)
In-Reply-To: <20041010134846.GD19831@elf.ucw.cz>

Hi,

On Sunday 10 of October 2004 15:48, Pavel Machek wrote:
[-- snip --] 
> > It's sort of strange, because there were 250 meg of RAM available,
> > out of 500, at that time.
> 
> Well, you have 250MB free, but apparently not enough contignuous free 
pages...
> 
> You may try this one, it may reduce probability of this kind of
> failure...
> 
> 							Pavel
> 
> --- clean/kernel/power/disk.c	2004-10-01 00:30:32.000000000 +0200
> +++ linux/kernel/power/disk.c	2004-10-02 19:43:06.000000000 +0200
> @@ -85,13 +89,26 @@
>  
>  static void free_some_memory(void)
>  {
> -	printk("Freeing memory: ");
> -	while (shrink_all_memory(10000))
> -		printk(".");
> -	printk("|\n");
> +	int i;
> +	for (i=0; i<5; i++) {
> +		int i = 0, tmp;
> +		long pages = 0;
> +		char *p = "-\\|/";
> +
> +		printk("Freeing memory...  ");
> +		while ((tmp = shrink_all_memory(10000))) {
> +			pages += tmp;
> +			printk("\b%c", p[i]);
> +			i++;
> +			if (i > 3)
> +				i = 0;
> +		}
> +		printk("\bdone (%li pages freed)\n", pages);
> +		current->state = TASK_INTERRUPTIBLE;
> +		schedule_timeout(HZ/5);
> +	}
>  }
>  
> -
>  static inline void platform_finish(void)
>  {
>  	if (pm_disk_mode == PM_DISK_PLATFORM) {
> -- 

I'm giving it a try.  Without this patch I get an 8-order allocation failure 
almost every time after using a computer for a day.  This one is pretty 
scary, IMO (there are 5 times more pages free than needed to be copied and 
still it cannot allocate enough memory):

Stopping tasks: ============================================================|
Freeing 
memory: .............................................................................................................|
PM: Attempting to suspend to disk.
PM: snapshotting memory.
swsusp: critical section:
..<7>[nosave pfn 
0x58d].........................................................................................................
..swsusp: Need to copy 21035 pages
suspend: (pages needed: 21035 + 512 free: 109844)
hibernate.sh: page allocation failure. order:8, mode:0x120
Oct 13 17:57:34 albercik kernel:
Call Trace:<ffffffff8016ec2d>{__alloc_pages+749} 
<ffffffff8016ecd1>{__get_free_pages+33}
       <ffffffff80161b93>{suspend_prepare_image+531} 
<ffffffff8026e977>{pci_device_suspend+71}
       <ffffffff80161e26>{swsusp_swap_check+22} 
<ffffffff802eae02>{suspend_device+50}
       <ffffffff80120dec>{swsusp_arch_suspend+124} 
<ffffffff8016123c>{swsusp_suspend+12}
       <ffffffff8016239a>{pm_suspend_disk+90} 
<ffffffff8015ff54>{enter_state+68}
       <ffffffff802aed4d>{acpi_system_write_sleep+100} 
<ffffffff80194b24>{vfs_write+228}
       <ffffffff80194c63>{sys_write+83} <ffffffff80110c72>{system_call+126}
Oct 13 17:57:41 albercik kernel:
suspend: Allocating pagedir failed.

Greets,
RJW

-- 
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
		-- Lewis Carroll "Alice's Adventures in Wonderland"

  parent reply	other threads:[~2004-10-13 17:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-05 21:14 2.6.9-rc3[+recent swsusp patches]: swsusp kernel-preemption-unfriendly? Rafael J. Wysocki
2004-10-05 21:27 ` Pavel Machek
2004-10-06  8:55   ` Rafael J. Wysocki
2004-10-06  8:54     ` Pavel Machek
2004-10-06 10:06       ` Rafael J. Wysocki
2004-10-06 10:12         ` Pavel Machek
2004-10-06 21:46           ` Rafael J. Wysocki
2004-10-06 22:06             ` Fix random crashes in x86-64 swsusp Pavel Machek
2004-10-06 22:13               ` [kernel] " Andi Kleen
2004-10-06 22:25               ` Andrew Morton
2004-10-06 22:24                 ` Pavel Machek
2004-10-08 20:59               ` swsusp: 8-order memory allocations problem (was: Re: Fix random crashes in x86-64 swsusp) Rafael J. Wysocki
2004-10-10 13:48                 ` Pavel Machek
2004-10-10 18:28                   ` Andrew Morton
2004-10-13 17:24                   ` Rafael J. Wysocki [this message]
2004-10-14 15:37                     ` swsusp: 8-order memory allocations problem (update) Rafael J. Wysocki

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=200410131924.34337.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=agruen@suse.de \
    --cc=akpm@zip.com.au \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.