

























The original motivation for all of this work was the effort to support THPs in the page cache (other than shmem). Kiryl did that work, and I referred to it extensively at the beginning.
https://lore.kernel.org/linux-fsdevel/20170126115819.5887...
I had argued with Kiryl (as early as 2015, I think) that to be successful, we needed to support arbitrary order pages, not just THP sizes. When he stopped working on his patches, I took the opportunity to do things the way I thought they should be done.
As I worked on it, I realised that I didn't understand what it meant to pass a struct page pointer to, eg, readpage(). Was it legitimate to pass any page, even a tail page to readpage()? Or did it have to be a head page? And what, exactly, did that mean if we did pass a tail page? Should we fill in the entire compound page, or just the precise page that was requested? We have only one PageUptodate bit, and it's stored on the head page, so that pointed towards an answer of sorts.
Eventually I couldn't handle the ambiguity any more and decided we needed a new type. It's every bit as painful as everybody said it would be, but it's offered the opportunity to clean up a lot of code.
For the hyper-interested, you can see my earliest presentation on this (before the name folio had been coined) at Linux Conf AU 2020 here: https://youtu.be/p5u-vbwu3Fs
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。