[DragonFlyBSD - Bug #3330] (New) Swapping

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Mon Sep 26 03:49:15 PDT 2022


Задача #3330 була додана arcade at b1t.name.

----------------------------------------
Bug #3330: Swapping
http://bugs.dragonflybsd.org/issues/3330

* Автор: arcade at b1t.name
* Статус: New
* Пріоритет: Normal
* Версія: 6.4
* Початок: 2022-09-26
----------------------------------------
Hello. I just want to offload a few ideas about swapping.

First of all, nowadays if you are running off HDD you can consume memory faster then swapout will free it. This means that memory allocation throttling will be kicking in almost all of the time when you are trying to do some memory internsive stuff. The more cores the merrier, average compiler (GCC or CLANG) can easily use up to 2G of RAM reading minimum amount of files, memory will be going out in no time.

This can be partially mitigated by tweaking this:

vm.v_paging_target2=881000
vm.v_paging_target1=704800
vm.v_paging_start=528600

I just upped them 10x and now swapping out starts before and continues after the lowmem, so throttling happens not that often. Proper way to do that might be autosizing them to _start being 10% of RAM and others accordingly.

Second, vm.v_paging_wait. I see an opportunity here. Right now it's same for all processes, but it can be improved by making it default to 1% RAM + (process priority * 0.01% RAM). This means that processes with higher nice or rtprio values in tough situations would be able to get memory first, and lower priority processes will be throttled more.

Third one. On HDDs swap write and read are showing numbers that differ by a magnitude. Swapout can be up to 40Mb/s or even higher, and swapin is almost always under 2Mb/s. If any huge process was pushed out of RAM it can take minutes to get it back. I think this is because swapin gets individual pages from the drive. Even the oldest HDDs do have a prefetch cache, that works by reading to cache all pages in cylinder before requested page is found. It works pretty nice most of the time, except for swapping, probably random access pattern generates too much prefetch data overwriting everything we might want to read after. This can be partially solved by reading not only the page requested from swap, but rather reading minimum 64k from drive if we are not paging out data. Might improve reading huge processes from swap, probably...

Thanks for your attention! Hope this ideas are really worthy.



-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account


More information about the Bugs mailing list