Skip to content

Commit a1a1386

Browse files
gamanakisbehlendorf
authored andcommitted
Avoid updating the L2ARC device header unnecessarily
If we do not write any buffers to the cache device and the evict hand has not advanced do not update the cache device header. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Amanakis <[email protected]> Closes #11522 Closes #11537
1 parent 43eaef6 commit a1a1386

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

module/zfs/arc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8925,6 +8925,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
89258925
l2arc_write_callback_t *cb = NULL;
89268926
zio_t *pio, *wzio;
89278927
uint64_t guid = spa_load_guid(spa);
8928+
l2arc_dev_hdr_phys_t *l2dhdr = dev->l2ad_dev_hdr;
89288929

89298930
ASSERT3P(dev->l2ad_vdev, !=, NULL);
89308931

@@ -9153,7 +9154,8 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
91539154
* Although we did not write any buffers l2ad_evict may
91549155
* have advanced.
91559156
*/
9156-
l2arc_dev_hdr_update(dev);
9157+
if (dev->l2ad_evict != l2dhdr->dh_evict)
9158+
l2arc_dev_hdr_update(dev);
91579159

91589160
return (0);
91599161
}

0 commit comments

Comments
 (0)