From: Cyrill Gorcunov <gorcunov@gmail.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>,
Andi Kleen <andi@firstfloor.org>, Ingo Molnar <mingo@elte.hu>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: bootmem allocator
Date: Tue, 8 Apr 2008 20:18:34 +0400 [thread overview]
Message-ID: <20080408161834.GC7656@cvg> (raw)
In-Reply-To: <47FAF593.4020503@zytor.com>
[H. Peter Anvin - Mon, Apr 07, 2008 at 09:33:23PM -0700]
> Cyrill Gorcunov wrote:
>> I think it would be a good idea ;) Btw maybe would be better to call
>> memset on the code witch relies on "clear" memory explicitly? So we will
>> clear memory allocated *only* if we really need this.
>
> Are there any users of bootmem which will allocate a significant amount of
> memory and don't need it zeroed?
>
> -hpa
>
Well, the only really significant allocation I found is in
arch/ia64/kernel/iosapi.c:
---[...]---
static struct iosapic_rte_info * __init_refok iosapic_alloc_rte (void)
{
int i;
struct iosapic_rte_info *rte;
int preallocated = 0;
if (!iosapic_kmalloc_ok && list_empty(&free_rte_list)) {
---> rte = alloc_bootmem(sizeof(struct iosapic_rte_info) *
NR_PREALLOCATE_RTE_ENTRIES);
if (!rte)
return NULL;
for (i = 0; i < NR_PREALLOCATE_RTE_ENTRIES; i++, rte++)
list_add(&rte->rte_list, &free_rte_list);
}
if (!list_empty(&free_rte_list)) {
rte = list_entry(free_rte_list.next, struct iosapic_rte_info,
rte_list);
list_del(&rte->rte_list);
preallocated++;
} else {
rte = kmalloc(sizeof(struct iosapic_rte_info), GFP_ATOMIC);
if (!rte)
return NULL;
}
memset(rte, 0, sizeof(struct iosapic_rte_info));
if (preallocated)
rte->flags |= RTE_PREALLOCATED;
return rte;
}
---[...]---
but it requires zeroed memory too. So, no, I didn't found any large
number of bytes allocated by bootmem scheme without needing of its
clearing.
- Cyrill -
next prev parent reply other threads:[~2008-04-08 16:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-07 18:56 bootmem allocator Cyrill Gorcunov
2008-04-07 19:09 ` Ingo Molnar
2008-04-07 19:44 ` Andi Kleen
2008-04-07 21:45 ` Yinghai Lu
2008-04-08 4:14 ` Cyrill Gorcunov
2008-04-08 4:33 ` H. Peter Anvin
2008-04-08 5:50 ` Cyrill Gorcunov
2008-04-08 16:18 ` Cyrill Gorcunov [this message]
2008-04-08 8:04 ` Ingo Molnar
2008-04-08 8:12 ` Andi Kleen
2008-04-08 13:57 ` Cyrill Gorcunov
2008-04-08 17:34 ` Cyrill Gorcunov
2008-04-08 17:44 ` H. Peter Anvin
2008-04-09 6:00 ` Mike Travis
2008-04-09 6:08 ` Andi Kleen
2008-04-09 6:55 ` Mike Travis
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=20080408161834.GC7656@cvg \
--to=gorcunov@gmail.com \
--cc=andi@firstfloor.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=yhlu.kernel@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.