lkml.org 
[lkml]   [2011]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: slab: too much allocated in bootstrap head arrays?
On Mon, 12 Dec 2011, roel wrote:

> In mm/slab.c kmem_cache_init() at /* 4) Replace the bootstrap head arrays */
> it kmallocs *ptr and memcpy's with sizeof(struct arraycache_init). Is this
> correct or should it maybe be with sizeof(struct arraycache) instead?

Allocating with sizeof(struct arraycache) will only allocate the header of
the array cache and not reserve space for the pointers that are part of
it. It is always wrong.

Look at alloc_arraycache() for the proper way to use struct arraycache to
calculate the number of bytes needed.



\
 
 \ /
  Last update: 2011-12-13 17:17    [W:0.152 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site