From: Max Reitz <mreitz@redhat.com>
To: Eric Blake <eblake@redhat.com>, Alberto Garcia <berto@igalia.com>,
qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/3] qcow2: reorder fields in Qcow2CachedTable to reduce padding
Date: Tue, 26 May 2015 18:14:09 +0200 [thread overview]
Message-ID: <55649BD1.3000709@redhat.com> (raw)
In-Reply-To: <55649B83.7060900@redhat.com>
On 26.05.2015 18:12, Eric Blake wrote:
> On 05/26/2015 10:10 AM, Max Reitz wrote:
>> On 18.05.2015 18:48, Alberto Garcia wrote:
>>> Changing the current ordering saves 8 bytes per cache entry in x86_64.
>> Hm, not seven?
>>
>>> Signed-off-by: Alberto Garcia <berto@igalia.com>
>>> ---
>>> block/qcow2-cache.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c
>>> index a215f5b..43590ff 100644
>>> --- a/block/qcow2-cache.c
>>> +++ b/block/qcow2-cache.c
>>> @@ -31,9 +31,9 @@
>>> typedef struct Qcow2CachedTable {
>>> int64_t offset;
>>> - bool dirty;
>>> uint64_t lru_counter;
>>> int ref;
>>> + bool dirty;
>>> } Qcow2CachedTable;
>>> struct Qcow2Cache {
>> With "7" above, or an explanation why it actually is 8:
> Old layout:
>
> 0-7 offset
> 8 dirty
> 9-15 padding
> 16-23 lru_counter
> 24-27 dirty
> 28-31 padding
>
> New layout:
>
> 0-7 offset
> 8-15 lru_counter
> 16-19 ref
> 20 dirty
> 21-23 padding
>
> It indeed saves 8 bytes.
Oh, I forgot about the padding at the end. Thanks!
Max
>> Reviewed-by: Max Reitz <mreitz@redhat.com>
>>
>>
next prev parent reply other threads:[~2015-05-26 16:15 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-18 16:48 [Qemu-devel] [PATCH 0/3] Clean unused entries in the qcow2 L2/refcount cache Alberto Garcia
2015-05-18 16:48 ` [Qemu-devel] [PATCH 1/3] qcow2: mark the memory as no longer needed after qcow2_cache_empty() Alberto Garcia
2015-05-26 15:39 ` Max Reitz
2015-05-26 15:51 ` Alberto Garcia
2015-05-26 15:51 ` Max Reitz
2015-05-18 16:48 ` [Qemu-devel] [PATCH 2/3] qcow2: add option to clean unused cache entries after some time Alberto Garcia
2015-05-26 16:07 ` Max Reitz
2015-05-18 16:48 ` [Qemu-devel] [PATCH 3/3] qcow2: reorder fields in Qcow2CachedTable to reduce padding Alberto Garcia
2015-05-26 16:10 ` Max Reitz
2015-05-26 16:12 ` Eric Blake
2015-05-26 16:14 ` Max Reitz [this message]
2015-05-26 16:20 ` Alberto Garcia
2015-05-26 16:13 ` Eric Blake
-- strict thread matches above, loose matches on Subject: below --
2015-05-26 17:14 [Qemu-devel] [PATCH v2 0/3] Clean unused entries in the qcow2 L2/refcount cache Alberto Garcia
2015-05-26 17:14 ` [Qemu-devel] [PATCH 3/3] qcow2: reorder fields in Qcow2CachedTable to reduce padding Alberto Garcia
2015-05-27 9:46 [Qemu-devel] [PATCH v3 0/3] Clean unused entries in the qcow2 L2/refcount cache Alberto Garcia
2015-05-27 9:46 ` [Qemu-devel] [PATCH 3/3] qcow2: reorder fields in Qcow2CachedTable to reduce padding Alberto Garcia
2015-05-29 9:24 [Qemu-devel] [PATCH v4 0/3] Clean unused entries in the qcow2 L2/refcount cache Alberto Garcia
2015-05-29 9:24 ` [Qemu-devel] [PATCH 3/3] qcow2: reorder fields in Qcow2CachedTable to reduce padding Alberto Garcia
2015-06-02 11:07 ` Kevin Wolf
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=55649BD1.3000709@redhat.com \
--to=mreitz@redhat.com \
--cc=berto@igalia.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@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.