Thread (6 messages) flat view 6 messages, 3 authors, 2012-01-29

kmalloc before kmem_cache_init

From: Sukanto Ghosh <hidden>
Date: 2012-01-29 06:02:33

I am kind of lost trying to figure out how can kmallocs work if they
are called before kmem_cache_init

(e.g. such a case occurs when in start_kernel() we call
parse_early_param() (which in turn might call
early_serial8250_setup() if earlycon= is used in kernel command-line)
before mm_init() ?(which later calls
kmem_cache_init() )
From what I understood, kmalloc() (SLUB implementation) first tries to
find out the slab fit for the size
being kmalloced and slabs are nothing but kmalloc_caches[]. Now these
kmalloc_caches get initialized in
kmem_cache_init().

What am I missing here ?

Regards,
Sukanto Ghosh


-- 
Regards,
Sukanto Ghosh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help