kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* kmem_cache_init
@ 2013-03-15  4:38 ishare
  2013-03-15  6:09 ` kmem_cache_init Prabhu nath
  0 siblings, 1 reply; 4+ messages in thread
From: ishare @ 2013-03-15  4:38 UTC (permalink / raw)
  To: kernelnewbies


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

  what is the difference comparing with vfs_caches_init() ?

 thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* kmem_cache_init
  2013-03-15  4:38 kmem_cache_init ishare
@ 2013-03-15  6:09 ` Prabhu nath
  2013-03-15 12:38   ` kmem_cache_init ishare
  0 siblings, 1 reply; 4+ messages in thread
From: Prabhu nath @ 2013-03-15  6:09 UTC (permalink / raw)
  To: kernelnewbies

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

On Fri, Mar 15, 2013 at 10:08 AM, ishare <june.tune.sea@gmail.com> wrote:

>
>  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 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* kmem_cache_init
  2013-03-15  6:09 ` kmem_cache_init Prabhu nath
@ 2013-03-15 12:38   ` ishare
  2013-03-17  8:41     ` kmem_cache_init Prabhu nath
  0 siblings, 1 reply; 4+ messages in thread
From: ishare @ 2013-03-15 12:38 UTC (permalink / raw)
  To: kernelnewbies

On Fri, Mar 15, 2013 at 11:39:07AM +0530, Prabhu nath wrote:
> 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!


> 
> Regards,
> Prabhunath G
> Linux Trainer
> Bangalore
> 
> On Fri, Mar 15, 2013 at 10:08 AM, ishare <june.tune.sea@gmail.com> wrote:
> 
> >
> >  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
> >
> 
> 
> 
> --

^ permalink raw reply	[flat|nested] 4+ messages in thread

* kmem_cache_init
  2013-03-15 12:38   ` kmem_cache_init ishare
@ 2013-03-17  8:41     ` Prabhu nath
  0 siblings, 0 replies; 4+ messages in thread
From: Prabhu nath @ 2013-03-17  8:41 UTC (permalink / raw)
  To: kernelnewbies

On Fri, Mar 15, 2013 at 6:08 PM, ishare <june.tune.sea@gmail.com> wrote:

> On Fri, Mar 15, 2013 at 11:39:07AM +0530, Prabhu nath wrote:
> > 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?
>

        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.


>   thanks!
>
>
> >
> > Regards,
> > Prabhunath G
> > Linux Trainer
> > Bangalore
> >
> > On Fri, Mar 15, 2013 at 10:08 AM, ishare <june.tune.sea@gmail.com>
> wrote:
> >
> > >
> > >  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
> > >
> >
> >
> >
> > --
>



-- 
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 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-17  8:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-15  4:38 kmem_cache_init ishare
2013-03-15  6:09 ` kmem_cache_init Prabhu nath
2013-03-15 12:38   ` kmem_cache_init ishare
2013-03-17  8:41     ` kmem_cache_init Prabhu nath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).