Closed rotdrop closed 2 years ago
Given the context as presented in the commit introducing MemAvailable I think it would make the most sense to simply detect the presence of MemAvailable and use it in preference to our own calculations instead of introducing another configuration option.
Given the context as presented in the commit introducing MemAvailable I think it would make the most sense to simply detect the presence of MemAvailable and use it in preference to our own calculations instead of introducing another configuration option.
Well, I tried to be kind to the rest of the code-basis ;) I can recode the patch accordingly, but I do not know when yet, I'll post any new suggestions here.
I appreciate you taking the least invasive approach first and bringing this feature to my attention!
This project simply doesn’t take advantage of a lot of features like this due to its age (pretty sure this didn’t exist when Swapspace was first written), and we’ve already had one known bug in our implementation: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=691128 Replacing it with a kernel-generated value seems like the best approach when it’s available, though I would like to retain the current calculations as a fallback.
A slightly-modified version of this PR has now been included in v1.18-beta2 60bfc53c42bfa5e9d8843abc96fb8c0e93ea5f11 There's still some testing and release management that needs to happen on my end, but once it's released I'll close this PR. Thanks for the patch!
Committed as 36384ee548cf749f75c5e5d85708030d63818918 and b206267f69188c6d106bbb2aef7ea90a9f871d2f
Optionally just use /proc/meminfo MemAvailable
instead of computing an estimate based on buffers and cached pages.