From: Pavel Machek <pavel@ucw.cz>
To: Andrew Morton <akpm@digeo.com>
Cc: Pavel Machek <pavel@ucw.cz>,
William Lee Irwin III <wli@holomorphy.com>,
kernel list <linux-kernel@vger.kernel.org>
Subject: Re: Hot/cold allocation -- swsusp can not handle hot pages
Date: Sun, 3 Nov 2002 21:26:36 +0100 [thread overview]
Message-ID: <20021103202636.GD22668@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <3DC58563.94BAE24C@digeo.com>
Hi!
> > ...
> > "big-picture" should be in Documentation/swsusp.txt...
> >
> > *Should* be :-(. I need to copy all used memory, to make sure my
> > snapshot is atomic.
> >
> > Copying works by looking at what is allocated, counting needed pages,
> > allocating 'directory' for them, allocating memory for copies, and
> > actually copying.
>
> Ah. I see.
>
> > When I suddenly find I have less data to copy than I thought, it
> > screws up the code.
>
> Having a less-than-expected amount to copy sounds like it can
> be safely handled?
It means I have to kill some sanity checks and complicate things a
little bit. Yes it can be done.
> > > I'm not really sure what to suggest here. Emptying the per-cpu
> > > page pools would be tricky. Maybe a swsusp-special page allocator
> > > which goes direct to the buddy lists or something.
> >
> > Well, see the patch above. That seems to do the trick for
> > me. It seems that even "cold" allocation can give page from per-cpu
> > pool. I thought that was a bug?
>
> There are two queues per cpu. cache-warm pages and cache-cold
> pages. The cold queue is mainly for lock amortisation, to avoid
> taking the zone lock once per page. But we can also allocate
> from the cold queue for situations where we'll be invalidating the
> cache anyway (file readahead). We don't want to waste cache-hot
> pages. Your change breaks that.
I thought I was making it go to "cold" pages when user requested it,
not to hot ones, but I did not read the code too much.
Pavel
--
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.
next prev parent reply other threads:[~2002-11-03 20:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-02 18:19 Pavel Machek
2002-11-02 18:46 ` William Lee Irwin III
2002-11-02 20:22 ` Pavel Machek
2002-11-02 21:48 ` Andrew Morton
2002-11-03 20:08 ` Pavel Machek
2002-11-03 20:14 ` William Lee Irwin III
2002-11-03 20:21 ` Andrew Morton
2002-11-03 20:26 ` Pavel Machek [this message]
2002-11-03 20:52 ` William Lee Irwin III
2002-11-03 21:22 ` William Lee Irwin III
2002-11-03 22:53 ` 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=20021103202636.GD22668@atrey.karlin.mff.cuni.cz \
--to=pavel@ucw.cz \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=wli@holomorphy.com \
/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
all inboxes | Powered by JetHome®