|
|
Subscribe / Log in / New account

Repurposing page->mapping

Repurposing page->mapping

Posted Apr 27, 2018 4:11 UTC (Fri) by neilbrown (subscriber, #359)
Parent article: Repurposing page->mapping

> Glisse concluded the session by acknowledging that most developers seemed to feel that this change "looks ugly".

Sounds like a perfect fit for 'struct page' then.

I actually think this is a good idea - have an 'extension' structure for pages to store details that are only used transiently or only on a tiny fraction of pages.
I would re-use private rather than mapping (sorry Chris) and the extension structure would contain:
- refcount
- private
- link back to the struct page
- anything else anyone wanted (flags,wait-queue-heads, linked list head...)
Any code that wanted to could add a page_extension at any time, and current users of private would need to be careful to get/update the right field. A couple of macros would make this easy.

This would have the added benefit that we would have to review all users of ->private, and we could use that opportunity to rename it to something grepable (pg_private) and change it from an unsigned long to a void star. That alone would make it all worth while.


to post comments

Repurposing page->mapping

Posted Apr 27, 2018 21:02 UTC (Fri) by willy (subscriber, #9762) [Link]

We actually have page_ext already ...

I'm not sure if anyone's considered putting per-page wait queues in there; I suspect not. The memory overhead might be deemed a little heavy.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds