summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2014-08-02 04:01:44 +0000
committerdelphij <delphij@FreeBSD.org>2014-08-02 04:01:44 +0000
commit2f2875361e19bf1fdf4fde5c8e1763dcc4190620 (patch)
tree6ad33d201a6ec72b3227e7189157d71363c85e0c /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
parentb798cd9bfe5eed52bd7d48badb239999a0d81389 (diff)
downloadFreeBSD-src-2f2875361e19bf1fdf4fde5c8e1763dcc4190620.zip
FreeBSD-src-2f2875361e19bf1fdf4fde5c8e1763dcc4190620.tar.gz
MFC r268859: MFV r268851:
When a sync task is waiting for a txg to complete, we should hurry it along by increasing the number of outstanding async writes (i.e. make vdev_queue_max_async_writes() return a larger number). Illumos issue: 4753 increase number of outstanding async writes when sync task is waiting
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
index 0201bef..83c6b5f76 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Portions Copyright 2011 Martin Matuska <mm@FreeBSD.org>
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
*/
#include <sys/zfs_context.h>
@@ -727,6 +727,24 @@ txg_list_empty(txg_list_t *tl, uint64_t txg)
}
/*
+ * Returns true if all txg lists are empty.
+ *
+ * Warning: this is inherently racy (an item could be added immediately after this
+ * function returns). We don't bother with the lock because it wouldn't change the
+ * semantics.
+ */
+boolean_t
+txg_all_lists_empty(txg_list_t *tl)
+{
+ for (int i = 0; i < TXG_SIZE; i++) {
+ if (!txg_list_empty(tl, i)) {
+ return (B_FALSE);
+ }
+ }
+ return (B_TRUE);
+}
+
+/*
* Add an entry to the list (unless it's already on the list).
* Returns B_TRUE if it was actually added.
*/
OpenPOWER on IntegriCloud