From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: put memblock stuff into init sections
Date: Thu, 1 Dec 2011 23:55:52 +0000 [thread overview]
Message-ID: <20111201235552.GJ9581@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1322778290-32536-1-git-send-email-u.kleine-koenig@pengutronix.de>
On Thu, Dec 01, 2011 at 11:24:50PM +0100, Uwe Kleine-K?nig wrote:
> memblock is only used during early boot for ARM, so the function and
> data can safely go into the init sections.
>
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
NAK, for several reasons. Tejun has a patch whose description starts
with this:
| 24aa07882b (memblock, x86: Replace memblock_x86_reserve/free_range()
| with generic ones) removed arch/x86/include/asm/memblock.h and dropped
| its inclusion from include/linux/memblock.h which breaks other
| architectures which depended on the generic memblock.h pulling in the
| arch specific one.
so, this definition in our asm/memblock.h won't have any effect for much
longer.
Second reason: defining this discards the memblock arrays. Now look at
this:
#ifdef CONFIG_HAVE_ARCH_PFN_VALID
int pfn_valid(unsigned long pfn)
{
return memblock_is_memory(__pfn_to_phys(pfn));
}
EXPORT_SYMBOL(pfn_valid);
#endif
Third reason: my comment about memblock only being used during early boot
was made because that's the case for using it to do _allocations_, because
once memblock has passed the memory and reserved areas to bootmem, using
memblock _from that point_ means that bootmem will not be updated - and
that in turn means that the kernel's page allocator will also not be
updated correctly.
During boot, memory information is passed thusly:
atags or dt -> memblock -> bootmem -> page allocator
Ideally, we should get rid of bootmem from that sequence, which will make
things a little less complicated - but I believe this is not possible at
the moment due to our use of sparsemem, and iirc sparsemem depends on
certain aspects of bootmem.
prev parent reply other threads:[~2011-12-01 23:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-01 22:24 [PATCH] ARM: put memblock stuff into init sections Uwe Kleine-König
2011-12-01 23:55 ` Russell King - ARM Linux [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=20111201235552.GJ9581@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).