From: Anton Blanchard <anton@samba.org>
To: Andrew Morton <akpm@digeo.com>
Cc: Oleg Drokin <green@namesys.com>,
linux-kernel@vger.kernel.org, hch@lst.de, jack@suse.cz,
mason@suse.com, Stephen Hemminger <shemminger@osdl.org>
Subject: Re: ext2 FS corruption with 2.5.59.
Date: Sun, 26 Jan 2003 22:11:08 +1100 [thread overview]
Message-ID: <20030126111108.GB25001@krispykreme> (raw)
In-Reply-To: <20030125190410.7c91e640.akpm@digeo.com>
Hi,
> +static inline void i_size_write(struct inode * inode, loff_t i_size)
> +{
> +#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
> +#ifdef __ARCH_HAS_GET_SET_64BIT
> + set_64bit((unsigned long long *) &inode->i_size, (unsigned long long) i_size);
> +#else
> + inode->i_size_version2++;
> + wmb();
> + inode->i_size = i_size;
> + wmb();
> + inode->i_size_version1++;
> + wmb(); /* make it visible ASAP */
> +#endif
> +#elif BITS_PER_LONG==64 || !defined(CONFIG_SMP)
> + inode->i_size = i_size;
> +#endif
> +}
That last wmb is suspect. We dont put an wmb after a spinlock to "make it
visible". If you think of an wmb as an ordering tag that propagates out
through the cpu and storage hierarchy then wmb is not going to help us here.
I guess the store could get reordered (and so delayed) a bit, but an wmb
is relatively expensive on some architectures.
> This is actually fairly pointless, because these fields are write-mostly and
> read-rarely. But we need a spinlock anyway because of the concurrent
> modifiers problem.
It would be interesting to compare a spinlock or rwlock against a frlock
in a write mostly situation. Actually isnt it going to be slower because
we have to take a spinlock to serialise around the frlock write path?
Anton
next prev parent reply other threads:[~2003-01-26 11:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-23 12:38 Oleg Drokin
2003-01-23 14:09 ` Hugh Dickins
2003-01-23 14:26 ` Oleg Drokin
2003-01-23 14:39 ` Oleg Drokin
2003-01-24 10:32 ` Andrew Morton
2003-01-24 12:39 ` Oleg Drokin
2003-01-25 6:53 ` Andrew Morton
2003-01-25 12:36 ` Oleg Drokin
2003-01-25 23:13 ` Andrew Morton
2003-01-26 9:25 ` Oleg Drokin
2003-01-26 3:04 ` Andrew Morton
2003-01-26 3:28 ` William Lee Irwin III
2003-01-26 3:46 ` Andrew Morton
2003-01-26 4:14 ` William Lee Irwin III
2003-01-26 5:10 ` Andrew Morton
2003-01-27 22:59 ` Stephen Hemminger
2003-01-27 23:59 ` William Lee Irwin III
2003-01-26 11:11 ` Anton Blanchard [this message]
2003-01-26 11:23 ` Andrew Morton
2003-01-28 13:50 ` Christoph Hellwig
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=20030126111108.GB25001@krispykreme \
--to=anton@samba.org \
--cc=akpm@digeo.com \
--cc=green@namesys.com \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mason@suse.com \
--cc=shemminger@osdl.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
all inboxes | Powered by JetHome®