public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@ucw.cz>
Cc: kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [RFT][PATCH 3/3] swsusp: improve freeing of memory
Date: Sun, 13 Nov 2005 23:27:33 +0100	[thread overview]
Message-ID: <200511132327.33877.rjw@sisk.pl> (raw)
In-Reply-To: <20051113211409.GD2119@elf.ucw.cz>

Hi,

On Sunday, 13 of November 2005 22:14, Pavel Machek wrote:
> Hi!
> 
> > This patch makes swsusp free only as much memory as needed and not as much
> > as possible.
> 
> Looks okay to me. ACK, modulo few small things.
> 
> > -
> >  /* References to section boundaries */
> >  extern const void __nosave_begin, __nosave_end;
> >  
> >  extern unsigned int nr_copy_pages;
> > -extern suspend_pagedir_t *pagedir_nosave;
> > -extern suspend_pagedir_t *pagedir_save;
> > +extern struct pbe *pagedir_nosave;
> > +
> > +/*
> > + * This compilation switch determines the way in which memory will be freed
> > + * during suspend.  If defined, only as much memory will be freed as needed
> > + * to complete the suspend.  Otherwise, the largest possible amount of memory
> > + * will be freed.
> > + */
> > +#define OPPORTUNISTIC_SHRINKING		1
> 
> Can you use little less tabelators? Also shorter name for this one
> might be "FREE_ALL". 

OK

> > +/*
> > + * During suspend, on each attempt to free some more memory SHRINK_BITE
> > + * is used as the number of pages to free
> > + */
> > +#define SHRINK_BITE	10000
> 
> Does this really need this kind of visibility? There's nothing user
> should tweak here.

By setting this to a smaller value you can make swsusp free more memory
sometimes, but of course it need not be visible.  I'll move it to swsusp.c

> >  /**
> > + *	On resume it is necessary to trace and eventually free the unsafe
> > + *	pages that have been allocated, because they are needed for I/O
> > + *	(on x86-64 we likely will "eat" these pages once again while
> > + *	creating the temporary page translation tables)
> > + */
> > +
> > +struct eaten_page {
> > +	struct eaten_page	*next;
> > +	char			padding[PAGE_SIZE - sizeof(void *)];
> > +};
> 
> Less tabelators here, please...

OK

Greetings,
Rafael


      reply	other threads:[~2005-11-13 22:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-12 20:13 [RFT][PATCH 0/3] swsusp: improve freeing of memory Rafael J. Wysocki
2005-11-12 20:19 ` [RFT][PATCH 1/3] swsusp: remove encryption Rafael J. Wysocki
2005-11-12 23:42   ` Pavel Machek
2005-11-12 20:22 ` [RFT][PATCH 2/3] swsusp: introduce the swap map structure Rafael J. Wysocki
2005-11-13 21:16   ` Pavel Machek
2005-11-13 22:33     ` Rafael J. Wysocki
2005-11-12 20:24 ` [RFT][PATCH 3/3] swsusp: improve freeing of memory Rafael J. Wysocki
2005-11-13 21:14   ` Pavel Machek
2005-11-13 22:27     ` Rafael J. Wysocki [this message]

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=200511132327.33877.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.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