|
|
Log in / Subscribe / Register

Dynamic allocation

Dynamic allocation

Posted Feb 3, 2026 14:21 UTC (Tue) by daroc (editor, #160859)
In reply to: Dynamic allocation by MKesper
Parent article: Modernizing swapping: introducing the swap table

I had that same thought while reviewing the article! Jon's take was that if the system has already ended up in a state where it can't free even a single page of memory in order to make several more available, the situation is already probably pretty dire.

In practice, if the system has swap configured, it's going to want to swap out some pages of memory before it tries unloading file-backed pages that are currently in use; therefore, if this mechanism does need another page urgently, it can bump a file-backed page, finish swapping out the anonymous pages, and then let the file-backed page get faulted back in.


to post comments

Where is the decision to allocate a swap table made?

Posted Feb 3, 2026 16:04 UTC (Tue) by farnz (subscriber, #17727) [Link] (1 responses)

Do you know where the decision to allocate the table is made?

I'm wondering if the kernel is able to promise that it starts swapping (if there's swap configured) before it's down to its last clean or free page - so that it never actually gets into the situation where it can't allocate a page of physical memory to allow it to free up more by swapping, because in the worst case, it can do the file-backed page dance you describe.

Where is the decision to allocate a swap table made?

Posted Feb 3, 2026 17:13 UTC (Tue) by corbet (editor, #1) [Link]

The kernel will start reclaim long before it gets to that last free page. There are watermark levels that it tries to never go below.


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