From: Linus Torvalds <torvalds@linux-foundation.org>
To: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH 2/2] hpfs: optimize quad buffer loading
Date: Thu, 30 Jan 2014 09:59:06 -0800 [thread overview]
Message-ID: <CA+55aFx5Wk5zbvsJbjztt4RV69xz-s43oyPhHdZS6wjMBDJ51g@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1401291551160.15720@artax.karlin.mff.cuni.cz>
On Wed, Jan 29, 2014 at 7:05 AM, Mikulas Patocka
<mikulas@artax.karlin.mff.cuni.cz> wrote:
>
> Suppose that 8 consecutive sectors on the disk contain this data:
> dnode (4 sectors)
> fnode (1 sector)
> file content (3 sectors)
> --- now, you can't access that fnode using 2kB buffer, if you did and if
> you marked that buffer dirty, you damage file content.
>
> So you need different-sized buffers on one page.
No. You're missing the whole point.
"consecutive sectors" does not mean "same page".
The page cache doesn't care. It never has. Non-consecutive sectors is
common for normal file mappings.
The *buffer* cache doesn't really care either, and in fact that
non-consecutive case used to be the common one (very much even for raw
disk accesses, exactly because things *used* to be coherent with a
mounted filesystem - so if there were files that had populated part of
the buffer cache with their non-consecutive sectors, the raw disk
access would just use those non-consecutive sectors).
And all that worked because we'd just look up the buffer head in the
hashes. The page it was on didn't matter.
The problem is that (not *that* long ago, relatively speaking) we have
castrated the buffer cache so much (because almost nobody really uses
it any more) that now it's really a slave of the page cache, and we
got rid of the buffer head hashes entirely. So now we look up the
buffer heads using the page cache, and *that* causes the problems (and
forces us to put those buffer heads in the same page, because we index
by page).
We can actually still just create such non-consecutive buffers and do
IO on them, we just can't look them up any more.
Linus
next prev parent reply other threads:[~2014-01-30 17:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-28 23:10 [PATCH 1/2] hpfs: remember free space Mikulas Patocka
2014-01-28 23:11 ` [PATCH 2/2] hpfs: optimize quad buffer loading Mikulas Patocka
2014-01-28 23:44 ` Linus Torvalds
2014-01-29 1:01 ` Mikulas Patocka
2014-01-29 1:51 ` Mikulas Patocka
2014-01-29 2:05 ` Linus Torvalds
2014-01-29 14:50 ` Mikulas Patocka
2014-01-29 2:01 ` Linus Torvalds
2014-01-29 15:05 ` Mikulas Patocka
2014-01-30 17:59 ` Linus Torvalds [this message]
2014-01-31 17:41 ` Mikulas Patocka
2014-01-31 17:52 ` Linus Torvalds
2014-01-31 18:10 ` Mikulas Patocka
2014-01-31 18:40 ` Linus Torvalds
2014-01-31 19:19 ` Mikulas Patocka
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=CA+55aFx5Wk5zbvsJbjztt4RV69xz-s43oyPhHdZS6wjMBDJ51g@mail.gmail.com \
--to=torvalds@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mikulas@artax.karlin.mff.cuni.cz \
/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;
as well as URLs for NNTP newsgroup(s).