Skip to content

Commit d7c89cf

Browse files
author
Paul Dagnelie
committed
Implement allocation size ranges and use for gang leaves
Signed-off-by: Paul Dagnelie <[email protected]>
1 parent 9843def commit d7c89cf

18 files changed

+702
-102
lines changed

include/sys/metaslab.h

+8-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extern "C" {
4040

4141
typedef struct metaslab_ops {
4242
const char *msop_name;
43-
uint64_t (*msop_alloc)(metaslab_t *, uint64_t);
43+
uint64_t (*msop_alloc)(metaslab_t *, uint64_t, uint64_t, uint64_t *);
4444
} metaslab_ops_t;
4545

4646

@@ -85,7 +85,10 @@ uint64_t metaslab_largest_allocatable(metaslab_t *);
8585

8686
int metaslab_alloc(spa_t *, metaslab_class_t *, uint64_t,
8787
blkptr_t *, int, uint64_t, blkptr_t *, int, zio_alloc_list_t *, zio_t *,
88-
int);
88+
int);
89+
int metaslab_alloc_range(spa_t *, metaslab_class_t *, uint64_t, uint64_t,
90+
blkptr_t *, int, uint64_t, blkptr_t *, int, zio_alloc_list_t *, zio_t *,
91+
int);
8992
int metaslab_alloc_dva(spa_t *, metaslab_class_t *, uint64_t,
9093
dva_t *, int, dva_t *, uint64_t, int, zio_alloc_list_t *, int);
9194
void metaslab_free(spa_t *, const blkptr_t *, uint64_t, boolean_t);
@@ -99,6 +102,7 @@ void metaslab_check_free(spa_t *, const blkptr_t *);
99102

100103
void metaslab_stat_init(void);
101104
void metaslab_stat_fini(void);
105+
void metaslab_trace_move(zio_alloc_list_t *, zio_alloc_list_t *);
102106
void metaslab_trace_init(zio_alloc_list_t *);
103107
void metaslab_trace_fini(zio_alloc_list_t *);
104108

@@ -129,6 +133,8 @@ uint64_t metaslab_group_get_space(metaslab_group_t *);
129133
void metaslab_group_histogram_verify(metaslab_group_t *);
130134
uint64_t metaslab_group_fragmentation(metaslab_group_t *);
131135
void metaslab_group_histogram_remove(metaslab_group_t *, metaslab_t *);
136+
void metaslab_group_alloc_increment_all(spa_t *, blkptr_t *, const void *,
137+
int, int);
132138
void metaslab_group_alloc_decrement(spa_t *, uint64_t, const void *, int, int,
133139
boolean_t);
134140
void metaslab_group_alloc_verify(spa_t *, const blkptr_t *, const void *, int);

include/sys/zio.h

+1
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ typedef uint64_t zio_flag_t;
246246
#define ZIO_FLAG_REEXECUTED (1ULL << 30)
247247
#define ZIO_FLAG_DELEGATED (1ULL << 31)
248248
#define ZIO_FLAG_DIO_CHKSUM_ERR (1ULL << 32)
249+
#define ZIO_FLAG_PREALLOCATED (1ULL << 33)
249250

250251
#define ZIO_ALLOCATOR_NONE (-1)
251252
#define ZIO_HAS_ALLOCATOR(zio) ((zio)->io_allocator != ZIO_ALLOCATOR_NONE)

man/man4/zfs.4

-14
Original file line numberDiff line numberDiff line change
@@ -2499,20 +2499,6 @@ the xattr so as to not accumulate duplicates.
24992499
.
25002500
.It Sy zio_requeue_io_start_cut_in_line Ns = Ns Sy 0 Ns | Ns 1 Pq int
25012501
Prioritize requeued I/O.
2502-
.It Sy zio_dynamic_gang_headers_enable Ns = Ns Sy 0 Ns | Ns 1 Pq int
2503-
Enable dynamically sized gang headers.
2504-
.Pp
2505-
When set to 0 (the default), the dynamic_gang_header feature will never be
2506-
activated, even if it is enabled.
2507-
All gang headers will store at most 3 children, regardless of the header's
2508-
allocated size on disk.
2509-
When set to 1, the dynamic_gang_header feature will be activated once a
2510-
gang allocation is larger than 512 bytes.
2511-
This will cause the gang header to store more more gang children on pools
2512-
with larger ashifts.
2513-
Enabling this flag and the feature will reduce multi-level gang trees,
2514-
but can result in more IOs for individual gang blocks.
2515-
.
25162502
.It Sy zio_taskq_batch_pct Ns = Ns Sy 80 Ns % Pq uint
25172503
Percentage of online CPUs which will run a worker thread for I/O.
25182504
These workers are responsible for I/O work such as compression, encryption,

0 commit comments

Comments
 (0)