summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2016-11-17 15:10:33 +0000
committeravg <avg@FreeBSD.org>2016-11-17 15:10:33 +0000
commit3ca8ef26387353329f2794c4d03dadfa6fa336cc (patch)
tree9c95f7a8e7bcbf73efa2dc63596aad6d60fd8f8e /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
parent860227af36e12e9e0cf655af97b2a960f98361b1 (diff)
downloadFreeBSD-src-3ca8ef26387353329f2794c4d03dadfa6fa336cc.zip
FreeBSD-src-3ca8ef26387353329f2794c4d03dadfa6fa336cc.tar.gz
MFC r308040,308479: nap time between pats is forced to be at most half
of the timeout Note that in this branch the default nap period is 1 second unlike the head where the period is 10 seconds.
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
index d6ccf3d..6945fc6 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
@@ -6945,7 +6945,22 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
continue;
}
- if ((write_asize + HDR_GET_LSIZE(hdr)) > target_sz) {
+ /*
+ * We rely on the L1 portion of the header below, so
+ * it's invalid for this header to have been evicted out
+ * of the ghost cache, prior to being written out. The
+ * ARC_FLAG_L2_WRITING bit ensures this won't happen.
+ */
+ ASSERT(HDR_HAS_L1HDR(hdr));
+
+ ASSERT3U(HDR_GET_PSIZE(hdr), >, 0);
+ ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL);
+ ASSERT3U(arc_hdr_size(hdr), >, 0);
+ uint64_t size = arc_hdr_size(hdr);
+ uint64_t asize = vdev_psize_to_asize(dev->l2ad_vdev,
+ size);
+
+ if ((write_psize + asize) > target_sz) {
full = B_TRUE;
mutex_exit(hash_lock);
ARCSTAT_BUMP(arcstat_l2_write_full);
@@ -6980,21 +6995,6 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
list_insert_head(&dev->l2ad_buflist, hdr);
mutex_exit(&dev->l2ad_mtx);
- /*
- * We rely on the L1 portion of the header below, so
- * it's invalid for this header to have been evicted out
- * of the ghost cache, prior to being written out. The
- * ARC_FLAG_L2_WRITING bit ensures this won't happen.
- */
- ASSERT(HDR_HAS_L1HDR(hdr));
-
- ASSERT3U(HDR_GET_PSIZE(hdr), >, 0);
- ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL);
- ASSERT3U(arc_hdr_size(hdr), >, 0);
- uint64_t size = arc_hdr_size(hdr);
- uint64_t asize = vdev_psize_to_asize(dev->l2ad_vdev,
- size);
-
(void) refcount_add_many(&dev->l2ad_alloc, size, hdr);
/*
OpenPOWER on IntegriCloud