Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Maciej Marcin Piechotka <uzytkownik2@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: is space really freed after deleting large subvolume?
Date: Fri, 14 Oct 2011 18:26:15 +0100	[thread overview]
Message-ID: <1318613175.2300.8.camel@picard> (raw)
In-Reply-To: <CAJ1PRS=d4Ly3p-t1L9-wXcaHA=zw05Lu=84+=AnF+77HJJLvfg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1495 bytes --]

On Thu, 2011-10-13 at 23:03 +0200, krzf83@gmail.com wrote:
> 
> > If you delete a large number of files, then there is no avoiding the
> > fact that a lot of metadata needs to be updated. In this respect
> btrfs
> > is unlikely to be significantly faster than any other filing system.
> 
> Are you sure? That would mean that instant deletion of subvolume in
> btrfs is actualy taking ??SAME?? time and io power in BACKGROUND like
> deleting by rm -rf in any filesystem.
> Common misconception would be that subvolume deletion is much more
> efficient and near zero time consuming. I think it is very important
> to clear that up. 

I may be wrong but it may not be necessary true - the fs may optimize
the deletion so for example if 2 files shares the same extend it is
updated once (it may be beneficial as cost of I/O is bigger then cost of
CPU).

Additionally it means that the btrfs does things asynchronously and we
don't need to wait for all cleanup (I assume that it is as soon as the
deletion is commited to log). Therefore if deletion takes 100 ms of i/o
and 10 ms of cpu on other fs and 100 ms of i/o and 20 ms of cpu on btrfs
the following code takes 210 ms vs. 120 ms on btrfs in very simplified
model.

unlink("/btrfs/file");
busy_wait(100); // Simulates 100 ms computation

Regards

PS. I'm not btrfs developer but I see at least potential advantages of
asynchronous deletion (or split deletion in 2-phases). I don't know how
much is implemented.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2011-10-14 17:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-13 16:14 is space really freed after deleting large subvolume? krzf83@gmail.com 
2011-10-13 16:21 ` Hugo Mills
2011-10-13 16:57   ` krzf83@gmail.com 
2011-10-13 18:06     ` krzf83@gmail.com 
2011-10-13 19:22       ` krzf83@gmail.com 
2011-10-13 20:01       ` David Pottage
2011-10-13 21:03         ` krzf83@gmail.com 
2011-10-14 17:26           ` Maciej Marcin Piechotka [this message]
2011-10-13 16:29 ` Roman Mamedov
2011-10-14  5:17 ` krzf83@gmail.com 
2011-10-14  8:45   ` Hugo Mills
2011-10-14 17:12     ` Bruce Guenter

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=1318613175.2300.8.camel@picard \
    --to=uzytkownik2@gmail.com \
    --cc=linux-btrfs@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