Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Feb 2021 10:00:02 GMT
From:      Martin Matuska <mm@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 5dce03847fdc - main - zfs: Avoid updating the L2ARC device header unnecessarily
Message-ID:  <202102151000.11FA02Y5041725@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mm:

URL: https://cgit.FreeBSD.org/src/commit/?id=5dce03847fdc7bc6eb959282c0ae2117b1991746

commit 5dce03847fdc7bc6eb959282c0ae2117b1991746
Author:     Martin Matuska <mm@FreeBSD.org>
AuthorDate: 2021-02-15 08:10:01 +0000
Commit:     Martin Matuska <mm@FreeBSD.org>
CommitDate: 2021-02-15 09:56:08 +0000

    zfs: Avoid updating the L2ARC device header unnecessarily
    
    From openzfs-master 0ae184a6b commit message:
      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.
    
    Cherry-picked from openzfs 0ae184a6baaf71e155e9b19af81b75474622ff58
    Patch Author:   George Amanakis <gamanakis@gmail.com>
    
    MFC after:              3 days
    Reviewed by:            delphij
    Differential Revision:  https://reviews.freebsd.org/D28682
---
 sys/contrib/openzfs/module/zfs/arc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/contrib/openzfs/module/zfs/arc.c b/sys/contrib/openzfs/module/zfs/arc.c
index e05b11d51942..fecc752e16ff 100644
--- a/sys/contrib/openzfs/module/zfs/arc.c
+++ b/sys/contrib/openzfs/module/zfs/arc.c
@@ -9062,6 +9062,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
 	l2arc_write_callback_t	*cb = NULL;
 	zio_t 			*pio, *wzio;
 	uint64_t 		guid = spa_load_guid(spa);
+	l2arc_dev_hdr_phys_t	*l2dhdr = dev->l2ad_dev_hdr;
 
 	ASSERT3P(dev->l2ad_vdev, !=, NULL);
 
@@ -9293,7 +9294,8 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
 		 * Although we did not write any buffers l2ad_evict may
 		 * have advanced.
 		 */
-		l2arc_dev_hdr_update(dev);
+		if (dev->l2ad_evict != l2dhdr->dh_evict)
+			l2arc_dev_hdr_update(dev);
 
 		return (0);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102151000.11FA02Y5041725>