From: Pavel Machek <pavel@ucw.cz>
To: Stephen Tweedie <sct@redhat.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
Andreas Dilger <adilger@clusterfs.com>,
"Theodore Ts'o" <tytso@mit.edu>,
ext2-devel@lists.sourceforge.net
Subject: Re: [Patch 7/10]: ext3 online resize: SMP locking for group metadata
Date: Fri, 1 Oct 2004 12:18:22 +0200 [thread overview]
Message-ID: <20041001101822.GA18786@elf.ucw.cz> (raw)
In-Reply-To: <200409301323.i8UDNo99004796@sisko.scot.redhat.com>
Hi!
> Fix the SMP locking for group metadata in online resize.
>
> Most of the resize is simply not dangerous from an SMP point of view, as
> we're adding new data beyond the end of the device and so we're
> guaranteed that no existing CPUs can already be using that data. But we
> need to be extremely careful about the ordering when enabling that new
> data.
>
> The key to this is sb->s_groups_count; when that is raised, it enables
> new space on a filesystem, and the kernel will suddenly start accessing
> all of the newly-created tables for that space.
>
> The precise rules we use are:
>
> * Writers of s_groups_count *must* hold lock_super
> AND
> * Writers must perform a smp_wmb() after updating all dependent
> data and before modifying the groups count
>
> * Readers must hold lock_super() over the access
> OR
> * Readers must perform an smp_rmb() after reading the groups count
> and before reading any dependent data.
>
> This leaves the hot path, where s_groups_count is referenced, requiring
> an smp_rmb(); but no other locking on that hot path is required.
Should not s_groups_count be atomic_t, then? Is it possible that
normal read sees only half-updated value?
[I know this is non-issue at least on i386, and probably on most
architectures as long as s_groups_count is aligned...
Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
next prev parent reply other threads:[~2004-10-01 10:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-30 13:23 Stephen Tweedie
2004-10-01 10:18 ` Pavel Machek [this message]
2004-10-01 11:40 ` Stephen C. Tweedie
2004-10-01 12:42 ` [Ext2-devel] " Matthew Wilcox
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=20041001101822.GA18786@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=adilger@clusterfs.com \
--cc=akpm@osdl.org \
--cc=ext2-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=sct@redhat.com \
--cc=tytso@mit.edu \
/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