Print this page
4045 zfs write throttle & i/o scheduler performance work
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/fs/zfs/sys/txg.h
+++ new/usr/src/uts/common/fs/zfs/sys/txg.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25 /*
26 - * Copyright (c) 2012 by Delphix. All rights reserved.
26 + * Copyright (c) 2013 by Delphix. All rights reserved.
27 27 */
28 28
29 29 #ifndef _SYS_TXG_H
30 30 #define _SYS_TXG_H
31 31
32 32 #include <sys/spa.h>
33 33 #include <sys/zfs_context.h>
34 34
35 35 #ifdef __cplusplus
36 36 extern "C" {
37 37 #endif
38 38
39 39 #define TXG_CONCURRENT_STATES 3 /* open, quiescing, syncing */
40 40 #define TXG_SIZE 4 /* next power of 2 */
41 41 #define TXG_MASK (TXG_SIZE - 1) /* mask for size */
42 42 #define TXG_INITIAL TXG_SIZE /* initial txg */
43 43 #define TXG_IDX (txg & TXG_MASK)
44 44
45 45 /* Number of txgs worth of frees we defer adding to in-core spacemaps */
46 46 #define TXG_DEFER_SIZE 2
47 47
48 48 typedef struct tx_cpu tx_cpu_t;
49 49
50 50 typedef struct txg_handle {
51 51 tx_cpu_t *th_cpu;
52 52 uint64_t th_txg;
53 53 } txg_handle_t;
54 54
55 55 typedef struct txg_node {
56 56 struct txg_node *tn_next[TXG_SIZE];
57 57 uint8_t tn_member[TXG_SIZE];
58 58 } txg_node_t;
59 59
60 60 typedef struct txg_list {
61 61 kmutex_t tl_lock;
62 62 size_t tl_offset;
63 63 txg_node_t *tl_head[TXG_SIZE];
64 64 } txg_list_t;
65 65
66 66 struct dsl_pool;
67 67
68 68 extern void txg_init(struct dsl_pool *dp, uint64_t txg);
↓ open down ↓ |
32 lines elided |
↑ open up ↑ |
69 69 extern void txg_fini(struct dsl_pool *dp);
70 70 extern void txg_sync_start(struct dsl_pool *dp);
71 71 extern void txg_sync_stop(struct dsl_pool *dp);
72 72 extern uint64_t txg_hold_open(struct dsl_pool *dp, txg_handle_t *txghp);
73 73 extern void txg_rele_to_quiesce(txg_handle_t *txghp);
74 74 extern void txg_rele_to_sync(txg_handle_t *txghp);
75 75 extern void txg_register_callbacks(txg_handle_t *txghp, list_t *tx_callbacks);
76 76
77 77 extern void txg_delay(struct dsl_pool *dp, uint64_t txg, hrtime_t delta,
78 78 hrtime_t resolution);
79 +extern void txg_kick(struct dsl_pool *dp);
79 80
80 81 /*
81 82 * Wait until the given transaction group has finished syncing.
82 83 * Try to make this happen as soon as possible (eg. kick off any
83 84 * necessary syncs immediately). If txg==0, wait for the currently open
84 85 * txg to finish syncing.
85 86 */
86 87 extern void txg_wait_synced(struct dsl_pool *dp, uint64_t txg);
87 88
88 89 /*
89 90 * Wait until the given transaction group, or one after it, is
90 91 * the open transaction group. Try to make this happen as soon
91 92 * as possible (eg. kick off any necessary syncs immediately).
92 93 * If txg == 0, wait for the next open txg.
93 94 */
94 95 extern void txg_wait_open(struct dsl_pool *dp, uint64_t txg);
95 96
96 97 /*
97 98 * Returns TRUE if we are "backed up" waiting for the syncing
98 99 * transaction to complete; otherwise returns FALSE.
99 100 */
100 101 extern boolean_t txg_stalled(struct dsl_pool *dp);
101 102
102 103 /* returns TRUE if someone is waiting for the next txg to sync */
103 104 extern boolean_t txg_sync_waiting(struct dsl_pool *dp);
104 105
105 106 /*
106 107 * Per-txg object lists.
107 108 */
108 109
109 110 #define TXG_CLEAN(txg) ((txg) - 1)
110 111
111 112 extern void txg_list_create(txg_list_t *tl, size_t offset);
112 113 extern void txg_list_destroy(txg_list_t *tl);
113 114 extern boolean_t txg_list_empty(txg_list_t *tl, uint64_t txg);
114 115 extern boolean_t txg_list_add(txg_list_t *tl, void *p, uint64_t txg);
115 116 extern boolean_t txg_list_add_tail(txg_list_t *tl, void *p, uint64_t txg);
116 117 extern void *txg_list_remove(txg_list_t *tl, uint64_t txg);
117 118 extern void *txg_list_remove_this(txg_list_t *tl, void *p, uint64_t txg);
118 119 extern boolean_t txg_list_member(txg_list_t *tl, void *p, uint64_t txg);
119 120 extern void *txg_list_head(txg_list_t *tl, uint64_t txg);
120 121 extern void *txg_list_next(txg_list_t *tl, void *p, uint64_t txg);
121 122
122 123 #ifdef __cplusplus
123 124 }
124 125 #endif
125 126
126 127 #endif /* _SYS_TXG_H */
↓ open down ↓ |
38 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX