From: Pavel Machek <pavel@ucw.cz>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>,
Linux PM <linux-pm@osdl.org>, LKML <linux-kernel@vger.kernel.org>,
Nigel Cunningham <nigel@suspend2.net>
Subject: Re: [RFC][PATCH] swsusp: support creating bigger images
Date: Tue, 25 Apr 2006 22:32:57 +0200 [thread overview]
Message-ID: <20060425203256.GD6379@elf.ucw.cz> (raw)
In-Reply-To: <200604251739.13377.rjw@sisk.pl>
Hi!
> > > -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?
> > b) Why are you clearing PageLRU outside the spinlock?
>
> Well, good question. ;-) Moreover it seems I don't need to acquire the
> spinlock at all, because this is done on one CPU with IRQs disabled and the
> other tasks frozen.
Well, it is probably better to still take the spinlock. That way, if
something goes wrong we get deadlock, not anything worse.
Pavel
--
Thanks for all the (sleeping) penguins.
next prev parent reply other threads:[~2006-04-25 20:32 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 [this message]
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
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=20060425203256.GD6379@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@osdl.org \
--cc=nickpiggin@yahoo.com.au \
--cc=nigel@suspend2.net \
--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.