Skip to contentSkip to conversation

kmem_cache_init

DISCUSSION ishare 2 participants 4 messages Mar 15, 2013 – Mar 17, 2013

lore
Share & tools
lore

ishare

author
#0 lore raw

the function kmem_cache_init() is allocating which area for whom to use ?

what is the difference comparing with vfs_caches_init() ?

thanks!

#1 lore raw

kmem_cache_init() will create generalized caches from where kmalloc() will allocate memory.

vfs_caches_init() will create specialized caches related to VFS, like, dentry, inode_cache, mnt_cache....

Regards,
Prabhunath G
Linux Trainer
Bangalore

Quoted 12 lines · ishare

the function kmem_cache_init() is allocating which area for whom to use ?

what is the difference comparing with vfs_caches_init() ?

thanks!

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130315/f90e3e0f/attachment.html

author
#2 lore raw
Quoted 5 lines · Prabhu nath

kmem_cache_init() will create generalized caches from where kmalloc() will allocate memory.

vfs_caches_init() will create specialized caches related to VFS, like, dentry, inode_cache, mnt_cache....

what is the relation between cache_cache and these two functions? is there clue for understanding this?

thanks!

Quoted 24 lines

Regards,
Prabhunath G
Linux Trainer
Bangalore

Quoted 12 lines · ishare

the function kmem_cache_init() is allocating which area for whom to use ?

what is the difference comparing with vfs_caches_init() ?

thanks!

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

--

#3 lore raw
Quoted 11 lines · ishare
Quoted 1 line · Prabhu nath

kmem_cache_init() will create generalized caches from where kmalloc()

will

Quoted 4 lines

allocate memory.

vfs_caches_init() will create specialized caches related to VFS, like, dentry, inode_cache, mnt_cache....

what is the relation between cache_cache and these two functions? is there clue for understanding this?

Slab cache creation either for specialized cache or generalized
cache is done through kmem_cache_alloc().
kmem_cache_init() is a wrapper function which will create generalized
caches again using kmem_cache_alloc()
vfs_caches_init() is a wrapper function which will create specialized
caches required by VFS sub-system, again using kmem_cache_alloc().

there is a slab cache named "kmem_cache"of size "struct kmem_cache"used
to allocate memory objects for slab cache descriptor "kmem_cache". Now this slab cache will also have one descriptor. Where will you allocate memory for this descriptor ?

The answer is - this will be allocated statically as struct kmem_cache cache_cache.

I have attached a brief notes on "Slab Allocator" in a separate mail. Kindly read it. Also to get more clarity read memory management chapters in the following books.
"The Linux Kernel Primer " - Claudia Rodriguez, Gordon Fischer & Steven Smolski
"ULK" - Daniel P Bovet.

Quoted 30 lines

thanks!

Quoted 7 lines

Regards,
Prabhunath G
Linux Trainer
Bangalore

On Fri, Mar 15, 2013 at 10:08 AM, ishare <[email protected]>

Quoted 3 lines · wrote:
Quoted 3 lines

the function kmem_cache_init() is allocating which area for whom to

use ?

Quoted 14 lines
Quoted 10 lines

what is the difference comparing with vfs_caches_init() ?

thanks!

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

--

Signature · 7 lines
Regards,
Prabhunath G
Linux Trainer
Bangalore
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130317/3f18e678/attachment.html