mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
L2ARC: Implement per-device feed threads for parallel writes
Transform L2ARC from single global feed thread to per-device threads, enabling parallel writes to multiple L2ARC devices. Each device runs its own feed thread independently, improving multi-device throughput. Previously, a single thread served all devices sequentially; now each device writes concurrently. Threads are created during device addition and torn down on removal. Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ameer Hamza <ahamza@ixsystems.com> Closes #18093
This commit is contained in:
committed by
Brian Behlendorf
parent
825dc41ad4
commit
b525525b44
@@ -354,8 +354,6 @@ boolean_t l2arc_range_check_overlap(uint64_t bottom, uint64_t top,
|
||||
uint64_t check);
|
||||
void l2arc_init(void);
|
||||
void l2arc_fini(void);
|
||||
void l2arc_start(void);
|
||||
void l2arc_stop(void);
|
||||
void l2arc_spa_rebuild_start(spa_t *spa);
|
||||
void l2arc_spa_rebuild_stop(spa_t *spa);
|
||||
|
||||
|
||||
+19
-1
@@ -41,14 +41,25 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We can feed L2ARC from two states of ARC buffers, mru and mfu,
|
||||
* and each of the states has two types: data and metadata.
|
||||
*/
|
||||
#define L2ARC_FEED_TYPES 4
|
||||
|
||||
/*
|
||||
* L2ARC state and statistics for persistent marker management.
|
||||
*/
|
||||
typedef struct l2arc_info {
|
||||
arc_buf_hdr_t ***l2arc_markers; /* persistent markers */
|
||||
arc_buf_hdr_t **l2arc_markers[L2ARC_FEED_TYPES];
|
||||
uint64_t l2arc_total_writes; /* total writes for reset */
|
||||
uint64_t l2arc_total_capacity; /* total L2ARC capacity */
|
||||
uint64_t l2arc_smallest_capacity; /* smallest device capacity */
|
||||
/*
|
||||
* Per-device thread coordination for sublist processing
|
||||
*/
|
||||
boolean_t *l2arc_sublist_busy[L2ARC_FEED_TYPES];
|
||||
kmutex_t l2arc_sublist_lock; /* protects busy flags */
|
||||
} l2arc_info_t;
|
||||
|
||||
/*
|
||||
@@ -431,6 +442,13 @@ typedef struct l2arc_dev {
|
||||
*/
|
||||
zfs_refcount_t l2ad_lb_count;
|
||||
boolean_t l2ad_trim_all; /* TRIM whole device */
|
||||
/*
|
||||
* Per-device feed thread for parallel L2ARC writes
|
||||
*/
|
||||
kthread_t *l2ad_feed_thread; /* feed thread handle */
|
||||
boolean_t l2ad_thread_exit; /* signal thread exit */
|
||||
kmutex_t l2ad_feed_thr_lock; /* thread sleep/wake */
|
||||
kcondvar_t l2ad_feed_cv; /* thread wakeup cv */
|
||||
} l2arc_dev_t;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user