"J. Hannken-Illjes" <hann...@eis.cs.tu-bs.de> wrote:
> On Jan 8, 2014, at 5:11 PM, pedro martelletto <pe...@netbsd.org> wrote:
> 
> > Module Name:        src
> > Committed By:       pedro
> > Date:               Wed Jan  8 16:11:04 UTC 2014
> > 
> > Modified Files:
> >     src/sys/fs/tmpfs: tmpfs_subr.c
> > 
> > Log Message:
> > Allocate direntp on the stack in tmpfs_dir_getdents(), thus saving
> > calls to kmem_zalloc() and kmem_free(); OK rmind@. From OpenBSD.
> 
> Is it really a good idea to allocate 528 bytes on the kernel stack?
> File systems nest and already use much stack space.

It is harmless in this case since we get a few or more pages for the stack.

> Looks better to use a pool_cache.

It is worth to create a separate pool_cache(9) only if the allocations can
potentially be very intensive.

-- 
Mindaugas

Reply via email to