Commit 924e600d417ead9ef67043988055ba236f114718

Authored by Mike Snitzer
Committed by Alasdair G Kergon
1 parent 3abf85b5b5

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>

Showing 2 changed files with 15 additions and 15 deletions Side-by-side Diff

drivers/md/dm-snap.c
... ... @@ -83,10 +83,10 @@
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;
89 87  
  88 + mempool_t *pending_pool;
  89 +
90 90 struct dm_exception_table pending;
91 91 struct dm_exception_table complete;
92 92  
... ... @@ -96,6 +96,11 @@
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  
102 107  
... ... @@ -105,11 +110,13 @@
105 110 struct bio_list queued_bios;
106 111 struct work_struct queued_bios_work;
107 112  
108   - /* Chunks with outstanding reads */
109   - mempool_t *tracked_chunk_pool;
110   - spinlock_t tracked_chunk_lock;
111   - struct hlist_head tracked_chunk_hash[DM_TRACKED_CHUNK_HASH_SIZE];
  113 + /* Wait for events based on state_bits */
  114 + unsigned long state_bits;
112 115  
  116 + /* Range of chunks currently being merged. */
  117 + chunk_t first_merging_chunk;
  118 + int num_merging_chunks;
  119 +
113 120 /*
114 121 * The merge operation failed if this flag is set.
115 122 * Failure modes are handled as follows:
... ... @@ -124,13 +131,6 @@
124 131 * => stop merging; set merge_failed; process I/O normally.
125 132 */
126 133 int merge_failed;
127   -
128   - /* Wait for events based on state_bits */
129   - unsigned long state_bits;
130   -
131   - /* Range of chunks currently being merged. */
132   - chunk_t first_merging_chunk;
133   - int num_merging_chunks;
134 134  
135 135 /*
136 136 * Incoming bios that overlap with chunks being merged must wait
include/linux/dm-io.h
... ... @@ -37,14 +37,14 @@
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 {