public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>
To: linux-pm-qjLDD68F18O7TbgM5vRIOg@public.gmane.org
Cc: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>,
	"Yu, Luming" <luming.yu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Andrew Morton <akpm-LJ1TwQYPT6cQrrorzV6ljw@public.gmane.org>,
	ACPI devel
	<acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Linux Kernel List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [linux-pm] Re: swsusp: Not enough free pages
Date: Mon, 6 Jun 2005 19:02:33 +0200	[thread overview]
Message-ID: <200506061902.34304.rjw@sisk.pl> (raw)
In-Reply-To: <20050606103936.GA2520-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>

Hi,

On Monday, 6 of June 2005 12:39, Pavel Machek wrote:
> Hi!
> 
> > > > > So far, yes. I just tried 2 times.
> > > >
> > > > always. (I check that swap dev is on)
> > > >
> > > > Sometimes, my ia32 laptop free 0 pages too.
> > > > I think we should always free some pages
> > > > from various caches.
> > >
> > > Try this hack... it is basically mm problem I don't know how to fix,
> > > but this seems to help.
> > > 								Pavel
> > 
> > Thanks Pavel, this hack works.
> > ..
> > Freeing memory...  ^Hdone (0 pages freed)
> > Freeing memory...  ^H-^Hdone (4636 pages freed)
> > Freeing memory...  ^Hdone (0 pages freed)
> > Freeing memory...  ^H-^Hdone (914 pages freed)
> > Freeing memory...  ^Hdone (0 pages freed)
> > Freezing CPUs (at 0)...ok
> > 
> > Any mm guru know how to fix this?
> 
> Andrew, can you help? It seems free_some_memory does not really free
> all reclaimable memory in recent kernels. In fact, it likes to free
> nothing on first invocations....

Actually, on (my) x86-64 it seems to work.  It frees even more memory than
I'd like it to (there's 80-90% of RAM free after it's finished). ;-)

If I had to guess, I'd say the problem is related to PAGE_SIZE != 4096.

Greets,
Rafael


> Pausing and trying few times helps, but is *very* ugly.
> 								Pavel
> 
> > > Index: kernel/power/disk.c
> > > ===================================================================
> > > --- 805a02ec2bcff3671d7b1e701bd1981ad2fa196c/kernel/power/disk.c 
> > > (mode:100644) +++
> > > ecd8559cc08319bb16a42aac06cf7d664157643a/kernel/power/disk.c  (mode:100644)
> > > @@ -88,23 +92,25 @@
> > >
> > >  static void free_some_memory(void)
> > >  {
> > > -	unsigned int i = 0;
> > > -	unsigned int tmp;
> > > -	unsigned 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;
> > > +	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);
> > > +		msleep_interruptible(200);
> > >  	}
> > > -	printk("\bdone (%li pages freed)\n", pages);
> > >  }
> > >
> > > -
> > >  static inline void platform_finish(void)
> > >  {
> > >  	if (pm_disk_mode == PM_DISK_PLATFORM) {
> > 
> 
> > _______________________________________________
> > linux-pm mailing list
> > linux-pm-qjLDD68F18O7TbgM5vRIOg@public.gmane.org
> > http://lists.osdl.org/mailman/listinfo/linux-pm
> 
> 
> -- 
> 

-- 
- 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"


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20

  parent reply	other threads:[~2005-06-06 17:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-24 16:05 swsusp: Not enough free pages Yu, Luming
2005-05-24 16:55 ` Stefan Seyfried
     [not found]   ` <20050525012040.GA6145@linux.sh.intel.com>
2005-05-30  9:14     ` Yu, Luming
2005-05-30 15:01       ` Pavel Machek
     [not found]         ` <20050530150157.GC2207-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-05-30 17:01           ` James Sparenberg
2005-06-06  6:39         ` Yu, Luming
2005-06-06 10:39           ` [linux-pm] " Pavel Machek
     [not found]             ` <20050606103936.GA2520-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-06-06 17:02               ` Rafael J. Wysocki [this message]
2005-06-06 17:14                 ` Pavel Machek
2005-06-06 21:46                   ` Rafael J. Wysocki
2005-06-06 21:58                     ` Pavel Machek
     [not found]                       ` <20050606215815.GO2230-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-06-07 10:39                         ` [linux-pm] " Rafael J. Wysocki
     [not found]                           ` <200506071239.10125.rjw-KKrjLPT3xs0@public.gmane.org>
2005-06-08 15:02                             ` Rafael J. Wysocki
2005-06-08 16:27                               ` Pavel Machek
2005-06-08 21:42                                 ` [linux-pm] " Rafael J. Wysocki
2005-06-08 22:03                                   ` 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=200506061902.34304.rjw@sisk.pl \
    --to=rjw-kkrjlpt3xs0@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=akpm-LJ1TwQYPT6cQrrorzV6ljw@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pm-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=luming.yu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=pavel-+ZI9xUNit7I@public.gmane.org \
    /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