From: Nigel Cunningham <nigel@suspend2.net>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>,
LKML <linux-kernel@vger.kernel.org>, Pavel Machek <pavel@ucw.cz>,
Linux PM <linux-pm@osdl.org>
Subject: Re: [RFC][PATCH] swsusp: support creating bigger images
Date: Wed, 26 Apr 2006 08:24:55 +1000 [thread overview]
Message-ID: <200604260825.04867.nigel@suspend2.net> (raw)
In-Reply-To: <200604260021.08888.rjw@sisk.pl>
[-- Attachment #1.1: Type: text/plain, Size: 3208 bytes --]
Hi.
On Wednesday 26 April 2006 08:21, Rafael J. Wysocki wrote:
> On Tuesday 25 April 2006 23:18, Nigel Cunningham wrote:
> > On Wednesday 26 April 2006 07:12, Rafael J. Wysocki wrote:
> > > On Tuesday 25 April 2006 22:32, Pavel Machek wrote:
> > > > > > > -unsigned int count_data_pages(void)
> > > > > > >
> > > > > > > +/**
> > > > > > > + * need_to_copy - determine if a page needs to be copied
> > > > > > > before saving. + * Returns false if the page can be saved
> > > > > > > without copying. + */
> > > > > > > +
> > > > > > > +static int need_to_copy(struct page *page)
> > > > > > > +{
> > > > > > > + if (!PageLRU(page) || PageCompound(page))
> > > > > > > + return 1;
> > > > > > > + if (page_mapped(page))
> > > > > > > + return page_mapped_by_current(page);
> > > > > > > +
> > > > > > > + return 1;
> > > > > > > +}
> > > > > >
> > > > > > I'd much rather VM internal type stuff get moved *out* of
> > > > > > kernel/power :(
> > > > >
> > > > > Well, I kind of agree, but I don't know where to place it under
> > > > > mm/.
> > > > >
> > > > > > It needs more comments too. Also, how important is it for the
> > > > > > page to be off the LRU?
> > > > >
> > > > > Hm, I'm not sure if that's what you're asking about, but the pages
> > > > > off the LRU are handled in a usual way, ie. copied when
> > > > > snapshotting the system. The pages _on_ the LRU may be included in
> > > > > the snapshot image without copying, but I require them additionally
> > > > > to be (a) mapped by someone and (b) not mapped by the current task.
> > > >
> > > > Why do you _want_ them mapped by someone?
> > >
> > > Because this means they belong to a task that is frozen and won't touch
> > > them (of course unless it's us). The kernel has no reason to access
> > > them either (even after we resume devices) except for reclaiming, but
> > > that's handled explicitly. Thus it's safe to include them in the image
> > > without copying.
> > >
> > > As I said before, I think the page cache pages may be treated this way
> > > too. It probably applies to all of the LRU pages, but there may be some
> > > corner cases. The mapped pages are just easy to single out.
> >
> > It does apply to all of the LRU pages. This is what I've been doing for
> > years now. The only corner case I've come across is XFS. It still wants
> > to write data even when there's nothing to do and it's threads are frozen
> > (IIRC - haven't looked at it for a while). I got around that by freezing
> > bdevs when freezing processes.
>
> This means if we freeze bdevs, we'll be able to save all of the LRU pages,
> except for the pages mapped by the current task, without copying. I think
> we can try to do this, but we'll need a patch to freeze bdevs for this
> purpose. ;-)
Isn't that a coincidence? I just happen to have the code right here! Not in a
patch form that you'd want though - do you have any refrigerator changes in
mm at the moment, or can I use vanilla 2.6.17-rc2 process.c?
Regards,
Nigel
--
See our web page for Howtos, FAQs, the Wiki and mailing list info.
http://www.suspend2.net IRC: #suspend2 on Freenode
[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Nigel Cunningham <nigel@suspend2.net>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>,
Nick Piggin <nickpiggin@yahoo.com.au>,
Linux PM <linux-pm@osdl.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH] swsusp: support creating bigger images
Date: Wed, 26 Apr 2006 08:24:55 +1000 [thread overview]
Message-ID: <200604260825.04867.nigel@suspend2.net> (raw)
In-Reply-To: <200604260021.08888.rjw@sisk.pl>
[-- Attachment #1: Type: text/plain, Size: 3208 bytes --]
Hi.
On Wednesday 26 April 2006 08:21, Rafael J. Wysocki wrote:
> On Tuesday 25 April 2006 23:18, Nigel Cunningham wrote:
> > On Wednesday 26 April 2006 07:12, Rafael J. Wysocki wrote:
> > > On Tuesday 25 April 2006 22:32, Pavel Machek wrote:
> > > > > > > -unsigned int count_data_pages(void)
> > > > > > >
> > > > > > > +/**
> > > > > > > + * need_to_copy - determine if a page needs to be copied
> > > > > > > before saving. + * Returns false if the page can be saved
> > > > > > > without copying. + */
> > > > > > > +
> > > > > > > +static int need_to_copy(struct page *page)
> > > > > > > +{
> > > > > > > + if (!PageLRU(page) || PageCompound(page))
> > > > > > > + return 1;
> > > > > > > + if (page_mapped(page))
> > > > > > > + return page_mapped_by_current(page);
> > > > > > > +
> > > > > > > + return 1;
> > > > > > > +}
> > > > > >
> > > > > > I'd much rather VM internal type stuff get moved *out* of
> > > > > > kernel/power :(
> > > > >
> > > > > Well, I kind of agree, but I don't know where to place it under
> > > > > mm/.
> > > > >
> > > > > > It needs more comments too. Also, how important is it for the
> > > > > > page to be off the LRU?
> > > > >
> > > > > Hm, I'm not sure if that's what you're asking about, but the pages
> > > > > off the LRU are handled in a usual way, ie. copied when
> > > > > snapshotting the system. The pages _on_ the LRU may be included in
> > > > > the snapshot image without copying, but I require them additionally
> > > > > to be (a) mapped by someone and (b) not mapped by the current task.
> > > >
> > > > Why do you _want_ them mapped by someone?
> > >
> > > Because this means they belong to a task that is frozen and won't touch
> > > them (of course unless it's us). The kernel has no reason to access
> > > them either (even after we resume devices) except for reclaiming, but
> > > that's handled explicitly. Thus it's safe to include them in the image
> > > without copying.
> > >
> > > As I said before, I think the page cache pages may be treated this way
> > > too. It probably applies to all of the LRU pages, but there may be some
> > > corner cases. The mapped pages are just easy to single out.
> >
> > It does apply to all of the LRU pages. This is what I've been doing for
> > years now. The only corner case I've come across is XFS. It still wants
> > to write data even when there's nothing to do and it's threads are frozen
> > (IIRC - haven't looked at it for a while). I got around that by freezing
> > bdevs when freezing processes.
>
> This means if we freeze bdevs, we'll be able to save all of the LRU pages,
> except for the pages mapped by the current task, without copying. I think
> we can try to do this, but we'll need a patch to freeze bdevs for this
> purpose. ;-)
Isn't that a coincidence? I just happen to have the code right here! Not in a
patch form that you'd want though - do you have any refrigerator changes in
mm at the moment, or can I use vanilla 2.6.17-rc2 process.c?
Regards,
Nigel
--
See our web page for Howtos, FAQs, the Wiki and mailing list info.
http://www.suspend2.net IRC: #suspend2 on Freenode
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2006-04-25 22:24 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-24 21:55 [RFC][PATCH] swsusp: support creating bigger images Rafael J. Wysocki
2006-04-24 22:16 ` Pavel Machek
2006-04-25 8:26 ` Rafael J. Wysocki
2006-04-25 8:26 ` Rafael J. Wysocki
2006-04-25 10:04 ` Pavel Machek
2006-04-25 10:04 ` Pavel Machek
2006-04-25 10:31 ` Rafael J. Wysocki
2006-04-25 10:31 ` Rafael J. Wysocki
2006-04-27 15:27 ` Rafael J. Wysocki
2006-04-27 15:27 ` Rafael J. Wysocki
2006-04-27 20:55 ` Pavel Machek
2006-04-28 9:19 ` Rafael J. Wysocki
2006-04-28 9:19 ` Rafael J. Wysocki
2006-04-28 9:23 ` Pavel Machek
2006-04-28 9:23 ` Pavel Machek
2006-04-25 10:28 ` Nick Piggin
2006-04-25 15:39 ` Rafael J. Wysocki
2006-04-25 20:32 ` Pavel Machek
2006-04-25 21:12 ` Rafael J. Wysocki
2006-04-25 21:12 ` Rafael J. Wysocki
2006-04-25 21:18 ` Nigel Cunningham
2006-04-25 21:18 ` Nigel Cunningham
2006-04-25 22:21 ` Rafael J. Wysocki
2006-04-25 22:21 ` Rafael J. Wysocki
2006-04-25 22:24 ` Nigel Cunningham [this message]
2006-04-25 22:24 ` Nigel Cunningham
2006-04-25 22:38 ` Rafael J. Wysocki
2006-04-25 22:38 ` Rafael J. Wysocki
2006-04-25 22:25 ` Pavel Machek
2006-04-25 22:25 ` Pavel Machek
2006-04-25 22:30 ` Nigel Cunningham
2006-04-25 22:30 ` Nigel Cunningham
2006-04-25 22:36 ` Pavel Machek
2006-04-25 22:36 ` Pavel Machek
2006-04-25 22:43 ` Rafael J. Wysocki
2006-04-25 22:43 ` Rafael J. Wysocki
2006-04-26 0:49 ` Nigel Cunningham
2006-04-30 12:27 ` Rafael J. Wysocki
2006-04-30 12:27 ` Rafael J. Wysocki
2006-05-01 1:49 ` Nigel Cunningham
2006-05-01 1:49 ` Nigel Cunningham
2006-05-01 11:20 ` Rafael J. Wysocki
2006-05-01 22:56 ` Nigel Cunningham
2006-04-26 2:24 ` Nick Piggin
2006-04-26 2:24 ` Nick Piggin
2006-04-26 3:41 ` Nigel Cunningham
2006-04-26 16:22 ` Nick Piggin
2006-04-26 21:16 ` Rafael J. Wysocki
2006-04-26 21:16 ` Rafael J. Wysocki
2006-04-26 8:10 ` Pavel Machek
2006-04-26 8:10 ` Pavel Machek
2006-04-27 19:53 ` [RFC][PATCH] swsusp: support creating bigger images (rev. 2) Rafael J. Wysocki
2006-04-27 19:53 ` 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=200604260825.04867.nigel@suspend2.net \
--to=nigel@suspend2.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@osdl.org \
--cc=nickpiggin@yahoo.com.au \
--cc=pavel@ucw.cz \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.