Module Name:    src
Committed By:   jdolecek
Date:           Fri Jun 19 14:13:23 UTC 2020

Modified Files:
        src/external/cddl/osnet/dist/uts/common/fs/zfs: zio.c

Log Message:
use pool_cache for (meta)data buffers also on NetBSD

this should generally slightly improve performance on MP systems, and
specifically for xbd(4) storage avoids slow unaligned I/O buffer handling

this change requires updated kernel, to allow up to SPA_MAXBLOCKSHIFT item
size for pools

fixes PR kern/55397 by Frank Kardel


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/cddl/osnet/dist/uts/common/fs/zfs/zio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zio.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zio.c:1.6 src/external/cddl/osnet/dist/uts/common/fs/zfs/zio.c:1.7
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zio.c:1.6	Tue May  7 08:49:59 2019
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zio.c	Fri Jun 19 14:13:23 2020
@@ -46,7 +46,7 @@
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, zio, CTLFLAG_RW, 0, "ZFS ZIO");
 #ifdef __NetBSD__
-const int zio_use_uma = 0;
+const int zio_use_uma = 1;
 #else
 #if defined(__amd64__)
 static int zio_use_uma = 1;
@@ -156,7 +156,6 @@ zio_init(void)
 	zio_link_cache = kmem_cache_create("zio_link_cache",
 	    sizeof (zio_link_t), 0, NULL, NULL, NULL, NULL, NULL, 0);
 
-#ifndef __NetBSD__
 	if (!zio_use_uma)
 		goto out;
 
@@ -220,7 +219,6 @@ zio_init(void)
 			zio_data_buf_cache[c - 1] = zio_data_buf_cache[c];
 	}
 out:
-#endif /* __NetBSD__ */
 
 	zio_inject_init();
 
@@ -242,7 +240,6 @@ zio_fini(void)
 	kmem_cache_t *last_cache = NULL;
 	kmem_cache_t *last_data_cache = NULL;
 
-#ifndef __NetBSD__	
 	for (c = 0; c < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT; c++) {
 		if (zio_buf_cache[c] != last_cache) {
 			last_cache = zio_buf_cache[c];
@@ -256,7 +253,6 @@ zio_fini(void)
 		}
 		zio_data_buf_cache[c] = NULL;
 	}
-#endif /* __NetBSD__ */
 
 	kmem_cache_destroy(zio_link_cache);
 	kmem_cache_destroy(zio_cache);

Reply via email to