From: Pavel Machek <pavel@ucw.cz>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Linux PM <linux-pm@osdl.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH -mm] swsusp: use less memory during resume
Date: Tue, 18 Apr 2006 15:07:55 +0200 [thread overview]
Message-ID: <20060418130755.GB26668@elf.ucw.cz> (raw)
In-Reply-To: <200604181319.47400.rjw@sisk.pl>
[-- Attachment #1: Type: text/plain, Size: 1576 bytes --]
Hi!
> Currently during resume swsusp puts the image data in the page frames that
> don't conflict with the original locations of the data (ie. the locations the
> data will be put in when the saved system state is restored from the image).
> These page frames are considered as "safe" and the other page frames are
> treadet as "unsafe".
>
> Of course we cannot force the memory allocator to allocate "safe" pages only,
> so if an "unsafe" page is allocated, swsusp treats it as an "eaten page" and
> attempts to allocate another page in the hope that it'll be "safe" etc.
> swsusp tries to allocate as many "safe" pages as necessary to store the
> image data, so it "eats" a considerable number of "unsafe" pages in the
> process. Next, it reads the image and puts the data into the allocated "safe"
> pages. Finally, the data are copied to their "original" locations.
>
> This approach, although it works nicely, is quite inefficient from the memory
> utilization point of view and it also turns out to be unnecessary. Namely,
> for each "unsafe" page frame returned by the memory allocator there's exactly
> one page in the image that finally should be placed in this page frame.
> Therefore we can put the right data into this page frame as soon as they're
> read from the image and we won't have to copy these data later on. This way
> we'll only need to allocate as many pages as necessary to store the image
> data and we won't have to "eat" the "unsafe" pages.
Looks good to me. Clever hack, I'd say.
Pavel
--
Thanks for all the (sleeping) penguins.
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
prev parent reply other threads:[~2006-04-18 13:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-18 11:19 [RFC][PATCH -mm] swsusp: use less memory during resume Rafael J. Wysocki
2006-04-18 13:07 ` Nigel Cunningham
2006-04-19 8:05 ` Rafael J. Wysocki
2006-04-19 8:31 ` [linux-pm] " Nigel Cunningham
2006-04-20 10:05 ` Rafael J. Wysocki
2006-04-18 13:07 ` Pavel Machek [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=20060418130755.GB26668@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@osdl.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