ZD Net :- Old Linus Torvalds is back: Linux page caching sparks ‘bulls**t’ outburst
There are only two hard things in Computer Science: cache invalidation and naming things
“You’ve made that claim before, and it’s been complete bullshit before too, and I’ve called you out on it then too,” wrote Torvalds.
“Why do you continue to make this obviously garbage argument?”
According to Torvalds, the page cache serves its correct purpose as a cache.
“The key word in the ‘page cache’ name is ‘cache’,” wrote Torvalds.
“Caches work, Dave. Anybody who thinks caches don’t work is incompetent. 99 percent of all filesystem accesses are cached, and they never do any IO at all, and the page cache handles them beautifully,” Torvalds wrote.
“When you say 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.”
Chinner, in response to Torvalds comment that “caches work, Dave”, reminded the Linux kingpin about his commitment to “civil discussion” and attempting to create a professional environment for kernel developers:
“Yes, they do,” replied Chinner. “I see plenty of cases where the page cache works just fine because it is still faster than most storage. But that’s not what I said.”
Chinner said Torvalds hadn’t even bothered to ask him to clarify what he was referring to in the statement Torvalds quoted.
“You’ve taken one single statement I made from a huge email about complexities in dealing with IO concurrency, the page cache and architectural flaws in the existing code, quoted it out of context, fabricated a completely new context and started ranting about how I know nothing about how caches or the page cache work,” Chinner said.
“Not very professional but, unfortunately, an entirely predictable and expected response. Linus, nobody can talk about direct IO without you screaming and tossing all your toys out of the crib. If you can’t be civil or you find yourself writing a some condescending ‘caching 101’ explanation to someone who has spent the last 15+ years working with filesystems and caches, then you’re far better off not saying anything.”
Chinner was talking in the context of specific IO requests that just don’t cache well, and noted that these inefficiencies could become more obvious as the deployment of PCIe 4.0-connected non-volatile storage memory spreads. Thus, the Aussie hit back:
Chinner, who maintains the SGI-created XFS file system, concluded by clarifying in black and white: “For a highly concurrent application that is crunching through bulk data on large files on high throughput storage, the page cache is still far, far slower than direct IO.”
In response, Torvalds grumbled about his debate opponent “back-tracking a bit,” before adding: “I don’t understand why you hate the page cache so much. For the cases you care about, the page cache should be a total non-issue … maybe some day people won’t have SSDs at all, and it’s all NVDIMMs, and all filesystem data accesses are DAX, and caching is all done by hardware and the page cache will never exist at all.
“But honestly, that day is not today. It’s decades away, and might never happen at all.”
It is good to see grown men care so deeply about things such as this.