mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Selectable block allocators
ZFS historically has had several space allocators that were dynamically selectable. While these have been retained in OpenZFS, only a single allocator has been statically compiled in. This patch compiles all allocators for OpenZFS and provides a module parameter to allow for manual selection between them. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ameer Hamza <ahamza@ixsystems.com> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Edmund Nadolski <edmund.nadolski@ixsystems.com> Closes #15218
This commit is contained in:
@@ -39,6 +39,7 @@ extern "C" {
|
||||
|
||||
|
||||
typedef struct metaslab_ops {
|
||||
const char *msop_name;
|
||||
uint64_t (*msop_alloc)(metaslab_t *, uint64_t);
|
||||
} metaslab_ops_t;
|
||||
|
||||
|
||||
@@ -1056,6 +1056,8 @@ extern uint64_t spa_deadman_synctime(spa_t *spa);
|
||||
extern uint64_t spa_deadman_ziotime(spa_t *spa);
|
||||
extern uint64_t spa_dirty_data(spa_t *spa);
|
||||
extern spa_autotrim_t spa_get_autotrim(spa_t *spa);
|
||||
extern int spa_get_allocator(spa_t *spa);
|
||||
extern void spa_set_allocator(spa_t *spa, const char *allocator);
|
||||
|
||||
/* Miscellaneous support routines */
|
||||
extern void spa_load_failed(spa_t *spa, const char *fmt, ...)
|
||||
@@ -1207,6 +1209,7 @@ int param_set_deadman_ziotime(ZFS_MODULE_PARAM_ARGS);
|
||||
int param_set_deadman_synctime(ZFS_MODULE_PARAM_ARGS);
|
||||
int param_set_slop_shift(ZFS_MODULE_PARAM_ARGS);
|
||||
int param_set_deadman_failmode(ZFS_MODULE_PARAM_ARGS);
|
||||
int param_set_active_allocator(ZFS_MODULE_PARAM_ARGS);
|
||||
|
||||
#ifdef ZFS_DEBUG
|
||||
#define dprintf_bp(bp, fmt, ...) do { \
|
||||
|
||||
@@ -263,6 +263,7 @@ struct spa {
|
||||
*/
|
||||
spa_alloc_t *spa_allocs;
|
||||
int spa_alloc_count;
|
||||
int spa_active_allocator; /* selectable allocator */
|
||||
|
||||
spa_aux_vdev_t spa_spares; /* hot spares */
|
||||
spa_aux_vdev_t spa_l2cache; /* L2ARC cache devices */
|
||||
@@ -467,6 +468,8 @@ extern int param_set_deadman_failmode_common(const char *val);
|
||||
extern void spa_set_deadman_synctime(hrtime_t ns);
|
||||
extern void spa_set_deadman_ziotime(hrtime_t ns);
|
||||
extern const char *spa_history_zone(void);
|
||||
extern const char *zfs_active_allocator;
|
||||
extern int param_set_active_allocator_common(const char *val);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user