Hi Samuel,

On 27/12/2025 13:31, Samuel Thibault wrote:
Mike Kelly via Bug reports for the GNU Hurd, le sam. 20 déc. 2025 18:29:19 
+0000, a ecrit:
+      if (nr_ext_pages)
+       {
+         unsigned long nr_int_pages
+           = (seg->active_pages.internal.nr_pages +
+              seg->inactive_pages.internal.nr_pages);
+
+         /* Don't page out external pages if they total less than 1
+            in N pageable pages in this segment. This is an
+            extremely primitive starting position for an actual
+            eviction strategy. */
+         if ((nr_int_pages / nr_ext_pages) <= /*N*/ 25 &&
I don't remember the details of what we currently have, but in my mind,
what we should have is:

- try to evict external inactive pages,
- else try to evict internal inactive pages,
- else try to evict external active pages,
- else try to evict internal active pages,

Yes, that is a plausible strategy. I have tried a number of different ones recently with varying levels of improvement but I don't think that I've tried this one specifically. I'll implement this as you describe and benchmark using the same test case that I used for my initial report.

My main goal for this series of patches was to start to generalise the current code so that different strategies can be trialled more easily. It's non-trivial however to compare the relative performance of these without an agreed set of benchmarks. My g++ compilation is one example but there are other test cases that might drive the system differently that could be just as important. Suggestions are welcome.

so that we don't pressure external active pages unless we don't have
inactive pages at all any more. I don't think we are doing that ATM?
That would probably avoid hardcoding a 1/25 ratio, and just rely on
respective active/inactive ratios.
The selection order is always either internal/inactive then internal/active or external/inactive then external/active. This is an area that should also be generalised to support your proposal above.

While you are at it, we are seeing on buildds some file content
corruptions, leading to various compilation issues such as

/usr/include/i386-gnu/c++/15/bits/c++io.h:1:3: error: stray ‘\2’ in program

This seems to be happening with builds of large programs that put
pressure on page-out and such. Notably, building qtcreator seems
stressful. The bogus content remains as such on the disk, and the bogus
content is aligned on a page boundary, so it looks as if the page was
removed and reused+overwritten before the content has hit the disk, and
thus the overwritten content is written to the disk, and reloaded as
such.

I'll try and reproduce this locally which if successful will be a great help in identifying what's going wrong.

All the best,

Mike.


Reply via email to