freebsd-dev/module
Matthew Ahrens d9eea113f8 It is not necessary to zero struct dbuf_hold_impl_data
Under a workload which makes heavy use of `dbuf_hold()`, I noticed that a
considerable amount of time was spent in `dbuf_hold_impl()`, due to its call to
`kmem_zalloc(sizeof (struct dbuf_hold_impl_data) * DBUF_HOLD_IMPL_MAX_DEPTH)`,
which is around 2KiB.  This structure is used as a stack, to limit the size of
the C stack as dbuf_hold() calls itself recursively.  We make a recursive call
to hold the parent's dbuf when the requested dbuf is not found.  The vast
majority of the time, the parent or grandparent indirect dbuf is cached, so the
number of recursive calls is very low.  However, we initialize this entire
array for every call to dbuf_hold().

To improve performance, this commit changes `dbuf_hold()` to use `kmem_alloc()`
instead of `kmem_zalloc()`.  __dbuf_hold_impl_init is changed to initialize all
members of the struct before they are used.  I observed ~5% performance
improvement on a workload which creates many files.

Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4974
2016-08-16 15:27:17 -07:00
..
avl Fix uninitialized variable in avl_add() 2016-07-25 14:21:34 -07:00
icp icp: mark asm files with noexec stack 2016-08-12 09:51:26 -07:00
nvpair OpenZFS 7263 - deeply nested nvlist can overflow stack 2016-08-11 15:58:03 -07:00
unicode Build user-space with different gcc optimization levels 2016-08-09 14:40:35 -07:00
zcommon Rework of fletcher_4 module 2016-08-16 14:11:55 -07:00
zfs It is not necessary to zero struct dbuf_hold_impl_data 2016-08-16 15:27:17 -07:00
zpios Add large block support to zpios(1) benchmark 2015-09-22 09:13:20 -07:00
.gitignore module/.gitignore: Add *.dwo (#4580) 2016-05-02 09:07:04 -07:00
Makefile.in Illumos Crypto Port module added to enable native encryption in zfs 2016-07-20 10:43:30 -07:00