Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pack dmu_buf_impl_t by 16 bytes #16684

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 24 additions & 29 deletions include/sys/dbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,27 @@ typedef struct dmu_buf_impl {
*/
uint8_t db_level;

/* This block was freed while a read or write was active. */
uint8_t db_freed_in_flight;

/*
* Evict user data as soon as the dirty and reference counts are equal.
*/
uint8_t db_user_immediate_evict;

/*
* dnode_evict_dbufs() or dnode_evict_bonus() tried to evict this dbuf,
* but couldn't due to outstanding references. Evict once the refcount
* drops to 0.
*/
uint8_t db_pending_evict;

/* Number of TXGs in which this buffer is dirty. */
uint8_t db_dirtycnt;

/* The buffer was partially read. More reads may follow. */
uint8_t db_partial_read;

/*
* Protects db_buf's contents if they contain an indirect block or data
* block of the meta-dnode. We use this lock to protect the structure of
Expand All @@ -288,6 +309,9 @@ typedef struct dmu_buf_impl {
*/
dbuf_states_t db_state;

/* In which dbuf cache this dbuf is, if any. */
dbuf_cached_state_t db_caching_status;

/*
* Refcount accessed by dmu_buf_{hold,rele}.
* If nonzero, the buffer can't be destroyed.
Expand All @@ -304,39 +328,10 @@ typedef struct dmu_buf_impl {
/* Link in dbuf_cache or dbuf_metadata_cache */
multilist_node_t db_cache_link;

/* Tells us which dbuf cache this dbuf is in, if any */
dbuf_cached_state_t db_caching_status;

uint64_t db_hash;

/* Data which is unique to data (leaf) blocks: */

/* User callback information. */
dmu_buf_user_t *db_user;

/*
* Evict user data as soon as the dirty and reference
* counts are equal.
*/
uint8_t db_user_immediate_evict;

/*
* This block was freed while a read or write was
* active.
*/
uint8_t db_freed_in_flight;

/*
* dnode_evict_dbufs() or dnode_evict_bonus() tried to
* evict this dbuf, but couldn't due to outstanding
* references. Evict once the refcount drops to 0.
*/
uint8_t db_pending_evict;

uint8_t db_dirtycnt;

/* The buffer was partially read. More reads may follow. */
uint8_t db_partial_read;
} dmu_buf_impl_t;

#define DBUF_HASH_MUTEX(h, idx) \
Expand Down
Loading