mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@bonn-fries.net>
To: Andrew Morton <akpm@zip.com.au>,
	Daniel Phillips <phillips@bonn-fries.net>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: [CFT] delayed allocation and multipage I/O patches for 2.5.6.
Date: Thu, 14 Mar 2002 12:59:27 +0100	[thread overview]
Message-ID: <E16lTtI-0000OP-00@starship> (raw)
In-Reply-To: <3C8D9999.83F991DB@zip.com.au> <E16l7Oe-0000Dk-00@starship> <3C8FAD88.1C425F9B@zip.com.au>
In-Reply-To: <3C8FAD88.1C425F9B@zip.com.au>

On March 13, 2002 08:50 pm, Andrew Morton wrote:
> Daniel Phillips wrote:
> > 
> > That's the thrust of my current work - massaging things into a form where
> > struct page can be substituted for buffer_head as the block data handle 
> > for the mass of filesystems that use it.
> > ...
> > 
> > For me, the missing piece of the puzzle is how to recover the semantics of
> > ->b_flushtime.  The crude solution is just to put that in struct page for
> > now.  At least that's a wash in terms of size because ->buffers goes out.
> 
> I'm currently doing that in struct address_space(!).  Maybe struct inode
> would make more sense...

I don't know, when do we ever use an address_space that's not attached to an 
inode?  Hmm, swapper_space.  Though nobody does it now, it's also possible to 
have more than one address_space per inode.  This confuses the issue because 
you don't know whether to flush them together, separately, or what.  By the 
time things get this murky, its time for VM to step back and let the 
filesystem itself establish the flushing policy.  No, we don't have any model 
for how to express that, and we need one.  What you're developing here is 
a generic_flush, mainly for use by dumb filesystems, and by lucky accident, 
also suitable for Ext3.

So, hrm, the sky won't fall either places you put it.

> So the mapping records the time at which it was first dirtied.  So the
> `kupdate' function simply writes back all files which had their
> first-dirtying time between 30 and 35 seconds ago.

I guess you have to be careful to set the first-dirtying time again after
submitting all the IO, in case the inode got dirtied again while you were
busy submitting.

> That works OK, but it also needs to cope with the case of a single
> huge dirty file.  For that case, periodic writeback also terminates
> when it has written back 1/6th of all the dirty pages in the machine.

You need a way of cycling through all the inodes on the system reliably, 
otherwise you'll get nasty situations where repeated dirtying starves some 
inodes of updates.  This has to have file offset resolution, otherwise more 
flush starvation corner cases will start crawling out of the woodwork.

The 1/6th rule is an oversimplification, it should at least be based on how 
much flush IO is already in flight, and other more difficult measures we 
haven't even started to address yet, such as how much and what kind of other 
IO is competing for the same bandwidth, and how much bandwidth is available.

> This is all fairly arbitrary, and is basically designed to map onto
> the time-honoured behaviour.  I haven't observed any surprises from
> it, nor any reason to change it.

It's surprisingly resistant to flaming.  The starvation problem is going to 
get ugly, it's just as hard as the elevator starvation question and the 
crude, inode-level resolution of the flushtime makes it tricky.  But I think 
it can be beaten into some kind of shape where the corner cases are seen to 
be bounded.

I don't know, I need to think about it more.  It's both convenient and 
strange not to maintain per-block flushtime.

> We also need to discuss writeback of metadata.  For delayed allocate
> files, indirect blocks are not a problem, because I start I/O against
> them *immediately*, as soon as they're dirtied.  This is because we
> know that the indirect's associated data blocks are also under I/O.
> 
> Which leaves bitmaps and inode blocks.  These I am leaving on the
> dirty buffer LRU, so nothing has changed there.

Easy, give them an address_space.

[snip fascinating/timesucking sortie into online defrag]

-- 
Daniel

  parent reply	other threads:[~2002-03-14 12:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-12  6:00 Andrew Morton
2002-03-12 11:18 ` Daniel Phillips
2002-03-12 20:29   ` Andrew Morton
2002-03-12 20:40     ` Daniel Phillips
2002-03-12 11:39 ` Daniel Phillips
2002-03-12 21:00   ` Andrew Morton
2002-03-13 11:58     ` Daniel Phillips
2002-03-13 19:50       ` Andrew Morton
2002-03-13 21:51         ` Mike Fedyk
2002-03-14 11:59         ` Daniel Phillips [this message]
2002-03-13  0:42   ` David Woodhouse
2002-03-18 19:16 ` Hanna Linder
2002-03-18 20:14   ` Andrew Morton
2002-03-18 20:22     ` Hanna Linder
2002-03-18 20:49       ` Andrew Morton
2002-03-19  0:41 rwhron

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=E16lTtI-0000OP-00@starship \
    --to=phillips@bonn-fries.net \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®