cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 PATCH] GFS2: Delete directory block reservation on failure
Date: Tue, 30 Jul 2013 11:42:53 -0400 (EDT)	[thread overview]
Message-ID: <773797881.1361225.1375198973637.JavaMail.root@redhat.com> (raw)
In-Reply-To: <1375193910.2725.27.camel@menhir>

Hi,

----- Original Message -----
| On Tue, 2013-07-30 at 10:14 -0400, Bob Peterson wrote:
| > Hi,
| > 
| > This patch adds one line of code that deletes a block reservation
| > structure for the source directory in the event that the inode creation
| > operation fails. If the inode creation succeeds, the reservation will
| > be deleted anyway, since directory reservations are now only 1 block.
| > 
| Why would we want to do that? If the creation has failed then that gives
| us no information about whether further allocations are likely to be
| made for that directory,

It's hard to explain, but it has to do with keeping the bitmaps as
defragmented as possible in memory so that we don't slow down file block
allocations with tons of unnecessary reservation structures to go through.
Directory reservations are only for a single block anyway, and in the case
where a new inode is created successfully, the block reservation is deleted
immediately thereafter. The reason we do this is to keep the bitmaps
as tightly packed as possible so that file allocations are given priority.
Otherwise we spend a huge amount of time rejecting many possible free
blocks because of outstanding reservations left around for directories by
virtue of the fact that directories are cached and not closed like files.

For details, see:
http://git.kernel.org/cgit/linux/kernel/git/steve/gfs2-3.0-nmw.git/commit/fs/gfs2?id=af21ca8ed50f01c5278c5ded6dad6f05e8a5d2e4

However, in the unsuccessful case, today's code leaves the single-block
reservation structure out there in memory for the directory, also
fragmenting the bitmap and creating more clutter for the block allocator to
go through when finding free blocks, just like we had before the
aforementioned patch.

It seems pointless to leave the reservation around speculatively on the
hopes of future dinode allocations for that directory. Even more so in the
failure case, especially since it seems likely to fail a second and
subsequent times as well for the same reason it failed this time.

Regards,

Bob Peterson
Red Hat File Systems



  reply	other threads:[~2013-07-30 15:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <103608963.1288829.1375193618752.JavaMail.root@redhat.com>
2013-07-30 14:14 ` [Cluster-devel] [GFS2 PATCH] GFS2: Delete directory block reservation on failure Bob Peterson
2013-07-30 14:18   ` Steven Whitehouse
2013-07-30 15:42     ` Bob Peterson [this message]
2013-07-30 15:53       ` Steven Whitehouse

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=773797881.1361225.1375198973637.JavaMail.root@redhat.com \
    --to=rpeterso@redhat.com \
    /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).