aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlexander Motin <[email protected]>2023-06-09 15:40:55 -0400
committerGitHub <[email protected]>2023-06-09 12:40:55 -0700
commit70ea484e3ec56c529c6c5027ffc43840100ce224 (patch)
treed006081f0701728fe2b3a743cbd47e54e25fbac2 /include
parent6db4ed51d6c2cd8ec6a3ad318118f7a0d6b6dfe8 (diff)
Finally drop long disabled vdev cache.
It was a vdev level read cache, designed to aggregate many small reads by speculatively issuing bigger reads instead and caching the result. But since it has almost no idea about what is going on with exception of ZIO_FLAG_DONT_CACHE flag set by higher layers, it was found to make more harm than good, for which reason it was disabled for the past 12 years. These days we have much better instruments to enlarge the I/Os, such as speculative and prescient prefetches, I/O scheduler, I/O aggregation etc. Besides just the dead code removal this removes one extra mutex lock/unlock per write inside vdev_cache_write(), not otherwise disabled and trying to do some work. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Closes #14953
Diffstat (limited to 'include')
-rw-r--r--include/os/linux/kernel/linux/mod_compat.h1
-rw-r--r--include/sys/spa.h4
-rw-r--r--include/sys/vdev.h6
-rw-r--r--include/sys/vdev_impl.h20
-rw-r--r--include/sys/zio.h1
5 files changed, 0 insertions, 32 deletions
diff --git a/include/os/linux/kernel/linux/mod_compat.h b/include/os/linux/kernel/linux/mod_compat.h
index 09d109d19..8e20a9613 100644
--- a/include/os/linux/kernel/linux/mod_compat.h
+++ b/include/os/linux/kernel/linux/mod_compat.h
@@ -68,7 +68,6 @@ enum scope_prefix_types {
zfs_trim,
zfs_txg,
zfs_vdev,
- zfs_vdev_cache,
zfs_vdev_file,
zfs_vdev_mirror,
zfs_vnops,
diff --git a/include/sys/spa.h b/include/sys/spa.h
index ed752967c..1fa204400 100644
--- a/include/sys/spa.h
+++ b/include/sys/spa.h
@@ -1174,10 +1174,6 @@ extern void zep_to_zb(uint64_t dataset, zbookmark_err_phys_t *zep,
zbookmark_phys_t *zb);
extern void name_to_errphys(char *buf, zbookmark_err_phys_t *zep);
-/* vdev cache */
-extern void vdev_cache_stat_init(void);
-extern void vdev_cache_stat_fini(void);
-
/* vdev mirror */
extern void vdev_mirror_stat_init(void);
extern void vdev_mirror_stat_fini(void);
diff --git a/include/sys/vdev.h b/include/sys/vdev.h
index d529bbcdd..26c834ff5 100644
--- a/include/sys/vdev.h
+++ b/include/sys/vdev.h
@@ -158,12 +158,6 @@ extern boolean_t vdev_allocatable(vdev_t *vd);
extern boolean_t vdev_accessible(vdev_t *vd, zio_t *zio);
extern boolean_t vdev_is_spacemap_addressable(vdev_t *vd);
-extern void vdev_cache_init(vdev_t *vd);
-extern void vdev_cache_fini(vdev_t *vd);
-extern boolean_t vdev_cache_read(zio_t *zio);
-extern void vdev_cache_write(zio_t *zio);
-extern void vdev_cache_purge(vdev_t *vd);
-
extern void vdev_queue_init(vdev_t *vd);
extern void vdev_queue_fini(vdev_t *vd);
extern zio_t *vdev_queue_io(zio_t *zio);
diff --git a/include/sys/vdev_impl.h b/include/sys/vdev_impl.h
index ea3043c82..74b3737d8 100644
--- a/include/sys/vdev_impl.h
+++ b/include/sys/vdev_impl.h
@@ -57,8 +57,6 @@ extern "C" {
* Forward declarations that lots of things need.
*/
typedef struct vdev_queue vdev_queue_t;
-typedef struct vdev_cache vdev_cache_t;
-typedef struct vdev_cache_entry vdev_cache_entry_t;
struct abd;
extern uint_t zfs_vdev_queue_depth_pct;
@@ -132,23 +130,6 @@ typedef const struct vdev_ops {
/*
* Virtual device properties
*/
-struct vdev_cache_entry {
- struct abd *ve_abd;
- uint64_t ve_offset;
- clock_t ve_lastused;
- avl_node_t ve_offset_node;
- avl_node_t ve_lastused_node;
- uint32_t ve_hits;
- uint16_t ve_missed_update;
- zio_t *ve_fill_io;
-};
-
-struct vdev_cache {
- avl_tree_t vc_offset_tree;
- avl_tree_t vc_lastused_tree;
- kmutex_t vc_lock;
-};
-
typedef struct vdev_queue_class {
uint32_t vqc_active;
@@ -443,7 +424,6 @@ struct vdev {
boolean_t vdev_resilver_deferred; /* resilver deferred */
boolean_t vdev_kobj_flag; /* kobj event record */
vdev_queue_t vdev_queue; /* I/O deadline schedule queue */
- vdev_cache_t vdev_cache; /* physical block cache */
spa_aux_vdev_t *vdev_aux; /* for l2cache and spares vdevs */
zio_t *vdev_probe_zio; /* root of current probe */
vdev_aux_t vdev_label_aux; /* on-disk aux state */
diff --git a/include/sys/zio.h b/include/sys/zio.h
index 695bc09e6..6b1352a72 100644
--- a/include/sys/zio.h
+++ b/include/sys/zio.h
@@ -190,7 +190,6 @@ typedef uint64_t zio_flag_t;
#define ZIO_FLAG_SPECULATIVE (1ULL << 8)
#define ZIO_FLAG_CONFIG_WRITER (1ULL << 9)
#define ZIO_FLAG_DONT_RETRY (1ULL << 10)
-#define ZIO_FLAG_DONT_CACHE (1ULL << 11)
#define ZIO_FLAG_NODATA (1ULL << 12)
#define ZIO_FLAG_INDUCE_DAMAGE (1ULL << 13)
#define ZIO_FLAG_IO_ALLOCATING (1ULL << 14)