Skip to content

Commit

Permalink
During pool export flush the ARC asynchronously
Browse files Browse the repository at this point in the history
This also includes removing L2 vdevs asynchronously

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.

Signed-off-by: Don Brady <don.brady@klarasystems.com>
  • Loading branch information
don-brady committed Jun 26, 2024
1 parent efbef9e commit 03db4c3
Show file tree
Hide file tree
Showing 4 changed files with 217 additions and 58 deletions.
8 changes: 8 additions & 0 deletions include/sys/arc.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,15 @@ extern "C" {
(hdr)->b_psize = ((x) >> SPA_MINBLOCKSHIFT); \
} while (0)

/* The asize in the header is only used by L2 cache */
#define HDR_SET_ASIZE(hdr, x) do { \
ASSERT(IS_P2ALIGNED((x), 1U << SPA_MINBLOCKSHIFT)); \
(hdr)->b_asize = ((x) >> SPA_MINBLOCKSHIFT); \
} while (0)

#define HDR_GET_LSIZE(hdr) ((hdr)->b_lsize << SPA_MINBLOCKSHIFT)
#define HDR_GET_PSIZE(hdr) ((hdr)->b_psize << SPA_MINBLOCKSHIFT)
#define HDR_GET_ASIZE(hdr) ((hdr)->b_asize << SPA_MINBLOCKSHIFT)

typedef struct arc_buf_hdr arc_buf_hdr_t;
typedef struct arc_buf arc_buf_t;
Expand Down Expand Up @@ -312,6 +319,7 @@ void arc_remove_prune_callback(arc_prune_t *p);
void arc_freed(spa_t *spa, const blkptr_t *bp);

void arc_flush(spa_t *spa, boolean_t retry);
void arc_flush_async(spa_t *spa);
void arc_tempreserve_clear(uint64_t reserve);
int arc_tempreserve_space(spa_t *spa, uint64_t reserve, uint64_t txg);

Expand Down
8 changes: 4 additions & 4 deletions include/sys/arc_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ typedef struct l2arc_lb_ptr_buf {
* L2ARC Internals
*/
typedef struct l2arc_dev {
vdev_t *l2ad_vdev; /* vdev */
spa_t *l2ad_spa; /* spa */
vdev_t *l2ad_vdev; /* can be NULL during remove */
spa_t *l2ad_spa; /* can be NULL during remove */
uint64_t l2ad_hand; /* next write location */
uint64_t l2ad_start; /* first addr on device */
uint64_t l2ad_end; /* last addr on device */
Expand Down Expand Up @@ -475,8 +475,8 @@ struct arc_buf_hdr {

arc_buf_contents_t b_type;
uint8_t b_complevel;
uint8_t b_reserved1; /* used for 4 byte alignment */
uint16_t b_reserved2; /* used for 4 byte alignment */
uint8_t b_reserved1; /* used for 4 byte alignment */
uint16_t b_asize; /* alignment or L2-only asize */
arc_buf_hdr_t *b_hash_next;
arc_flags_t b_flags;

Expand Down
Loading

0 comments on commit 03db4c3

Please sign in to comment.