linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ext3 block layout after deleting previous drive contents
@ 2008-04-08 16:33 Bock, Tony
  2008-04-08 17:08 ` Josef Bacik
  0 siblings, 1 reply; 3+ messages in thread
From: Bock, Tony @ 2008-04-08 16:33 UTC (permalink / raw)
  To: linux-fsdevel

Is there any ext3 feature that would cause disk layout to vary if one were to delete all the files on disk and then rewrite them in the same order?  We've been doing some simple read/write file system tests in our lab that sometimes result in short delays being distributed throughout several files.  As long as we don't re-wipe the drive, these delays occur at repeatable offsets within the affected files, suggesting disk seeks at the affected locations.

To my understanding, deleting a file should mark all the data blocks as free.  Thus, any previous disk state should no longer affect files that are written thereafter.  Is this correct?

Thanks for your time,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ext3 block layout after deleting previous drive contents
  2008-04-08 16:33 ext3 block layout after deleting previous drive contents Bock, Tony
@ 2008-04-08 17:08 ` Josef Bacik
  2008-04-14 19:46   ` Andreas Dilger
  0 siblings, 1 reply; 3+ messages in thread
From: Josef Bacik @ 2008-04-08 17:08 UTC (permalink / raw)
  To: Bock, Tony; +Cc: linux-fsdevel

On Tue, Apr 08, 2008 at 09:33:32AM -0700, Bock, Tony wrote:
> Is there any ext3 feature that would cause disk layout to vary if one were to delete all the files on disk and then rewrite them in the same order?  We've been doing some simple read/write file system tests in our lab that sometimes result in short delays being distributed throughout several files.  As long as we don't re-wipe the drive, these delays occur at repeatable offsets within the affected files, suggesting disk seeks at the affected locations.
> 
> To my understanding, deleting a file should mark all the data blocks as free.  Thus, any previous disk state should no longer affect files that are written thereafter.  Is this correct?
>

As a general rule you cannot re-use the blocks (in ordered mode anyway) that are
involved in a truncate until the transaction for the truncate is completed in
order to make sure that everything is consistent after a recovery in the case of
a crash.  So if you are rm -rf *'ing and then immediately re-writing stuff you
are going to end up with weirdness, as there will be blocks that cannot be
reused until the entire truncate is completed.  Best bet is to do  you rm -rf *
and then run sync, and then do your writing, that should garuntee that the
blocks that you have freed up from the truncate are actually able to be used by
new stuff.  Thanks much,

Josef 
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ext3 block layout after deleting previous drive contents
  2008-04-08 17:08 ` Josef Bacik
@ 2008-04-14 19:46   ` Andreas Dilger
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Dilger @ 2008-04-14 19:46 UTC (permalink / raw)
  To: Josef Bacik; +Cc: Bock, Tony, linux-fsdevel

On Apr 08, 2008  13:08 -0400, Josef Bacik wrote:
> On Tue, Apr 08, 2008 at 09:33:32AM -0700, Bock, Tony wrote:
> > Is there any ext3 feature that would cause disk layout to vary if
> > one were to delete all the files on disk and then rewrite them in the
> > same order?  We've been doing some simple read/write file system tests
> > in our lab that sometimes result in short delays being distributed
> > throughout several files.  As long as we don't re-wipe the drive,
> > these delays occur at repeatable offsets within the affected files,
> > suggesting disk seeks at the affected locations.
> > 
> > To my understanding, deleting a file should mark all the data blocks
> > as free.  Thus, any previous disk state should no longer affect files
> > that are written thereafter.  Is this correct?
> 
> As a general rule you cannot re-use the blocks (in ordered mode anyway)
> that are involved in a truncate until the transaction for the truncate
> is completed in order to make sure that everything is consistent after
> a recovery in the case of a crash.  So if you are rm -rf *'ing and then
> immediately re-writing stuff you are going to end up with weirdness, as
> there will be blocks that cannot be reused until the entire truncate is
> completed.  Best bet is to do  you rm -rf * and then run sync, and then
> do your writing, that should garuntee that the blocks that you have freed
> up from the truncate are actually able to be used by new stuff.

In addition, every 125MB or so there has to be a break in the file data
because of metadata.  In ext4 with the "flex_bg" patch the metadata will
be more localized and spread around 16GB apart (configurable).

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-14 19:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-08 16:33 ext3 block layout after deleting previous drive contents Bock, Tony
2008-04-08 17:08 ` Josef Bacik
2008-04-14 19:46   ` Andreas Dilger

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).