Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>

authored by

Mike Snitzer and committed by
Alasdair G Kergon
924e600d 3abf85b5

+15 -15
+13 -13
drivers/md/dm-snap.c
··· 83 83 /* Whether or not owning mapped_device is suspended */ 84 84 int suspended; 85 85 86 - mempool_t *pending_pool; 87 - 88 86 atomic_t pending_exceptions_count; 87 + 88 + mempool_t *pending_pool; 89 89 90 90 struct dm_exception_table pending; 91 91 struct dm_exception_table complete; ··· 96 96 */ 97 97 spinlock_t pe_lock; 98 98 99 + /* Chunks with outstanding reads */ 100 + spinlock_t tracked_chunk_lock; 101 + mempool_t *tracked_chunk_pool; 102 + struct hlist_head tracked_chunk_hash[DM_TRACKED_CHUNK_HASH_SIZE]; 103 + 99 104 /* The on disk metadata handler */ 100 105 struct dm_exception_store *store; 101 106 ··· 110 105 struct bio_list queued_bios; 111 106 struct work_struct queued_bios_work; 112 107 113 - /* Chunks with outstanding reads */ 114 - mempool_t *tracked_chunk_pool; 115 - spinlock_t tracked_chunk_lock; 116 - struct hlist_head tracked_chunk_hash[DM_TRACKED_CHUNK_HASH_SIZE]; 108 + /* Wait for events based on state_bits */ 109 + unsigned long state_bits; 110 + 111 + /* Range of chunks currently being merged. */ 112 + chunk_t first_merging_chunk; 113 + int num_merging_chunks; 117 114 118 115 /* 119 116 * The merge operation failed if this flag is set. ··· 131 124 * => stop merging; set merge_failed; process I/O normally. 132 125 */ 133 126 int merge_failed; 134 - 135 - /* Wait for events based on state_bits */ 136 - unsigned long state_bits; 137 - 138 - /* Range of chunks currently being merged. */ 139 - chunk_t first_merging_chunk; 140 - int num_merging_chunks; 141 127 142 128 /* 143 129 * Incoming bios that overlap with chunks being merged must wait
+2 -2
include/linux/dm-io.h
··· 37 37 struct dm_io_memory { 38 38 enum dm_io_mem_type type; 39 39 40 + unsigned offset; 41 + 40 42 union { 41 43 struct page_list *pl; 42 44 struct bio_vec *bvec; 43 45 void *vma; 44 46 void *addr; 45 47 } ptr; 46 - 47 - unsigned offset; 48 48 }; 49 49 50 50 struct dm_io_notify {