svn commit: r302991 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb vendor/illumos/dist/cmd/ztest

2016-07-18 Thread Andriy Gapon
Author: avg
Date: Mon Jul 18 06:57:24 2016
New Revision: 302991
URL: https://svnweb.freebsd.org/changeset/base/302991

Log:
  6950 ARC should cache compressed data
  
  illumos/illumos-gate@dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2
  
https://github.com/illumos/illumos-gate/commit/dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2
  
  https://www.illumos.org/issues/6950
When reading compressed data from disk, the ARC should keep the compressed
block cached and only decompress it when consumers access the block. The
uncompressed data should be short-lived allowing the ARC to cache a much 
larger
amount of data. The DMU would also maintain a smaller cache of uncompressed
blocks to minimize the impact of decompressing frequently accessed blocks.
  
  Reviewed by: Prakash Surya 
  Reviewed by: Dan Kimmel 
  Reviewed by: Matt Ahrens 
  Reviewed by: Paul Dagnelie 
  Reviewed by: Don Brady 
  Reviewed by: Richard Elling 
  Approved by: Richard Lowe 
  Author: George Wilson 

Modified:
  vendor/illumos/dist/cmd/zdb/zdb.c
  vendor/illumos/dist/cmd/ztest/ztest.c

Changes in other areas also in this revision:
Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/refcount.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_checksum.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/zio_checksum.c

Modified: vendor/illumos/dist/cmd/zdb/zdb.c
==
--- vendor/illumos/dist/cmd/zdb/zdb.c   Mon Jul 18 06:47:08 2016
(r302990)
+++ vendor/illumos/dist/cmd/zdb/zdb.c   Mon Jul 18 06:57:24 2016
(r302991)
@@ -1262,7 +1262,7 @@ visit_indirect(spa_t *spa, const dnode_p
}
if (!err)
ASSERT3U(fill, ==, BP_GET_FILL(bp));
-   (void) arc_buf_remove_ref(buf, );
+   arc_buf_destroy(buf, );
}
 
return (err);

Modified: vendor/illumos/dist/cmd/ztest/ztest.c
==
--- vendor/illumos/dist/cmd/ztest/ztest.c   Mon Jul 18 06:47:08 2016
(r302990)
+++ vendor/illumos/dist/cmd/ztest/ztest.c   Mon Jul 18 06:57:24 2016
(r302991)
@@ -187,6 +187,7 @@ extern uint64_t metaslab_gang_bang;
 extern uint64_t metaslab_df_alloc_threshold;
 extern uint64_t zfs_deadman_synctime_ms;
 extern int metaslab_preload_limit;
+extern boolean_t zfs_compressed_arc_enabled;
 
 static ztest_shared_opts_t *ztest_shared_opts;
 static ztest_shared_opts_t ztest_opts;
@@ -5353,6 +5354,12 @@ ztest_resume_thread(void *arg)
if (spa_suspended(spa))
ztest_resume(spa);
(void) poll(NULL, 0, 100);
+
+   /*
+* Periodically change the zfs_compressed_arc_enabled setting.
+*/
+   if (ztest_random(10) == 0)
+   zfs_compressed_arc_enabled = ztest_random(2);
}
return (NULL);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302991 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb vendor/illumos/dist/cmd/ztest

2016-07-18 Thread Andriy Gapon
Author: avg
Date: Mon Jul 18 06:57:24 2016
New Revision: 302991
URL: https://svnweb.freebsd.org/changeset/base/302991

Log:
  6950 ARC should cache compressed data
  
  illumos/illumos-gate@dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2
  
https://github.com/illumos/illumos-gate/commit/dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2
  
  https://www.illumos.org/issues/6950
When reading compressed data from disk, the ARC should keep the compressed
block cached and only decompress it when consumers access the block. The
uncompressed data should be short-lived allowing the ARC to cache a much 
larger
amount of data. The DMU would also maintain a smaller cache of uncompressed
blocks to minimize the impact of decompressing frequently accessed blocks.
  
  Reviewed by: Prakash Surya 
  Reviewed by: Dan Kimmel 
  Reviewed by: Matt Ahrens 
  Reviewed by: Paul Dagnelie 
  Reviewed by: Don Brady 
  Reviewed by: Richard Elling 
  Approved by: Richard Lowe 
  Author: George Wilson 

Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/refcount.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_checksum.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/zio_checksum.c

Changes in other areas also in this revision:
Modified:
  vendor/illumos/dist/cmd/zdb/zdb.c
  vendor/illumos/dist/cmd/ztest/ztest.c

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c
==
--- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Mon Jul 18 06:47:08 
2016(r302990)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Mon Jul 18 06:57:24 
2016(r302991)
@@ -120,9 +120,134 @@
  * - ARC header release, as it removes from L2ARC buflists
  */
 
+/*
+ * ARC operation:
+ *
+ * Every block that is in the ARC is tracked by an arc_buf_hdr_t structure.
+ * This structure can point either to a block that is still in the cache or to
+ * one that is only accessible in an L2 ARC device, or it can provide
+ * information about a block that was recently evicted. If a block is
+ * only accessible in the L2ARC, then the arc_buf_hdr_t only has enough
+ * information to retrieve it from the L2ARC device. This information is
+ * stored in the l2arc_buf_hdr_t sub-structure of the arc_buf_hdr_t. A block
+ * that is in this state cannot access the data directly.
+ *
+ * Blocks that are actively being referenced or have not been evicted
+ * are cached in the L1ARC. The L1ARC (l1arc_buf_hdr_t) is a structure within
+ * the arc_buf_hdr_t that will point to the data block in memory. A block can
+ * only be read by a consumer if it has an l1arc_buf_hdr_t. The L1ARC
+ * caches data in two ways -- in a list of arc buffers (arc_buf_t) and
+ * also in the arc_buf_hdr_t's private physical data block pointer (b_pdata).
+ * Each arc buffer (arc_buf_t) is being actively accessed by a specific ARC
+ * consumer, and always contains uncompressed data. The ARC will provide
+ * references to this data and will keep it cached until it is no longer in
+ * use. Typically, the arc will try to cache only the L1ARC's physical data
+ * block and will aggressively evict any arc_buf_t that is no longer 
referenced.
+ * The amount of memory consumed by the arc_buf_t's can be seen via the
+ * "overhead_size" kstat.
+ *
+ *
+ *arc_buf_hdr_t
+ *+---+
+ *|   |
+ *|   |
+ *|   |
+ *+---+
+ * l2arc_buf_hdr_t|   |
+ *|   |
+ *+---+
+ * l1arc_buf_hdr_t|   |
+ *|   | arc_buf_t
+ *|b_buf  +>+-+  arc_buf_t
+ *|   | |b_next   +>+-+
+ *|  b_pdata  +-+