From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Francis Moreau <francis.moro@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Question regarding concurrent accesses through block device and fs
Date: Mon, 2 Mar 2009 02:32:48 +1100 [thread overview]
Message-ID: <200903020232.48311.nickpiggin@yahoo.com.au> (raw)
In-Reply-To: <m2ab85nw28.fsf@gmail.com>
On Monday 02 March 2009 01:42:55 Francis Moreau wrote:
> [ Sorry for being long to answer but I was off, I'm slow and there are
> a lot of complex code to dig out ! ]
>
> Nick Piggin <nickpiggin@yahoo.com.au> writes:
> > On Saturday 21 February 2009 01:10:24 Francis Moreau wrote:
>
> [...]
>
> >> - looking at unmap_underlying_metadata(), there's no code to deal with
> >> meta data buffers. It gets the buffer and unmap it whatever the type
> >> of data it contains.
> >
> > That's why I say it only really works for buffer cache used by the same
> > filesystem that is now known to be unused.
>
> hum, I still don't know what you mean by this, sorry to be slow.
OK, the "buffercache", the cache of block device contents, is normally
thought of as metadata when it is being used by the filesystem (eg.
usually via bread() etc), or data when it is being read/written from
userspace via /dev/<blockdevice>.
In the former case, the buffer.c/filesystem code together know when a
metadata buffer is unused (because the filesystem has deallocated it),
so unmap_underlying_metadata will work there.
And it is insane to have a mounted filesystem and have userspace working
on the same block device, so unmap_underlying_metadata doesn't have to
care about that case. (IIRC some filesystem tools can do this, but there
are obviously a lot of tricks to it)
> >> What am I missing ?
> >
> > That we might complete the write of the new buffer before the
> > old buffer is finished writing out?
>
> Ah yes actually I realize that I don't know where and when the inode
> blocks are effectively written to the disk !
>
> It seems that write_inode(), called after data are commited to the
> disk, only marks the inode buffers as dirty but it performs no IO (at
> least it looks so for ext2 when its 'do_sync' parameter is 0 which is
> the case when this method is called by write_inode()).
>
> Could you enlight me one more time ?
Depends on the filesystem. Many do just use the buffercache as a
writeback cache for their metadata, and are happy to just let the
dirty page flushers write it out when it suits them (or when there
are explicit sync instructions given).
Most of the time, these filesystems don't really know or care when
exactly their metadata is under writeback.
next prev parent reply other threads:[~2009-03-01 15:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <m2hc2yulrw.fsf@gmail.com>
2009-02-19 11:07 ` Francis Moreau
2009-02-19 13:44 ` Nick Piggin
2009-02-20 14:10 ` Francis Moreau
2009-02-23 3:58 ` Nick Piggin
2009-03-01 14:42 ` Francis Moreau
2009-03-01 15:32 ` Nick Piggin [this message]
2009-03-01 21:07 ` Francis Moreau
2009-03-02 7:11 ` Nick Piggin
2009-03-02 13:30 ` Francis Moreau
2009-03-03 3:52 ` Nick Piggin
2009-03-12 8:05 ` Francis Moreau
2009-03-12 8:22 ` Nick Piggin
2009-03-12 9:00 ` Francis Moreau
2009-03-12 9:12 ` Nick Piggin
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=200903020232.48311.nickpiggin@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=akpm@linux-foundation.org \
--cc=francis.moro@gmail.com \
--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®