public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Alexander Viro <viro@math.psu.edu>
Subject: Re: linux-2.4.10-pre5
Date: Sat, 8 Sep 2001 19:57:30 +0200	[thread overview]
Message-ID: <20010908195730.D11329@athlon.random> (raw)
In-Reply-To: <20010908191954.C11329@athlon.random> <Pine.LNX.4.33.0109081028390.936-100000@penguin.transmeta.com>
In-Reply-To: <Pine.LNX.4.33.0109081028390.936-100000@penguin.transmeta.com>; from torvalds@transmeta.com on Sat, Sep 08, 2001 at 10:30:30AM -0700

On Sat, Sep 08, 2001 at 10:30:30AM -0700, Linus Torvalds wrote:
> That said, if you'll give a description of how you fixed the aliasing
> issues etc, maybe I'd be less nervous. Putting it in the page cache is

First of all I just __block_fsync + truncate_inode_pages(inode->i_mapping, 0) so
all pagecache updates are commited to disk after that, so the latest uptodate
data is on disk and nothing uptodate is in memory. 

If we have the fs mounted under us that seems mounted read only [I don't
even try to synchronize if the fs was mounted rw] I invalidate_device to
possibly shrink its higher level caches as well (this call is non
destructive so it's safe, it's just for sanity), then I lock_super [to
synchronize against the ->remount that could otherwise remount the
device rw under me], I recheck the fs is still read only with the super
lock acquired and if it still is I do the real work (aka
update_buffers).

Let's see the update_buffers in detail:

[..]
#define update_buffers(dev)			\
do {						\
	__invalidate_buffers((dev), 0, 1);	\
	__invalidate_buffers((dev), 0, 2);	\
} while (0)
[..]
   For handling cache coherency with the blkdev pagecache the 'update' case
   is been introduced. It is needed to re-read from disk any pinned
   buffer. NOTE: re-reading from disk is destructive so we can do it only
   when we assume nobody is changing the buffercache under our I/O and when
   we think the disk contains more recent information than the buffercache.
   The update == 1 pass marks the buffers we need to update, the update == 2
   pass does the actual I/O. */
void __invalidate_buffers(kdev_t dev, int destroy_dirty_buffers, int update)
[..]

What update_buffers does is to identify the pinned buffers in the buffercache
and to re-read them from disk under the filesystem (we know the filesystem is
mounted readonly so we can [modulo that the fs gets confused if it sees non
coherent information while we do the update, but with the user app writing to
the buffercache directly things were even worse due the potentially larger
window of time for the race to trigger so it's certainly acceptable as far as
current code is acceptable too]).

another quite brainer part of the patch [non described here] is the cache
pagecache sharing from different inodes:

	mknod hda .. A B ..
	mknod hda.new .. A B ..

then start using hda and hda.new at the same time and have them share the same
pagecache, and that case is been take care of too.

