Hello, Samuel Thibault, le ven. 27 mars 2026 01:28:59 +0100, a ecrit: > Michael Kelly, le jeu. 26 mars 2026 17:53:27 +0000, a ecrit: > > On 25/03/2026 22:57, Samuel Thibault wrote: > > > Samuel Thibault, le sam. 14 mars 2026 23:13:55 +0100, a ecrit: > > > > That's possible. For some memory-hungry packages I see several GB of > > > > swap getting consumed, and little useful CPU time is spent, until the > > > > build manages to finish, or times out. > > > I had a look at the vmstat. The highest memory segment had all its > > > inactive pages swapped out, but all the other segments had almost only > > > inactive pages still in. I fixed the pageing out in gnumach, to select > > > inactive pages from all segments before looking at activate pages. I > > > believe that can help a lot when the last segment is small (and thus all > > > the swapping happens there with almost only active pages...) > > > > i've looked at the changes you've made and it seems to me that it should > > improve the performance. Perhaps if the improvement is significant the issue > > with the vm_map locking might become less common to give us more time to fix > > it. I'd be very interested in an update once you've assessed the new code in > > action. > > It's hard to tell. I have tried to run the mypy build, it's still quite > slow, but it seems faster. Possibly its working set is simply really > large. > > I guess it'd be simpler to just test with synthetic benchmarks which > exhibit simple memory access patterns.
It did help. I noticed that on a box with 2G, of which a few hundred MB are in highmem, the memory loaded in directmem stays there and doesn't get swapped out, and thus makes the available memory much smaller for the working set. This was because the LRU list is per-segment, and thus as long as the eviction finds inactive pages that it can evict from the highest segment, it will do so, without caring that way less active pages might be in a lower segment. I have reworked this to keep a global LRU list, which avoids the issue entirely. Samuel
