From: Dave Hansen <haveblue@us.ibm.com>
To: "Hariprasad Nellitheertha [imap]" <hari@in.ibm.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
fastboot@osdl.org, Andrew Morton <akpm@osdl.org>,
"Suparna Bhattacharya [imap]" <suparna@in.ibm.com>,
"Martin J. Bligh" <mbligh@aracnet.com>,
litke@us.ibm.com, "Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: [PATCH][2/6]Memory preserving reboot using kexec
Date: Tue, 17 Aug 2004 09:01:33 -0700 [thread overview]
Message-ID: <1092758492.5415.49.camel@nighthawk> (raw)
In-Reply-To: <20040817120717.GC3916@in.ibm.com>
On Tue, 2004-08-17 at 05:07, Hariprasad Nellitheertha wrote:
> Regards, Hari
> +void __relocate_base_mem(unsigned long backup_addr, unsigned long backup_size)
> +{
> + unsigned long pfn, pfn_max;
> + void *src_addr, *dest_addr;
> + struct page *page;
> +
> + pfn_max = backup_size >> PAGE_SHIFT;
> + for (pfn = 0; pfn < pfn_max; pfn++) {
> + src_addr = phys_to_virt(pfn << PAGE_SHIFT);
> + dest_addr = backup_addr + src_addr;
> + if (!pfn_valid(pfn))
> + continue;
> + page = pfn_to_page(pfn);
> + if (PageReserved(page))
> + copy_page(dest_addr, src_addr);
> + }
> +}
You're getting a little sloppy with your types in there. I know you
probably aren't getting warnings for passing unsigned longs to
copy_page(), but you should probably still be passing pointers to it.
I think the general convention is to keep physical addresses in unsigned
longs and virtual addresses in pointers. Just keep that in mind.
> +#define CRASH_BACKUP_BASE 0x08000000
> +#define CRASH_BACKUP_SIZE 0x01000000
What are these numbers? Why do you need to define them when your config
option is off?
> +/*
> + * If we have booted due to a crash, max_pfn will be a very low value. We need
> + * to know the amount of memory that the previous kernel used.
> + */
> +unsigned long saved_max_pfn;
I'd probably put that comment next to the place where saved_max_pfn is
used instead of where it is declared.
-- Dave
next prev parent reply other threads:[~2004-08-17 16:03 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-17 12:04 [RFC]Kexec based crash dumping Hariprasad Nellitheertha
2004-08-17 12:05 ` [PATCH][1/6]Documentation Hariprasad Nellitheertha
2004-08-17 12:07 ` [PATCH][2/6]Memory preserving reboot using kexec Hariprasad Nellitheertha
2004-08-17 12:08 ` [PATCH][3/6]Interface for copying the dump pages Hariprasad Nellitheertha
2004-08-17 12:09 ` [PATCH][4/6]Register snapshotting before kexec-boot Hariprasad Nellitheertha
2004-08-17 12:10 ` [PATCH][5/6]ELF format interface for the dump Hariprasad Nellitheertha
2004-08-17 12:13 ` [PATCH][6/6]Device abstraction for linear/raw view of " Hariprasad Nellitheertha
2004-08-17 22:53 ` Martin J. Bligh
2004-08-18 12:29 ` Hariprasad Nellitheertha
2004-08-17 16:27 ` [PATCH][4/6]Register snapshotting before kexec-boot Dave Hansen
2004-08-18 13:43 ` Theodore Ts'o
2004-08-19 11:59 ` Hariprasad Nellitheertha
2004-08-17 16:17 ` [PATCH][3/6]Interface for copying the dump pages Dave Hansen
2004-08-17 16:01 ` Dave Hansen [this message]
2004-08-17 22:44 ` [RFC]Kexec based crash dumping Andrew Morton
2004-08-18 12:28 ` Hariprasad Nellitheertha
2004-08-20 8:17 ` [Fastboot] " Eric W. Biederman
2004-08-20 8:05 ` [Fastboot] " Eric W. Biederman
2004-08-20 8:27 ` Hariprasad Nellitheertha
-- strict thread matches above, loose matches on Subject: below --
2004-09-15 12:50 kexec " Hariprasad Nellitheertha
2004-09-15 12:51 ` [PATCH][1/6]Documentation Hariprasad Nellitheertha
2004-09-15 12:53 ` [PATCH][2/6]Memory preserving reboot using kexec Hariprasad Nellitheertha
2004-09-15 21:22 ` Andrew Morton
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=1092758492.5415.49.camel@nighthawk \
--to=haveblue@us.ibm.com \
--cc=akpm@osdl.org \
--cc=ebiederm@xmission.com \
--cc=fastboot@osdl.org \
--cc=hari@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=litke@us.ibm.com \
--cc=mbligh@aracnet.com \
--cc=suparna@in.ibm.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