Re: pagecache locking (was: bcachefs status update) merged)
From: Linus Torvalds
Date: Thu Jun 13 2019 - 22:35:44 EST
On Thu, Jun 13, 2019 at 1:56 PM Dave Chinner <david@xxxxxxxxxxxxx> wrote:
>
> That said, the page cache is still far, far slower than direct IO,
Bullshit, Dave.
You've made that claim before, and it's been complete bullshit before
too, and I've called you out on it then too.
Why do you continue to make this obviously garbage argument?
The key word in the "page cache" name is "cache".
Caches work, Dave. Anybody who thinks caches don't work is
incompetent. 99% of all filesystem accesses are cached, and they never
do any IO at all, and the page cache handles them beautifully.
When you say that the page cache is slower than direct IO, it's
because you don't even see or care about the *fast* case. You only get
involved once there is actual IO to be done.
So you're making that statement without taking into account all the
cases that you don't see, and that you don't care about, because the
page cache has already handled them for you, and done so much better
than DIO can do or ever _will_ do.
Is direct IO faster when you *know* it's not cached, and shouldn't be
cached? Sure. But that/s actually quite rare.
How often do you use non-temporal stores when you do non-IO
programming? Approximately never, perhaps? Because caches work.
And no, SSD's haven't made caches irrelevant. Not doing IO at all is
still orders of magnitude faster than doing IO. And it's not clear
nvdimms will either.
So stop with the stupid and dishonest argument already, where you
ignore the effects of caching.
Linus