From: Pavel Machek <pavel@ucw.cz>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Andy Isaacson <adi@hexapodia.org>, linux-kernel@vger.kernel.org
Subject: swsusp: how much memory to free? [was Re: swsusp performance problems in 2.6.15-rc3-mm1]
Date: Tue, 6 Dec 2005 00:55:01 +0100 [thread overview]
Message-ID: <20051205235501.GC1770@elf.ucw.cz> (raw)
In-Reply-To: <200512052218.18769.rjw@sisk.pl>
Hi!
> > > Now that I'm running 2.6.15-rc3-mm1, the page-in problem seems to be
> > > largely gone; I don't notice a significant lagginess after resuming from
> > > swsusp.
> > >
> > > But the suspend process is *slow*. It takes a good 20 or 30 seconds to
> > > write out the image, which makes the overall suspend process take close
> > > to a minute; it's writing about 400 MB, and my disk seems to only be
> > > good for about 18 MB/sec according to hdparm -t.
> >
> > Lets say 20 seconds suspend, plus 20 seconds resume, and no time
> > needed to switch the desktops. So it is ~40 seconds total, again ;-).
>
> I think there's no point in doing such calculations. In fact, above certain
> critical RAM size (call it X), the more RAM in the box, the _worse_ it gets when
> we try to free as little memory as possible (let alone trying to save _all_
> of it). The only question is how great is X.
Agreed. And X depends on workload.
Several approaches make sense.
(Y is size of image. Obviously Y < half of ram and Y > some minimum
ammount of kernel data. My approach is Y as low as possible, your
approach is Y as high as possible.).
1) Try to make Y as much as possible, but 500MB max. Common user
workloads fit into 500MB, so user should get responsive system after
resume, but we'll not write excessive ammounts of data.
2) Only free memory that was not used in last 10 minutes. That should
keep system responsive enough after resume.
> > Should be easy, mergeable and possibly very effective. Relevant code
> > is in kernel/power/disk.c.
>
> For this purpose we'll need to tamper with mm, I think, and that won't be
> easy.
>
> OTOH, we can get similar result by just making the kernel free some
> more memory _after_ we are sure we have enough memory to suspend.
> IOW, after the code that's currently in swsusp_shrink_memory() has finished,
> we can try to free some "extra" memory to improve performance, if
> needed. The question is how much "extra" memory should be freed and
> I'm afraid it will have to be tuned on the per-system, or at least
> per-RAM-size, basis.
I'd prefer not to have extra tunables. "Write only 500MB" will work
okay for common desktop users -- as long as common desktop fits into
500MB, that is. "Free not used in last 10 minutes" should work okay
for everyone, but may be slightly harder to implement.
Pavel
--
Thanks, Sharp!
next prev parent reply other threads:[~2005-12-05 23:55 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-05 8:19 swsusp performance problems in 2.6.15-rc3-mm1 Andy Isaacson
2005-12-05 12:17 ` Pavel Machek
2005-12-05 13:58 ` Nigel Cunningham
2005-12-05 17:29 ` Pavel Machek
2005-12-05 21:11 ` Nigel Cunningham
2005-12-05 23:34 ` Pavel Machek
2005-12-06 1:26 ` Nigel Cunningham
2005-12-06 1:52 ` Pavel Machek
2005-12-05 22:44 ` Rafael J. Wysocki
2005-12-06 0:01 ` Pavel Machek
2005-12-05 22:28 ` Rafael J. Wysocki
2005-12-06 1:07 ` Nigel Cunningham
2005-12-06 1:37 ` Pavel Machek
2005-12-06 1:47 ` Andy Isaacson
2005-12-06 1:56 ` IDE performance on notebooks [was Re: swsusp performance problems in 2.6.15-rc3-mm1] Pavel Machek
2005-12-06 6:23 ` Andy Isaacson
2005-12-06 11:56 ` Pavel Machek
2005-12-06 1:57 ` swsusp performance problems in 2.6.15-rc3-mm1 Nigel Cunningham
2005-12-06 3:50 ` Mark Lord
2005-12-06 15:03 ` Mark Lord
2005-12-06 2:02 ` Nigel Cunningham
2005-12-06 12:09 ` Pavel Machek
2005-12-06 1:36 ` Nigel Cunningham
2005-12-06 2:06 ` Andy Isaacson
2005-12-06 2:21 ` Nigel Cunningham
2005-12-06 14:22 ` Pavel Machek
2005-12-07 22:05 ` Nigel Cunningham
2005-12-07 22:23 ` Pavel Machek
2005-12-06 2:21 ` Nigel Cunningham
2005-12-06 12:18 ` Pavel Machek
2005-12-06 18:15 ` Andy Isaacson
2005-12-07 1:05 ` Rafael J. Wysocki
2005-12-07 1:10 ` Pavel Machek
2005-12-07 11:17 ` Rafael J. Wysocki
2005-12-07 11:30 ` Pavel Machek
2005-12-08 22:42 ` Rafael J. Wysocki
2005-12-08 22:50 ` Pavel Machek
2005-12-05 21:18 ` Rafael J. Wysocki
2005-12-05 23:55 ` Pavel Machek [this message]
2005-12-07 11:53 ` swsusp: how much memory to free? [was Re: swsusp performance problems in 2.6.15-rc3-mm1] Rafael J. Wysocki
2005-12-07 11:59 ` Pavel Machek
2005-12-07 12:16 ` Rafael J. Wysocki
2005-12-07 12:18 ` Pavel Machek
2005-12-05 23:05 ` swsusp performance problems in 2.6.15-rc3-mm1 Rafael J. Wysocki
2005-12-06 0:12 ` Andy Isaacson
2005-12-06 0:51 ` Pavel Machek
2005-12-10 22:21 ` Andrew Morton
2005-12-10 23:07 ` Rafael J. Wysocki
2005-12-10 23:33 ` Andrew Morton
2005-12-11 12:16 ` Rafael J. Wysocki
2005-12-11 23:28 ` Pavel Machek
2005-12-12 17:45 ` 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=20051205235501.GC1770@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=adi@hexapodia.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
/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