Reduce stack in vdev_cache_read
Moving the vdev_cache_entry_t struct ve_search from the stack to the heap saves ~100 bytes.
This commit is contained in:
parent
b3c82b1b18
commit
48669030fe
|
@ -0,0 +1,7 @@
|
||||||
|
From: Brian Behlendorf <behlendorf1@llnl.gov>
|
||||||
|
Subject: [PATCH] fix stack vdev_cache_read
|
||||||
|
|
||||||
|
Moving the vdev_cache_entry_t struct ve_search from the stack to
|
||||||
|
the heap saves ~100 bytes.
|
||||||
|
|
||||||
|
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
|
|
@ -244,7 +244,7 @@ int
|
||||||
vdev_cache_read(zio_t *zio)
|
vdev_cache_read(zio_t *zio)
|
||||||
{
|
{
|
||||||
vdev_cache_t *vc = &zio->io_vd->vdev_cache;
|
vdev_cache_t *vc = &zio->io_vd->vdev_cache;
|
||||||
vdev_cache_entry_t *ve, ve_search;
|
vdev_cache_entry_t *ve, *ve_search;
|
||||||
uint64_t cache_offset = P2ALIGN(zio->io_offset, VCBS);
|
uint64_t cache_offset = P2ALIGN(zio->io_offset, VCBS);
|
||||||
uint64_t cache_phase = P2PHASE(zio->io_offset, VCBS);
|
uint64_t cache_phase = P2PHASE(zio->io_offset, VCBS);
|
||||||
zio_t *fio;
|
zio_t *fio;
|
||||||
|
@ -267,8 +267,10 @@ vdev_cache_read(zio_t *zio)
|
||||||
|
|
||||||
mutex_enter(&vc->vc_lock);
|
mutex_enter(&vc->vc_lock);
|
||||||
|
|
||||||
ve_search.ve_offset = cache_offset;
|
ve_search = kmem_alloc(sizeof(vdev_cache_entry_t), KM_SLEEP);
|
||||||
ve = avl_find(&vc->vc_offset_tree, &ve_search, NULL);
|
ve_search->ve_offset = cache_offset;
|
||||||
|
ve = avl_find(&vc->vc_offset_tree, ve_search, NULL);
|
||||||
|
kmem_free(ve_search, sizeof(vdev_cache_entry_t));
|
||||||
|
|
||||||
if (ve != NULL) {
|
if (ve != NULL) {
|
||||||
if (ve->ve_missed_update) {
|
if (ve->ve_missed_update) {
|
||||||
|
|
Loading…
Reference in New Issue