lkml.org 
[lkml]   [2008]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: bootmem allocator
[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 -


\
 
 \ /
  Last update: 2008-04-08 18:21    [W:0.242 / U:0.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site