From: Mike Snitzer <snitzer@redhat.com>
To: dm-devel@redhat.com
Subject: Re: dm: eliminate some holes in data structures
Date: Fri, 18 Dec 2009 17:28:33 -0500 [thread overview]
Message-ID: <20091218222830.GA12859@redhat.com> (raw)
In-Reply-To: <20091216034940.GA11003@redhat.com>
On Tue, Dec 15 2009 at 10:49pm -0500,
Mike Snitzer <snitzer@redhat.com> wrote:
> Eliminate 1 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 (3 4-byte) holes (and one cache-line) in 'struct
> dm_snapshot' by moving 'pending_pool' after 'pending_exceptions_count'
> and moving 'merge_failed' lower (size reduced from 648 to 632 bytes).
As it happens, I had compiled with CONFIG_DEBUG_SPINLOCK et al. That
explains why dm_snapshot was so large. If I use a "production" .config
I need the following incremental patch to eliminate all 6 4-byte holes
in 'struct dm_snapshot' (reduces size from 392 to 368 bytes):
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 0435442..ab9822e 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -96,6 +96,11 @@ struct dm_snapshot {
*/
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 */
struct dm_exception_store *store;
@@ -105,11 +110,6 @@ struct dm_snapshot {
struct bio_list queued_bios;
struct work_struct queued_bios_work;
- /* Chunks with outstanding reads */
- mempool_t *tracked_chunk_pool;
- spinlock_t tracked_chunk_lock;
- struct hlist_head tracked_chunk_hash[DM_TRACKED_CHUNK_HASH_SIZE];
-
/* Wait for events based on state_bits */
unsigned long state_bits;
prev parent reply other threads:[~2009-12-18 22:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-16 3:49 [PATCH] dm: eliminate some holes in data structures Mike Snitzer
2009-12-16 19:25 ` Jonathan Brassow
2009-12-18 22:28 ` Mike Snitzer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091218222830.GA12859@redhat.com \
--to=snitzer@redhat.com \
--cc=dm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.