LWN: Comments on "Repurposing page->mapping" https://lwn.net/Articles/752564/ This is a special feed containing comments posted to the individual LWN article titled "Repurposing page->mapping". en-us Wed, 08 Oct 2025 22:07:39 +0000 Wed, 08 Oct 2025 22:07:39 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Repurposing page->mapping https://lwn.net/Articles/752988/ https://lwn.net/Articles/752988/ willy <div class="FormattedComment"> We actually have page_ext already ...<br> <p> 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.<br> <p> </div> Fri, 27 Apr 2018 21:02:40 +0000 Repurposing page->mapping https://lwn.net/Articles/752913/ https://lwn.net/Articles/752913/ neilbrown <div class="FormattedComment"> <font class="QuotedText">&gt; Glisse concluded the session by acknowledging that most developers seemed to feel that this change "looks ugly".</font><br> <p> Sounds like a perfect fit for 'struct page' then.<br> <p> 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.<br> I would re-use private rather than mapping (sorry Chris) and the extension structure would contain:<br> - refcount<br> - private<br> - link back to the struct page<br> - anything else anyone wanted (flags,wait-queue-heads, linked list head...)<br> 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.<br> <p> This would have the added benefit that we would have to review all users of -&gt;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.<br> <p> </div> Fri, 27 Apr 2018 04:11:27 +0000 Repurposing page->mapping https://lwn.net/Articles/752905/ https://lwn.net/Articles/752905/ andresfreund <div class="FormattedComment"> <font class="QuotedText">&gt; The page structure is one of the most complex in the kernel due to the need to cram the maximum amount of information into as little space as possible. Each field is so heavily overloaded that developers prefer to avoid making changes to struct page if they can avoid it.</font><br> <p> There was a session by Matthew Wilcox on Wednesday about cleaning that up, at least a bit. <a href="https://docs.google.com/spreadsheets/d/1tvCszs_7FXrjei9_mtFiKV6nW1FLnYyvPvW-qNZhdog/edit?usp=sharing">https://docs.google.com/spreadsheets/d/1tvCszs_7FXrjei9_m...</a><br> </div> Fri, 27 Apr 2018 00:45:01 +0000