public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mingming Cao <cmm@us.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: tytso@mit.edu, pbadari@us.ibm.com, linux-kernel@vger.kernel.org,
	ext2-devel@lists.sourceforge.net
Subject: Re: [Ext2-devel] Re: [RFC, PATCH] Reservation based ext3 preallocation
Date: 05 Apr 2004 09:49:14 -0700	[thread overview]
Message-ID: <1081183756.4714.6580.camel@localhost.localdomain> (raw)
In-Reply-To: <20040402185007.7d41e1a2.akpm@osdl.org>

On Fri, 2004-04-02 at 18:50, Andrew Morton wrote:
> Mingming Cao <cmm@us.ibm.com> wrote:
> >
> > On Fri, 2004-04-02 at 17:50, Andrew Morton wrote:
> > > hm, maybe.  We should probably also provide a per-file ext3-specific ioctl
> > > to allow specialised apps to manipulate the reservation size.
> > > 
> > > And we should grow the reservation size dynamically.  I've suggested that
> > > we double its size each time it is exhausted, up to some limit.  There may
> > > be better algorithms though.
> > You mean when the reservation window size is exhausted, right? I think
> > this is probably the easiest way. Maybe like the readahead window does. 
> > Just sometimes the window reserved does not contains much free blocks to
> > allocate, and we could easily reach to the upper limit.
> 
> Good point.  So the reservation should be grown by "the number of blocks we
> allocated in the previous window", not by "the size of the previous
> window", yes?
> 
Yes.  Maybe in the reservation structure we add a counter to keep track
of the preallocation hit. Then when a new window need to be created, we
look at the old window preallocation hit ratio to determine how much the
window size should be next time.

> > Currently, when try to reserve a window in a block group, if there is no
> > window big enough for this, we skip this group and move on to the next
> > group.  I was thinking maybe we should keep track of the largest
> > avaliable reservable window when we are looking for a new window, so in
> > case we can't find the one with expected size, we at least could get one
> > within the group.
> 
> I suspect that if you cannot get a window in the blockgroup then simply
> skipping to the next blockgroup should be OK.
>
okey.
 
> But I don't understand why the reservation code needs to know about
> blockgroups at all, at least from a conceptual point of view. 
> 
Agree that reservation itself is a filesystem wide concept. The
reservation window could cross the block group boundary. 

> Probably it's sufficient to use the inode's blockgroup's starting block as
> the initial target for allocations and then just forget about blockgroups. 
> Simply let allocation wander further up the disk from there, with no
> further consideration of blockgroups.
I think the current code's logic is the same as you said. The logic of
current code is: given a goal block,try to allocate a block starting
from there within the inode's block group. If it failed, then simply
move on to next group without a goal -- the search for a free block will
start from the starting block of the next group.  I was trying to keep
the same logic as before.  So for the reservation code, given a goal
block, we will try to allocate a new reservation window (and then
allocate a block within it) from the give goal block. If it failed, we
will simply do reservation window allocate in the rest of the disk,
without consideration of the inode's blockgroup.

> 
> It would be fairly weird for the entire disk to be covered by reservations,
> so falling back to the current algorithm would be OK.
okey.

> > > This work doesn't help us with the slowly-growing logfile or mailbox file
> > > problem.  I guess that would require on-disk reservations, or a new
> > > `chattr' hint or such.
> > 
> > Ted has suggested to preserve the reservation/preallocation for those
> > slowing growing logfile for mailbox file. Probably do not discard the
> > reservation window for those files(the logfile) when they are closed.
> > When it opens next time, it will allocate blocks directly from the old
> > reservation window. Is that what you think? 
> 
> yup, except we now have potentially millions of inodes which have active
> reservations.  ENOSPC and CPU consumption problems are certain.
> 
> Some combination of
> 
> - A chattr hint
> 
> - Using O_APPEND as a hint and
> 
> - Retaining an upper limit on the number of unopened inodes which have a
>   reservation
> 
> should fix that up.  You'd need to hook into ->destroy_inode to release
> reservations when inodes are reclaimed by the VM.
> 
> But this is surely phase two material.
Okey. Will think about this more later...

Thanks for your help!

Mingming

> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Ext2-devel mailing list
> Ext2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ext2-devel
> 



  reply	other threads:[~2004-04-05 16:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200403190846.56955.pbadari@us.ibm.com>
     [not found] ` <20040321015746.14b3c0dc.akpm@osdl.org>
2004-03-30  8:55   ` [RFC, PATCH] Reservation based ext3 preallocation Mingming Cao
2004-03-30  9:45     ` Andrew Morton
2004-03-30 17:07       ` Badari Pulavarty
2004-03-30 17:12         ` [Ext2-devel] " Alex Tomas
2004-03-30 18:07           ` Badari Pulavarty
2004-03-30 18:23         ` Mingming Cao
2004-03-30 18:36         ` Andrew Morton
2004-04-03  1:45       ` [Ext2-devel] " Mingming Cao
2004-04-03  1:50         ` Andrew Morton
2004-04-03  2:37           ` Mingming Cao
2004-04-03  2:50             ` Andrew Morton
2004-04-05 16:49               ` Mingming Cao [this message]
2004-04-14  0:52               ` [PATCH 0/4] ext3 block reservation patch set Mingming Cao
2004-04-14  0:54                 ` [PATCH 1/4] ext3 block reservation patch set -- ext3 preallocation cleanup Mingming Cao
2004-04-14  0:57                 ` [PATCH 2/4] ext3 block reservation patch set --ext3 block reservation Mingming Cao
2004-04-14  0:58                 ` [PATCH 3/4] ext3 block reservation patch set --mount and ioctl feature Mingming Cao
2004-04-14  1:00                 ` [PATCH 4/4] ext3 block reservation patch set -- dynamically increase reservation window Mingming Cao
2004-04-14  2:47                 ` [PATCH 0/4] ext3 block reservation patch set Andrew Morton
2004-04-14 16:11                   ` Badari Pulavarty
2004-04-14 17:44                     ` Mingming Cao
2004-04-14 23:02                     ` Andrew Morton
2004-04-14 23:12                       ` Badari Pulavarty
2004-04-14 16:42                   ` Badari Pulavarty
2004-04-14 17:30                   ` Mingming Cao
2004-04-14 23:07                     ` Andrew Morton
2004-04-14 23:42                       ` Mingming Cao
2004-04-21 23:34                       ` [PATCH] Lazy discard ext3 reservation window patch Mingming Cao
2004-04-27 15:19                 ` [PATCH 0/4] ext3 block reservation patch set Mary Edie Meredith

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=1081183756.4714.6580.camel@localhost.localdomain \
    --to=cmm@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=ext2-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbadari@us.ibm.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