mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Daniel McNeil <daniel@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.4.19rc2aa1 i_size atomic access
Date: Tue, 23 Jul 2002 18:56:02 +0200	[thread overview]
Message-ID: <20020723165602.GV1116@dualathlon.random> (raw)
In-Reply-To: <1027119396.2629.16.camel@IBM-C>

On Fri, Jul 19, 2002 at 03:56:36PM -0700, Daniel McNeil wrote:
> Here is another approach. I added two version fields to the inode
> structure. The first one is updated before i_size and the 2nd is
> updated after with memory barriers in between.  The i_size_read()
> samples the version fields and i_size and loops until it can read
> i_size without an i_size update happening at the same time.  It is
> not pretty but it does fix the problem and the cache line is not
> written by i_size_read() and it should work on all architechtures.
> I've tested this on a two proc system.

I also considered this possibility before taking the other approch, I
thought it was inferior because it adds branches and it increases the
dcache pressure, so I thought just marking our cacheline dirty and
reading it in one go, with no additional overhead would been a win (the
less possible number of cycles and no branch prediction issues). Of
course the below will allow parallel i_size readers to scale, but again,
I think the fstat benchmark doesn't matter much and true parallel
readers on the same inode (not only i_size readers) will have to collide
on the pagecache_lock anyways (even in 2.5). So I still think the
chmpxchg8b is a win despite it marks the i_size cacheline dirty, but
somebody should try to benchmark it probably to verify the major
bottleneck remains the pagecache_lock.

I actually applied the below but I enabled it only for the non x86 32bit
archs (like s390, ppc) where I have no idea how to code a get_64bit it
in asm. It should be definitely better than a separate spinlock
protecting the i_size.

comments?

Andrea

  reply	other threads:[~2002-07-23 16:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1026949132.20314.0.camel@joe2.pdx.osdl.net>
     [not found] ` <1026951041.2412.38.camel@IBM-C>
     [not found]   ` <20020718103511.GG994@dualathlon.random>
2002-07-19  0:09     ` Daniel McNeil
2002-07-19  9:23       ` Andrea Arcangeli
2002-07-19 22:56         ` Daniel McNeil
2002-07-23 16:56           ` Andrea Arcangeli [this message]
2002-07-23 17:08           ` Andrea Arcangeli
2002-07-23 17:47             ` Andrea Arcangeli
2002-07-23 18:15               ` Maciej W. Rozycki
2002-07-23 19:20                 ` Andrea Arcangeli
2002-07-24 14:19                   ` Maciej W. Rozycki
2002-07-24 14:26                     ` Andrea Arcangeli
2002-07-29 18:37               ` Bob Miller
2002-07-29 18:47                 ` Andrea Arcangeli
2002-07-30  0:34             ` Daniel McNeil
2002-07-30  1:12               ` Andrea Arcangeli

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=20020723165602.GV1116@dualathlon.random \
    --to=andrea@suse.de \
    --cc=daniel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome