mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 19:04:45 +03:00
OpenZFS 7303 - dynamic metaslab selection
This change introduces a new weighting algorithm to improve metaslab selection. The new weighting algorithm relies on the SPACEMAP_HISTOGRAM feature. As a result, the metaslab weight now encodes the type of weighting algorithm used (size-based vs segment-based). Porting Notes: The metaslab allocation tracing code is conditionally removed on linux (dependent on mdb debugger). Authored by: George Wilson <george.wilson@delphix.com> Reviewed by: Alex Reece <alex@delphix.com> Reviewed by: Chris Siden <christopher.siden@delphix.com> Reviewed by: Dan Kimmel <dan.kimmel@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com> Reviewed by: Pavel Zakharov pavel.zakharov@delphix.com Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Don Brady <don.brady@intel.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Ported-by: Don Brady <don.brady@intel.com> OpenZFS-issue: https://www.illumos.org/issues/7303 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/d5190931bd Closes #5404
This commit is contained in:
committed by
Brian Behlendorf
parent
5727b00e06
commit
4e21fd060a
+10
-3
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2015 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2011, 2016 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_METASLAB_H
|
||||
@@ -36,10 +36,12 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct metaslab_ops {
|
||||
uint64_t (*msop_alloc)(metaslab_t *msp, uint64_t size);
|
||||
uint64_t (*msop_alloc)(metaslab_t *, uint64_t);
|
||||
} metaslab_ops_t;
|
||||
|
||||
|
||||
extern metaslab_ops_t *zfs_metaslab_ops;
|
||||
|
||||
int metaslab_init(metaslab_group_t *, uint64_t, uint64_t, uint64_t,
|
||||
@@ -64,13 +66,18 @@ uint64_t metaslab_block_maxsize(metaslab_t *);
|
||||
#define METASLAB_FASTWRITE 0x20
|
||||
|
||||
int metaslab_alloc(spa_t *, metaslab_class_t *, uint64_t,
|
||||
blkptr_t *, int, uint64_t, blkptr_t *, int, zio_t *);
|
||||
blkptr_t *, int, uint64_t, blkptr_t *, int, zio_alloc_list_t *, zio_t *);
|
||||
void metaslab_free(spa_t *, const blkptr_t *, uint64_t, boolean_t);
|
||||
int metaslab_claim(spa_t *, const blkptr_t *, uint64_t);
|
||||
void metaslab_check_free(spa_t *, const blkptr_t *);
|
||||
void metaslab_fastwrite_mark(spa_t *, const blkptr_t *);
|
||||
void metaslab_fastwrite_unmark(spa_t *, const blkptr_t *);
|
||||
|
||||
void metaslab_alloc_trace_init(void);
|
||||
void metaslab_alloc_trace_fini(void);
|
||||
void metaslab_trace_init(zio_alloc_list_t *);
|
||||
void metaslab_trace_fini(zio_alloc_list_t *);
|
||||
|
||||
metaslab_class_t *metaslab_class_create(spa_t *, metaslab_ops_t *);
|
||||
void metaslab_class_destroy(metaslab_class_t *);
|
||||
int metaslab_class_validate(metaslab_class_t *);
|
||||
|
||||
Reference in New Issue
Block a user