From: Eric Dumazet <dada1@cosmosbay.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fs : reorder some 'struct inode' fields to speedup i_size manipulations
Date: Mon, 27 Nov 2006 22:52:04 +0100 [thread overview]
Message-ID: <456B5E04.50007@cosmosbay.com> (raw)
In-Reply-To: <20061127133748.4ebcd6b3.akpm@osdl.org>
Andrew Morton a écrit :
> On Thu, 23 Nov 2006 11:57:29 +0100
> Eric Dumazet <dada1@cosmosbay.com> wrote:
>
>> On 32bits SMP platforms, 64bits i_size is protected by a seqcount
>> (i_size_seqcount).
>>
>> When i_size is read or written, i_size_seqcount is read/written as well, so it
>> make sense to group these two fields together in the same cache line.
>>
>> Before this patch, accessing i_size needed 3 cache lines (2 for i_size, one
>> for i_size_seqcount). After, only one cache line is needed/ (dirtied on a
>> i_size change).
>
> I didn't understand that paragraph at all, really, so I took it out.
>
> At present an i_size change will dirty one, two or three cachelines, most
> likely one or two.
>
> After your patch an i_size change will dirty one or two cachelines, most
> likely one.
>
> yes?
nope
Before :
---------
offsetof(i_size) = 0x3C
i_size is 8 bytes, so i_size spans 2 cache lines (if 64 or 32 bytes cache lines)
and offsetof(i_size_seqcount) = 0x160, so a read of i_size (coupled with a
read of seqcount) needed 3 cache lines. A change of i_size dirtied 2 or 3
cache lines.
After :
--------
offsetof(i_size) = 0x40
offsetof(i_size_seqcount) = 0x48
One cache line 'only', reading or writing.
next prev parent reply other threads:[~2006-11-27 21:52 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-20 14:17 [PATCH -mm 0/4][AIO] - AIO completion signal notification v2 Sébastien Dugué
2006-11-20 14:22 ` [PATCH -mm 1/4][AIO] - fix aio.h includes Sébastien Dugué
2006-11-20 13:31 ` Zach Brown
2006-11-20 14:22 ` [PATCH -mm 2/4][AIO] - export good_sigevent() Sébastien Dugué
2006-11-20 13:42 ` Zach Brown
2006-11-20 21:45 ` Ulrich Drepper
2006-11-20 14:02 ` Zach Brown
2006-11-20 14:22 ` [PATCH -mm 3/4][AIO] - AIO completion signal notification Sébastien Dugué
2006-11-20 15:13 ` Zach Brown
2006-11-21 10:40 ` Sébastien Dugué
[not found] ` <20061122104055.3d1c029a@frecb000686>
2006-11-22 10:22 ` Zach Brown
2006-11-23 8:24 ` Sébastien Dugué
2006-11-22 1:02 ` Andrew Morton
2006-11-23 8:28 ` Sébastien Dugué
2006-11-23 8:40 ` Andrew Morton
2006-11-23 9:47 ` Sébastien Dugué
2006-11-23 10:14 ` Andrew Morton
2006-11-23 10:27 ` Sébastien Dugué
2006-11-23 10:57 ` [PATCH] fs : reorder some 'struct inode' fields to speedup i_size manipulations Eric Dumazet
2006-11-27 21:37 ` Andrew Morton
2006-11-27 21:52 ` Eric Dumazet [this message]
2006-11-27 22:01 ` Andrew Morton
2006-11-28 20:31 ` Eric Dumazet
2006-11-20 14:23 ` [PATCH -mm 4/4][AIO] - Listio support Sébastien Dugué
2006-11-21 10:35 ` Suparna Bhattacharya
2006-11-27 13:39 ` Bharata B Rao
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=456B5E04.50007@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/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.