|
|
Log in / Subscribe / Register

CONFIG_SWAP_SMALL with refcount max 8?

CONFIG_SWAP_SMALL with refcount max 8?

Posted Apr 7, 2025 18:48 UTC (Mon) by k3ninho (subscriber, #50375)
Parent article: Three ways to rework the swap subsystem

>The whole thing is built around the one-byte-per-page design for the swap map, meaning that there is no space to store anything beyond a reference count and a pair of flags.

6 bits for the reference count? Did they collect stats to show they need all 6? Can we get by with 3 bits for the table, 2 flags and 3 bits for the refcount?

K3n.


to post comments

CONFIG_SWAP_SMALL with refcount max 8?

Posted Apr 7, 2025 19:08 UTC (Mon) by willy (subscriber, #9762) [Link]

If there are more than 63 references to a swap page, another page full of bytes is allocated to store the high bits. After 4095, a third page is allocated, and so on.

Yes, this is stupid. No, it rarely happens.


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