Skip to content

Commit

Permalink
Implement allocation size ranges and use for gang leaves
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Dagnelie <paul.dagnelie@klarasystems.com>
  • Loading branch information
Paul Dagnelie committed Feb 6, 2025
1 parent 9843def commit d7c89cf
Show file tree
Hide file tree
Showing 18 changed files with 702 additions and 102 deletions.
10 changes: 8 additions & 2 deletions include/sys/metaslab.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern "C" {

typedef struct metaslab_ops {
const char *msop_name;
uint64_t (*msop_alloc)(metaslab_t *, uint64_t);
uint64_t (*msop_alloc)(metaslab_t *, uint64_t, uint64_t, uint64_t *);
} metaslab_ops_t;


Expand Down Expand Up @@ -85,7 +85,10 @@ uint64_t metaslab_largest_allocatable(metaslab_t *);

int metaslab_alloc(spa_t *, metaslab_class_t *, uint64_t,
blkptr_t *, int, uint64_t, blkptr_t *, int, zio_alloc_list_t *, zio_t *,
int);
int);
int metaslab_alloc_range(spa_t *, metaslab_class_t *, uint64_t, uint64_t,
blkptr_t *, int, uint64_t, blkptr_t *, int, zio_alloc_list_t *, zio_t *,
int);
int metaslab_alloc_dva(spa_t *, metaslab_class_t *, uint64_t,
dva_t *, int, dva_t *, uint64_t, int, zio_alloc_list_t *, int);
void metaslab_free(spa_t *, const blkptr_t *, uint64_t, boolean_t);
Expand All @@ -99,6 +102,7 @@ void metaslab_check_free(spa_t *, const blkptr_t *);

void metaslab_stat_init(void);
void metaslab_stat_fini(void);
void metaslab_trace_move(zio_alloc_list_t *, zio_alloc_list_t *);
void metaslab_trace_init(zio_alloc_list_t *);
void metaslab_trace_fini(zio_alloc_list_t *);

Expand Down Expand Up @@ -129,6 +133,8 @@ uint64_t metaslab_group_get_space(metaslab_group_t *);
void metaslab_group_histogram_verify(metaslab_group_t *);
uint64_t metaslab_group_fragmentation(metaslab_group_t *);
void metaslab_group_histogram_remove(metaslab_group_t *, metaslab_t *);
void metaslab_group_alloc_increment_all(spa_t *, blkptr_t *, const void *,
int, int);
void metaslab_group_alloc_decrement(spa_t *, uint64_t, const void *, int, int,
boolean_t);
void metaslab_group_alloc_verify(spa_t *, const blkptr_t *, const void *, int);
Expand Down
1 change: 1 addition & 0 deletions include/sys/zio.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ typedef uint64_t zio_flag_t;
#define ZIO_FLAG_REEXECUTED (1ULL << 30)
#define ZIO_FLAG_DELEGATED (1ULL << 31)
#define ZIO_FLAG_DIO_CHKSUM_ERR (1ULL << 32)
#define ZIO_FLAG_PREALLOCATED (1ULL << 33)

#define ZIO_ALLOCATOR_NONE (-1)
#define ZIO_HAS_ALLOCATOR(zio) ((zio)->io_allocator != ZIO_ALLOCATOR_NONE)
Expand Down
14 changes: 0 additions & 14 deletions man/man4/zfs.4
Original file line number Diff line number Diff line change
Expand Up @@ -2499,20 +2499,6 @@ the xattr so as to not accumulate duplicates.
.
.It Sy zio_requeue_io_start_cut_in_line Ns = Ns Sy 0 Ns | Ns 1 Pq int
Prioritize requeued I/O.
.It Sy zio_dynamic_gang_headers_enable Ns = Ns Sy 0 Ns | Ns 1 Pq int
Enable dynamically sized gang headers.
.Pp
When set to 0 (the default), the dynamic_gang_header feature will never be
activated, even if it is enabled.
All gang headers will store at most 3 children, regardless of the header's
allocated size on disk.
When set to 1, the dynamic_gang_header feature will be activated once a
gang allocation is larger than 512 bytes.
This will cause the gang header to store more more gang children on pools
with larger ashifts.
Enabling this flag and the feature will reduce multi-level gang trees,
but can result in more IOs for individual gang blocks.
.
.It Sy zio_taskq_batch_pct Ns = Ns Sy 80 Ns % Pq uint
Percentage of online CPUs which will run a worker thread for I/O.
These workers are responsible for I/O work such as compression, encryption,
Expand Down
Loading

0 comments on commit d7c89cf

Please sign in to comment.