From: Pavel Machek <pavel@ucw.cz>
To: Nigel Cunningham <ncunningham@linuxmail.org>
Cc: Andrew Morton <akpm@digeo.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Suspend2 Merge: e820 table support.
Date: Thu, 16 Sep 2004 13:14:38 +0200 [thread overview]
Message-ID: <20040916111438.GB5467@elf.ucw.cz> (raw)
In-Reply-To: <1095332590.3324.166.camel@laptop.cunninghams>
Hi!
> This patch adds support for the e820 table for swsusp and Suspend2. It
> does so by setting the NoSave flag for unsavable pages at boot time.
> @@ -27,6 +27,9 @@
> #include <linux/slab.h>
> #include <linux/proc_fs.h>
> #include <linux/efi.h>
> +#ifdef CONFIG_SOFTWARE_SUSPEND2
> +#include <linux/suspend-common.h>
> +#endif
>
> #include <asm/processor.h>
> #include <asm/system.h>
> @@ -264,12 +267,19 @@
> {
> if (page_is_ram(pfn) && !(bad_ppro && page_kills_ppro(pfn))) {
> ClearPageReserved(page);
> +#ifdef CONFIG_SOFTWARE_SUSPEND2
> + ClearPageNosave(page);
> +#endif
> set_bit(PG_highmem, &page->flags);
> set_page_count(page, 1);
> __free_page(page);
> totalhigh_pages++;
> - } else
> + } else {
> SetPageReserved(page);
> +#ifdef CONFIG_SOFTWARE_SUSPEND2
> + SetPageNosave(page);
> +#endif
> + }
> }
>
> #ifndef CONFIG_DISCONTIGMEM
Please, do not put ifdefs around #includes and statements like
ClearPageNosave. (And is it neccessary at all? I'd just say that all
pages that are Reserved are Nosave automatically.)
> +#ifdef CONFIG_SOFTWARE_SUSPEND2
> + /*
> + * Mark nosave pages
> + */
> + if (addr >= (void *)&__nosave_begin && addr < (void *)&__nosave_end)
> + SetPageNosave(mem_map+tmp);
> + } else
> + /*
> + * Non-RAM pages are always nosave
> + */
> + SetPageNosave(mem_map+tmp);
> +#else
> + }
> +#endif
> + }
Current -mm code does something funny with Nosave; I'm not sure it
will not try to free them after resume. I have fix in my tree but it
is little tested.
Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
next prev parent reply other threads:[~2004-09-16 11:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-16 11:03 Nigel Cunningham
2004-09-16 11:14 ` Pavel Machek [this message]
2004-09-16 11:24 ` Nigel Cunningham
2004-09-16 11:27 ` Pavel Machek
2004-09-16 11:35 ` Nigel Cunningham
2004-09-16 11:37 ` Pavel Machek
2004-09-16 11:59 ` Nigel Cunningham
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=20040916111438.GB5467@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ncunningham@linuxmail.org \
/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®