From: Andi Kleen <ak@suse.de>
To: discuss@x86-64.org
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>, Andrew Morton <akpm@osdl.org>,
LKML <linux-kernel@vger.kernel.org>, Pavel Machek <pavel@ucw.cz>
Subject: Re: [discuss] [RFC][PATCH][Fix] swsusp: Yet another attempt to fix Bug #4959
Date: Tue, 4 Oct 2005 19:09:00 +0200 [thread overview]
Message-ID: <200510041909.00714.ak@suse.de> (raw)
In-Reply-To: <200510011813.54755.rjw@sisk.pl>
On Saturday 01 October 2005 18:13, Rafael J. Wysocki wrote:
> Your comments, criticisms and (preferably) suggestions will be appreciated.
First always write a full description of the problem and the rationale
of the change and a overview what it changes. Also please add Signed-off-by
lines.
> +#ifdef CONFIG_SOFTWARE_SUSPEND
> +extern unsigned long resume_table_start, resume_table_end;
These should be all in some include. Adding externs in C files is near
always wrong because it avoids cross file type checking.
Also the convention is to add _pfn to variables that are in PFNs,
otherwise it's full addresses.
> 10:40:03.000000000 +0200 +++
> linux-2.6.14-rc3/arch/x86_64/mm/init.c 2005-10-01 14:31:34.000000000 +0200
> @@ -260,6 +260,9 @@
> pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT;
> tables = round_up(puds * sizeof(pud_t), PAGE_SIZE) +
> round_up(pmds * sizeof(pmd_t), PAGE_SIZE);
> +#ifdef CONFIG_SOFTWARE_SUSPEND
> + tables += tables;
> +#endif
This needs a comment. Also I would still prefer if it was allocated
only when suspend is actually attempted.
> table_start = find_e820_area(0x8000, __pa_symbol(&_text), tables);
> if (table_start == -1UL)
> @@ -272,6 +275,7 @@
> /* Setup the direct mapping of the physical memory at PAGE_OFFSET.
> This runs before bootmem is initialized and gets pages directly from
> the physical memory. To access them they are temporarily mapped. */
> +#ifndef CONFIG_SOFTWARE_SUSPEND
> void __init init_memory_mapping(unsigned long start, unsigned long end)
> {
> unsigned long next;
> @@ -307,6 +311,69 @@
> table_start<<PAGE_SHIFT,
> table_end<<PAGE_SHIFT);
> }
> +#else
> +
> +extern pgd_t resume_level4_pgt[];
These should be in some include again.
I don't like it that you duplicated the function fully. Is that really
needed?
-Andi
next prev parent reply other threads:[~2005-10-04 17:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-01 16:13 [RFC][PATCH][Fix] swsusp: Yet another attempt to fix Bug #4959 Rafael J. Wysocki
2005-10-01 19:45 ` Andi Kleen
2005-10-02 10:25 ` Rafael J. Wysocki
2005-10-04 14:11 ` Rafael J. Wysocki
2005-10-04 17:09 ` Andi Kleen [this message]
2005-10-04 21:31 ` [discuss] " Rafael J. Wysocki
2005-10-05 21:44 ` [PATCH][Fix] swsusp: avoid possible page tables corruption during resume on x86-64 Rafael J. Wysocki
2005-10-05 22:49 ` Pavel Machek
2005-10-06 8:07 ` [discuss] " Rafael J. Wysocki
2005-10-08 10:30 ` Andi Kleen
2005-10-08 12:23 ` 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=200510041909.00714.ak@suse.de \
--to=ak@suse.de \
--cc=akpm@osdl.org \
--cc=discuss@x86-64.org \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox