public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: Anton Altaparmakov <aia21@cam.ac.uk>
Cc: Jan Harkes <jaharkes@cs.cmu.edu>, linux-kernel@vger.kernel.org
Subject: Re: [prepatch] address_space-based writeback
Date: Wed, 10 Apr 2002 15:31:11 -0700	[thread overview]
Message-ID: <3CB4BD2F.B711556D@zip.com.au> (raw)
In-Reply-To: <3CB4B248.2807558D@zip.com.au> <5.1.0.14.2.20020410235415.03d41d00@pop.cus.cam.ac.uk>

Anton Altaparmakov wrote:
> 
> At 22:44 10/04/02, Andrew Morton wrote:
> >When a page is marked dirty, the path which is followed
> >is page->mapping->host->i_sb.  So in this case the page will
> >be attached to its page->mapping.dirty_pages, and
> >page->mapping->host will be attached to page->mapping->host->i_sb.s_dirty
> >
> >This is as it always was - I didn't change any of this.
> 
> Um, NTFS uses address spaces for things where ->host is not an inode at all
> so doing host->i_sb will give you god knows what but certainly not a super
> block!

But it's a `struct inode *' :(

What happens when someone runs set_page_dirty against one of
the address_space's pages?  I guess that doesn't happen, because
it would explode.  Do these address_spaces not support writable
mappings?

I like to think in terms of "top down" and "bottom up".

set_page_dirty is the core "bottom up" function which propagates
dirtiness information from the bottom of the superblock/inode/page
tree up to the top.

writeback is top-down.  It goes from the superblock list down
to pages.

The assumption about page->mapping->host being an inode
only occurs in the bottom-up path, at set_page_dirty().

> As long as your patches don't break that is possible to have I am happy...
> But from what you are saying above I have a bad feeling you are somehow
> assuming that a mapping's host is an inode...

Well the default implementation of __set_page_dirty() will
make that assumption.  (It always has).

But the address_space may implement its own a_ops->set_page_dirty(page),
so you can do whatever you need to do there, yes?

I currently have:

static inline int set_page_dirty(struct page *page)
{
        if (page->mapping) {
                int (*spd)(struct page *, int reserve_page);

                spd = page->mapping->a_ops->set_page_dirty;
                if (spd)
                        return (*spd)(page, 1);
        }
        return __set_page_dirty_buffers(page, 1);
}

Where __set_page_dirty_buffers() will dirty the buffers if
they exist.  And non-buffer_head-backed filesystems which
use page->private MUST implement set_page_dirty().

The reserve_page stuff is for delayed-allocate, the priority
and timing of which has been pushed waaay back by this.  I'm
keeping the reserve_page infrastructure around at present
because of vague thoughts that it may be useful to fix the
data-loss bug which occurs when a shared mapping of a sparse
file has insufficient disk space to satisfy new page instantiations.
Dunno yet.

(Sometime I need to go through and spell out all the new a_ops
methods in all the filesystems, and take out the fall-through-
to-default-handler stuff here, and in do_flushpage() and
try_to_release_page() and others.  But not now).


-

  reply	other threads:[~2002-04-10 23:33 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-10 11:21 [prepatch] address_space-based writeback Andrew Morton
2002-04-10 11:34 ` Alexander Viro
2002-04-10 19:16   ` Andrew Morton
2002-04-10 20:53     ` Alexander Viro
2002-04-10 22:12     ` Jan Harkes
2002-04-10 21:44       ` Andrew Morton
2002-04-10 22:56         ` Anton Altaparmakov
2002-04-10 22:31           ` Andrew Morton [this message]
2002-04-11 20:20           ` Linus Torvalds
2002-04-11 20:41             ` Alexander Viro
2002-04-11 21:27               ` Andrew Morton
2002-04-11 22:55                 ` Andreas Dilger
2002-04-11 22:49                   ` Andrew Morton
2002-04-12  0:12                     ` Linus Torvalds
2002-04-11 23:10                   ` Christoph Hellwig
2002-04-11 23:22                 ` Anton Altaparmakov
2002-04-11 23:03                   ` Andrew Morton
2002-04-12  4:19                   ` Bill Davidsen
2002-04-12  1:15             ` Anton Altaparmakov
2002-04-12  1:37               ` Linus Torvalds
2002-04-12  7:57                 ` Anton Altaparmakov
2002-04-27 15:53                   ` Jan Harkes
2002-04-28  3:03                     ` Anton Altaparmakov
2002-04-29  9:03                       ` Nikita Danilov
2002-04-29 11:11                         ` Anton Altaparmakov
2002-04-29 11:59                           ` Nikita Danilov
2002-04-29 12:34                             ` Anton Altaparmakov
2002-04-29 13:01                               ` Christoph Hellwig
2002-04-30 17:19                             ` Denis Vlasenko
2002-04-30 13:15                               ` john slee
2002-04-30 13:24                                 ` Billy O'Connor
2002-04-30 13:36                                   ` jlnance
2002-04-30 13:40                                 ` Keith Owens
2002-05-01 19:18                                   ` Denis Vlasenko
2002-05-02  8:49                                     ` Anton Altaparmakov
2002-05-03 15:35                                       ` Denis Vlasenko
2002-05-03 12:49                                         ` Helge Hafting
2002-05-03 22:47                                           ` Denis Vlasenko
2002-05-03 21:50                                             ` Anton Altaparmakov
2002-05-05  0:46                                               ` Denis Vlasenko
2002-05-03  7:56                                     ` Pavel Machek
2002-05-03 14:48                                     ` Rob Landley
2002-05-05  0:42                                       ` Denis Vlasenko
2002-04-30 16:12                                 ` Peter Wächtler
2002-04-10 23:02         ` Jan Harkes
2002-04-10 19:29 ` Jeremy Jackson
2002-04-10 19:41   ` Andrew Morton
2002-04-15  8:47 ` Andrew Morton

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=3CB4BD2F.B711556D@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=aia21@cam.ac.uk \
    --cc=jaharkes@cs.cmu.edu \
    --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