From: Greg Ungerer <gerg@snapgear.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@vger.kernel.org, uclinux-dev@uclinux.org,
Greg Ungerer <gerg@uclinux.org>
Subject: Re: [PATCH] m68k: move to a single instance of free_initmem()
Date: Fri, 30 Nov 2012 14:24:24 +1000 [thread overview]
Message-ID: <50B834F8.3070007@snapgear.com> (raw)
In-Reply-To: <CAMuHMdX5+gdM+jHEjLLZZJA8_oupeBP4CHbQrVHoE7CRuYBipQ@mail.gmail.com>
Hi Geert,
On 11/11/12 20:43, Geert Uytterhoeven wrote:
> On Tue, Oct 23, 2012 at 5:40 AM, <gerg@snapgear.com> wrote:
[snip]
>> void free_initmem(void)
>> {
>> -#ifdef CONFIG_RAMKERNEL
>> +#ifndef CONFIG_MMU_SUN3
>> unsigned long addr;
>>
>> - /*
>> - * The following code should be cool even if these sections
>> - * are not page aligned.
>> - */
>> - addr = PAGE_ALIGN((unsigned long) __init_begin);
>> - /* next to check that the page we free is not a partial page */
>> - for (; addr + PAGE_SIZE < ((unsigned long) __init_end); addr += PAGE_SIZE) {
>> + addr = (unsigned long) __init_begin;
>> + for (; addr < ((unsigned long) __init_end); addr += PAGE_SIZE) {
>> ClearPageReserved(virt_to_page(addr));
>> init_page_count(virt_to_page(addr));
>> free_page(addr);
>> totalram_pages++;
>> }
>> pr_notice("Freeing unused kernel memory: %luk freed (0x%x - 0x%x)\n",
>> - (addr - PAGE_ALIGN((unsigned long) __init_begin)) >> 10,
>> - (int)(PAGE_ALIGN((unsigned long) __init_begin)),
>> - (int)(addr - PAGE_SIZE));
>> -#endif
>> + (addr - (unsigned long) __init_begin) >> 10,
>> + (unsigned int) __init_begin, (unsigned int) __init_end);
>
> Which is now BTW almost identical to free_initrd_mem(), so the common
> parts can be extracted in a helper function.
Indeed it can. Well spotted :-)
Patch coming up.
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: gerg@snapgear.com
SnapGear Group, McAfee PHONE: +61 7 3435 2888
8 Gardner Close FAX: +61 7 3217 5323
Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
prev parent reply other threads:[~2012-11-30 4:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-23 3:40 [PATCH] m68k: move to a single instance of free_initmem() gerg
2012-11-11 10:43 ` Geert Uytterhoeven
2012-11-30 4:24 ` Greg Ungerer [this message]
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=50B834F8.3070007@snapgear.com \
--to=gerg@snapgear.com \
--cc=geert@linux-m68k.org \
--cc=gerg@uclinux.org \
--cc=linux-m68k@vger.kernel.org \
--cc=uclinux-dev@uclinux.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