linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Theodore Tso <tytso@mit.edu>,
	Ext4 Developers List <linux-ext4@vger.kernel.org>,
	Linux Kernel Developers List <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@infradead.org>,
	A
Subject: Re: [PATCH 1/5] ext4: Avoid races caused by on-line resizing and SMP memory reordering
Date: Wed, 29 Apr 2009 11:28:38 +0200	[thread overview]
Message-ID: <20090429092838.GB18273@duck.suse.cz> (raw)
In-Reply-To: <20090428171445.GD24043@mit.edu>

On Tue 28-04-09 13:14:45, Theodore Tso wrote:
> On Tue, Apr 28, 2009 at 06:23:59PM +0200, Jan Kara wrote:
> >   Ouch... Hmm, smp_rmb() isn't completely free and mainly it's a bit
> > ugly and prone to errors (I'm afraid next time someone changes the
> > allocation code, we miss some barriers again)... so.. Maybe a stupid
> > idea but wouldn't it be easier to solve the online resize like: freeze
> > the filesystem, do all the changes required for extend, unfreeze the
> > filesystem?
> 
> Eric suggested a helper function when reading from s_groups_count.
> That would take care of the code maintenance headache.  One problem
> with using freeze/thaw is it won't work without a journal, and we do
> support filesystems without journals in ext4.  (Probably the best
> solution for netbooks with crapola SSD's.)
  Well, in non-journalling case, we could introduce a rw semaphore
(read acquired / released in journal_start / journal_stop, write acquired
when the fs is frozen). This might be useful for other rare cases where
freezing the fs would be beneficial. But yes, if wrapping into a helper
function works then that might be the easiest way to go.

> As far as smb_rmb() not being free, it's essentially free for
> x86/x86_64 platforms.  Is it really that costly on other
> architectures?
  I had a feeling that it's not that expensive but not quite free either on
x86/x86_64 (I know even less about other archs) - it has to lock the bus,
writes in local CPU caches have to be flushed, no? Probably we don't care
given the size of the functions doing allocation... As an excercise I was
trying to google some numbers but was not really successful, just some
comments about tens of cycles in some emails...

									Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2009-04-29  9:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-26  3:49 [PATCH RFC 0/5] Eliminate most lock_super() calls from ext4 Theodore Ts'o
2009-04-26  3:49 ` [PATCH 1/5] ext4: Avoid races caused by on-line resizing and SMP memory reordering Theodore Ts'o
2009-04-26  3:49   ` [PATCH 2/5] ext4: Remove outdated comment about lock_super() Theodore Ts'o
2009-04-26  3:49     ` [PATCH 3/5] ext4: ext4_mark_recovery_complete() doesn't need to use lock_super Theodore Ts'o
2009-04-26  3:49       ` [PATCH 4/5] ext4: Replace lock/unlock_super() with an explicit lock for the orphan list Theodore Ts'o
2009-04-26  3:49         ` [PATCH 5/5] ext4: Replace lock/unlock_super() with an explicit lock for resizing Theodore Ts'o
2009-04-28 16:02           ` Jan Kara
2009-04-28 15:52         ` [PATCH 4/5] ext4: Replace lock/unlock_super() with an explicit lock for the orphan list Jan Kara
2009-04-26  7:07       ` [PATCH 3/5] ext4: ext4_mark_recovery_complete() doesn't need to use lock_super Christoph Hellwig
2009-04-26 11:46         ` Theodore Tso
2009-04-26 11:49           ` Christoph Hellwig
2009-04-28 16:13     ` [PATCH 2/5] ext4: Remove outdated comment about lock_super() Jan Kara
2009-04-28 16:23   ` [PATCH 1/5] ext4: Avoid races caused by on-line resizing and SMP memory reordering Jan Kara
2009-04-28 17:14     ` Theodore Tso
2009-04-29  9:28       ` Jan Kara [this message]
2009-05-01 13:55       ` [PATCH v2] " Theodore Ts'o
2009-05-03 17:08         ` Jan Kara

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=20090429092838.GB18273@duck.suse.cz \
    --to=jack@suse.cz \
    --cc=hch@infradead.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).