Re: [GIT PULL] Memory folios for v5.15

From
Matthew Wilcox <willy@infradead.org>
Date
2021-08-24 13:07:13
Also in
linux-fsdevel, lkml
Reply to
Linus Torvalds, 2021-08-23
On Mon, Aug 23, 2021 at 03:06:08PM -0700, Linus Torvalds wrote:
Yeah, honestly, I would have preferred to see this done the exact
reverse way: make the rule be that "struct page" is always a head
page, and anything that isn't a head page would be called something
else.

Because, as you say, head pages are the norm. And "folio" may be a
clever term, but it's not very natural. Certainly not at all as
intuitive or common as "page" as a name in the industry.
Actually, I think this is an advantage for folios.  Maybe not for the
core MM which has always been _fairly_ careful to deal with compound
pages properly.  But for filesystem people, device drivers, etc, when
people see a struct page, they think it's PAGE_SIZE bytes in size.
And they're usually right, which is what makes things like THP so prone
to "Oops, we missed a spot" bugs.  By contrast, if you see something
which takes a struct folio and then works on PAGE_SIZE bytes, that's a
sign there's something funny going on.  There are a few of those still;
for example kmap() can only map PAGE_SIZE bytes at a time.
Thread (161 messages) 161 messages, 27 authors, last reply 2021-10-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help