summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2014-01-16 15:57:39 +0000
committeravg <avg@FreeBSD.org>2014-01-16 15:57:39 +0000
commit26096ba436a54f225f8e56bb965a0e2214256c71 (patch)
treea24d61eb5c3c255647d4c4bb29075b63b1da94fc /cddl
parent81894fb568ed816e9e9f3a43f778e69751857339 (diff)
downloadFreeBSD-src-26096ba436a54f225f8e56bb965a0e2214256c71.zip
FreeBSD-src-26096ba436a54f225f8e56bb965a0e2214256c71.tar.gz
MFC r258632,258704: MFV r255255: 4045 zfs write throttle & i/o scheduler
performance work Sponsored by: HybridCluster [merge]
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/cmd/ztest/ztest.c14
-rw-r--r--cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h3
2 files changed, 10 insertions, 7 deletions
diff --git a/cddl/contrib/opensolaris/cmd/ztest/ztest.c b/cddl/contrib/opensolaris/cmd/ztest/ztest.c
index b6dcf09..2b2e59a 100644
--- a/cddl/contrib/opensolaris/cmd/ztest/ztest.c
+++ b/cddl/contrib/opensolaris/cmd/ztest/ztest.c
@@ -186,7 +186,7 @@ static const ztest_shared_opts_t ztest_opts_defaults = {
extern uint64_t metaslab_gang_bang;
extern uint64_t metaslab_df_alloc_threshold;
-extern uint64_t zfs_deadman_synctime;
+extern uint64_t zfs_deadman_synctime_ms;
static ztest_shared_opts_t *ztest_shared_opts;
static ztest_shared_opts_t ztest_opts;
@@ -5328,10 +5328,10 @@ ztest_deadman_thread(void *arg)
hrtime_t delta, total = 0;
for (;;) {
- delta = (zs->zs_thread_stop - zs->zs_thread_start) /
- NANOSEC + zfs_deadman_synctime;
+ delta = zs->zs_thread_stop - zs->zs_thread_start +
+ MSEC2NSEC(zfs_deadman_synctime_ms);
- (void) poll(NULL, 0, (int)(1000 * delta));
+ (void) poll(NULL, 0, (int)NSEC2MSEC(delta));
/*
* If the pool is suspended then fail immediately. Otherwise,
@@ -5342,12 +5342,12 @@ ztest_deadman_thread(void *arg)
if (spa_suspended(spa)) {
fatal(0, "aborting test after %llu seconds because "
"pool has transitioned to a suspended state.",
- zfs_deadman_synctime);
+ zfs_deadman_synctime_ms / 1000);
return (NULL);
}
vdev_deadman(spa->spa_root_vdev);
- total += zfs_deadman_synctime;
+ total += zfs_deadman_synctime_ms/1000;
(void) printf("ztest has been running for %lld seconds\n",
total);
}
@@ -6080,7 +6080,7 @@ main(int argc, char **argv)
(void) setvbuf(stdout, NULL, _IOLBF, 0);
dprintf_setup(&argc, argv);
- zfs_deadman_synctime = 300;
+ zfs_deadman_synctime_ms = 300000;
ztest_fd_rand = open("/dev/urandom", O_RDONLY);
ASSERT3S(ztest_fd_rand, >=, 0);
diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h b/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
index 4b3401a..471756d 100644
--- a/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
+++ b/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
@@ -65,6 +65,7 @@ extern "C" {
#include <inttypes.h>
#include <fsshare.h>
#include <pthread.h>
+#include <sched.h>
#include <sys/debug.h>
#include <sys/note.h>
#include <sys/types.h>
@@ -204,6 +205,8 @@ extern int aok;
*/
#define curthread ((void *)(uintptr_t)thr_self())
+#define kpreempt(x) sched_yield()
+
typedef struct kthread kthread_t;
#define thread_create(stk, stksize, func, arg, len, pp, state, pri) \
OpenPOWER on IntegriCloud