Commit 924e600d authored by Mike Snitzer's avatar Mike Snitzer Committed by Alasdair G Kergon

dm: eliminate some holes data structures

Eliminate a 4-byte hole in 'struct dm_io_memory' by moving 'offset' above the
'ptr' to which it applies (size reduced from 24 to 16 bytes).  And by
association, 1-4 byte hole is eliminated in 'struct dm_io_request' (size
reduced from 56 to 48 bytes).

Eliminate all 6 4-byte holes and 1 cache-line in 'struct dm_snapshot' (size
reduced from 392 to 368 bytes).
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent 3abf85b5
...@@ -83,10 +83,10 @@ struct dm_snapshot { ...@@ -83,10 +83,10 @@ struct dm_snapshot {
/* Whether or not owning mapped_device is suspended */ /* Whether or not owning mapped_device is suspended */
int suspended; int suspended;
mempool_t *pending_pool;
atomic_t pending_exceptions_count; atomic_t pending_exceptions_count;
mempool_t *pending_pool;
struct dm_exception_table pending; struct dm_exception_table pending;
struct dm_exception_table complete; struct dm_exception_table complete;
...@@ -96,6 +96,11 @@ struct dm_snapshot { ...@@ -96,6 +96,11 @@ struct dm_snapshot {
*/ */
spinlock_t pe_lock; spinlock_t pe_lock;
/* Chunks with outstanding reads */
spinlock_t tracked_chunk_lock;
mempool_t *tracked_chunk_pool;
struct hlist_head tracked_chunk_hash[DM_TRACKED_CHUNK_HASH_SIZE];
/* The on disk metadata handler */ /* The on disk metadata handler */
struct dm_exception_store *store; struct dm_exception_store *store;
...@@ -105,10 +110,12 @@ struct dm_snapshot { ...@@ -105,10 +110,12 @@ struct dm_snapshot {
struct bio_list queued_bios; struct bio_list queued_bios;
struct work_struct queued_bios_work; struct work_struct queued_bios_work;
/* Chunks with outstanding reads */ /* Wait for events based on state_bits */
mempool_t *tracked_chunk_pool; unsigned long state_bits;
spinlock_t tracked_chunk_lock;
struct hlist_head tracked_chunk_hash[DM_TRACKED_CHUNK_HASH_SIZE]; /* Range of chunks currently being merged. */
chunk_t first_merging_chunk;
int num_merging_chunks;
/* /*
* The merge operation failed if this flag is set. * The merge operation failed if this flag is set.
...@@ -125,13 +132,6 @@ struct dm_snapshot { ...@@ -125,13 +132,6 @@ struct dm_snapshot {
*/ */
int merge_failed; int merge_failed;
/* Wait for events based on state_bits */
unsigned long state_bits;
/* Range of chunks currently being merged. */
chunk_t first_merging_chunk;
int num_merging_chunks;
/* /*
* Incoming bios that overlap with chunks being merged must wait * Incoming bios that overlap with chunks being merged must wait
* for them to be committed. * for them to be committed.
......
...@@ -37,14 +37,14 @@ enum dm_io_mem_type { ...@@ -37,14 +37,14 @@ enum dm_io_mem_type {
struct dm_io_memory { struct dm_io_memory {
enum dm_io_mem_type type; enum dm_io_mem_type type;
unsigned offset;
union { union {
struct page_list *pl; struct page_list *pl;
struct bio_vec *bvec; struct bio_vec *bvec;
void *vma; void *vma;
void *addr; void *addr;
} ptr; } ptr;
unsigned offset;
}; };
struct dm_io_notify { struct dm_io_notify {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment