mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 11:18:52 +03:00
Persistent L2ARC
This commit makes the L2ARC persistent across reboots. We implement a light-weight persistent L2ARC metadata structure that allows L2ARC contents to be recovered after a reboot. This significantly eases the impact a reboot has on read performance on systems with large caches. Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Reviewed-by: George Wilson <gwilson@delphix.com> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Saso Kiselkov <skiselkov@gmail.com> Co-authored-by: Jorgen Lundman <lundman@lundman.net> Co-authored-by: George Amanakis <gamanakis@gmail.com> Ported-by: Yuxuan Shui <yshuiv7@gmail.com> Signed-off-by: George Amanakis <gamanakis@gmail.com> Closes #925 Closes #1823 Closes #2672 Closes #3744 Closes #9582
This commit is contained in:
+16
-3
@@ -2279,9 +2279,22 @@ vdev_reopen(vdev_t *vd)
|
||||
if (vd->vdev_aux) {
|
||||
(void) vdev_validate_aux(vd);
|
||||
if (vdev_readable(vd) && vdev_writeable(vd) &&
|
||||
vd->vdev_aux == &spa->spa_l2cache &&
|
||||
!l2arc_vdev_present(vd))
|
||||
l2arc_add_vdev(spa, vd);
|
||||
vd->vdev_aux == &spa->spa_l2cache) {
|
||||
/*
|
||||
* When reopening we can assume the device label has
|
||||
* already the attribute l2cache_persistent, since we've
|
||||
* opened the device in the past and updated the label.
|
||||
* In case the vdev is present we should evict all ARC
|
||||
* buffers and pointers to log blocks and reclaim their
|
||||
* space before restoring its contents to L2ARC.
|
||||
*/
|
||||
if (l2arc_vdev_present(vd)) {
|
||||
l2arc_rebuild_vdev(vd, B_TRUE);
|
||||
} else {
|
||||
l2arc_add_vdev(spa, vd);
|
||||
}
|
||||
spa_async_request(spa, SPA_ASYNC_L2CACHE_REBUILD);
|
||||
}
|
||||
} else {
|
||||
(void) vdev_validate(vd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user