Module Name: src Committed By: chs Date: Sat Dec 7 23:23:25 UTC 2024
Modified Files: src/sys/kern: subr_pool.c Log Message: pool: fix pool_sethiwat() to actually do something The change that I made to the pool code back in April 2020 ("slightly change and fix the semantics of pool_set*wat()" ...) accidental broke pool_sethiwat() by making it have no effect. This was discovered after the crash reported in PR 58666 was fixed. The same machine (32-bit, with 10GB RAM) would hang due to the buffer cache causing the system to run out of kernel virtual space. The buffer cache uses a separate pool for buffer data for each power of 2 between DEV_BSIZE and MAXBSIZE, and if the usage pattern of buffer sizes changes then memory has to be moved between the different pools in order to create buffers of the new size. The buffer cache handles this by using pool_sethiwat() to cause memory freed from the buffer cache back to the pools to not be cached in the buffer cache pools but instead be freed back to the pools' back-end allocator (which allocates from the low-level kva allocator) as soon as possible. But since pool_sethiwat() wasn't doing anything, memory would stay cached in some buffer cache pools and starve other buffer cache pools (and a few other pools that do no use the kmem layer for memory allocation). Fix pool_sethiwat() to do what it is supposed to do again. To generate a diff of this commit: cvs rdiff -u -r1.291 -r1.292 src/sys/kern/subr_pool.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.