Andrea

  reply	other threads:[~2001-09-08 17:56 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-08  4:18 linux-2.4.10-pre5 Linus Torvalds
2001-09-08  6:32 ` linux-2.4.10-pre5: drivers/net/wan compile fixes Eyal Lebedinsky
2001-09-08  6:36 ` 2.4.9-ac10 (not 2.4.10-pre5!) wan fixes Eyal Lebedinsky
2001-09-08  8:32 ` 2.4.10-pre5 compile error George Bonser
2001-09-08 17:19 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-08 17:30   ` linux-2.4.10-pre5 Linus Torvalds
2001-09-08 17:57     ` Andrea Arcangeli [this message]
2001-09-08 18:01       ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09  1:09         ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-09  1:20           ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09  1:38             ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-09  1:53               ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09  2:22                 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-09  2:31                   ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09  3:30                     ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-09  3:58                       ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09  4:16                         ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-09  4:28                           ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09 12:09                             ` linux-2.4.10-pre5 Rik van Riel
2001-09-09 14:53                               ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-09 18:17                               ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09 20:18                                 ` linux-2.4.10-pre5 H. Peter Anvin
2001-09-10  0:39                                   ` linux-2.4.10-pre5 Simon Kirby
2001-09-10  8:30                                     ` linux-2.4.10-pre5 Kai Henningsen
2001-09-11  5:29                                       ` linux-2.4.10-pre5 Peter Samuelson
2001-09-11 11:29                                         ` linux-2.4.10-pre5 Kai Henningsen
2001-09-10 21:22                                   ` linux-2.4.10-pre5 Stephen C. Tweedie
2001-09-09 14:47                             ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-09 16:24                               ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09 17:29                                 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-09 23:56                             ` linux-2.4.10-pre5 Daniel Phillips
2001-09-09  4:29                         ` linux-2.4.10-pre5 Andreas Dilger
2001-09-09  4:54                           ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09  6:17                             ` linux-2.4.10-pre5 Andreas Dilger
2001-09-09 17:31                               ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09 19:19                                 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-09 23:24                                   ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09 23:54                                     ` linux-2.4.10-pre5 Alan Cox
2001-09-10  0:04                                       ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10  0:23                                       ` linux-2.4.10-pre5 Linus Torvalds
2001-09-10  0:23                                     ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10  0:38                                       ` linux-2.4.10-pre5 Linus Torvalds
2001-09-10  1:04                                         ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-10  1:45                                           ` linux-2.4.10-pre5 Chris Mason
2001-09-10  1:55                                             ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-10  2:02                                               ` linux-2.4.10-pre5 Chris Mason
2001-09-10  2:06                                                 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-10  2:15                                               ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10  2:22                                                 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10  2:20                                                   ` linux-2.4.10-pre5 Chris Mason
2001-09-10  2:40                                                     ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10  3:02                                                       ` linux-2.4.10-pre5 Chris Mason
2001-09-10  3:36                                                         ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10 19:06                                                           ` linux-2.4.10-pre5 Chris Mason
2001-09-10  2:03                                             ` linux-2.4.10-pre5 Linus Torvalds
2001-09-10  2:41                                               ` linux-2.4.10-pre5 Chris Mason
2001-09-10 21:18                                     ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10 21:23                                       ` linux-2.4.10-pre5 Alex Bligh - linux-kernel
2001-09-10 21:54                                         ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10 22:39                                           ` linux-2.4.10-pre5 Alex Bligh - linux-kernel
2001-09-10 23:13                                             ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10 23:25                                               ` linux-2.4.10-pre5 Alex Bligh - linux-kernel
2001-09-10 22:15                                       ` linux-2.4.10-pre5 Linus Torvalds
2001-09-10 22:26                                         ` linux-2.4.10-pre5 Linus Torvalds
2001-09-10 22:39                                         ` linux-2.4.10-pre5 Rik van Riel
2001-09-10 23:14                                           ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10 23:16                                             ` linux-2.4.10-pre5 Linus Torvalds
2001-09-11  0:53                                               ` linux-2.4.10-pre5 Rik van Riel
2001-09-11  6:39                                                 ` linux-2.4.10-pre5 Hua Zhong
2001-09-11 15:12                                                 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-11 15:44                                                   ` linux-2.4.10-pre5 Daniel Phillips
2001-09-11 15:48                                                     ` linux-2.4.10-pre5 Linus Torvalds
2001-09-11 16:05                                                       ` linux-2.4.10-pre5 Alex Bligh - linux-kernel
2001-09-11 16:07                                                       ` linux-2.4.10-pre5 Daniel Phillips
2001-09-11 16:07                                                         ` linux-2.4.10-pre5 Alex Bligh - linux-kernel
2001-09-11 16:13                                                           ` linux-2.4.10-pre5 Martin Dalecki
2001-09-11 17:17                                                       ` linux-2.4.10-pre5 Daniel Phillips
2001-09-11 10:02                                           ` linux-2.4.10-pre5 Daniel Phillips
2001-09-11 20:07                                             ` linux-2.4.10-pre5 Rik van Riel
2001-09-10 23:20                                         ` linux-2.4.10-pre5 Daniel Phillips
2001-09-11  0:20                                           ` linux-2.4.10-pre5 Linus Torvalds
2001-09-11  1:16                                             ` linux-2.4.10-pre5 Daniel Phillips
2001-09-11  2:27                                               ` linux-2.4.10-pre5 Linus Torvalds
2001-09-11  7:45                                                 ` linux-2.4.10-pre5 Helge Hafting
2001-09-11 10:27                                                 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-11 15:39                                                   ` linux-2.4.10-pre5 Linus Torvalds
2001-09-11 16:52                                                     ` linux-2.4.10-pre5 Daniel Phillips
2001-09-09 19:51                               ` linux-2.4.10-pre5 Daniel Phillips
2001-09-09  9:05                           ` linux-2.4.10-pre5 Christoph Hellwig
2001-09-09 13:14                           ` linux-2.4.10-pre5 Anton Altaparmakov
2001-09-09 14:31                             ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-08 21:15     ` linux-2.4.10-pre5 Andreas Dilger
2001-09-09  0:59       ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-08 22:01 ` linux-2.4.10-pre5 Thiago Vinhas de Moraes

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=20010908195730.D11329@athlon.random \
    --to=andrea@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=viro@math.psu.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