--- - branch: MAIN date: Wed Feb 24 05:36:02 UTC 2021 files: - new: '1.276' old: '1.275' path: src/sys/kern/subr_pool.c pathrev: src/sys/kern/subr_pool.c@1.276 type: modified id: 20210224T053602Z.8f6452b76bc616031addd09f242bc4f772128b60 log: | skip redzone on pools with the allocation (including all overhead) on anything greater than half the pool pagesize. this stops 4KiB being used per allocation from the kmem-02048 pool, and 64KiB per allocation from the buf32k pool. we're still wasting 1/4 of space for overhead on eg, the buf1k or kmem-01024 pools. however, including overhead costs, the amount of useless space (not used by consumer or overhead) reduces from 47% to 18%, so this is far less bad overall. there are a couple of ideas on solving this less ugly: - pool redzones are enabled with DIAGNOSTIC kernels, which is defined as being "fast, cheap". this is not cheap (though it is relatively fast if you don't run out of memory) so it does not really belong here as is, but DEBUG or a special option would work for it. - if we increase the "pool page" size for these pools, such that the overhead over pool page is reduced to 5% or less, we can have redzones for more allocations without using more space. also, see this thread: https://mail-index.netbsd.org/tech-kern/2021/02/23/msg027130.html module: src subject: 'CVS commit: src/sys/kern' unixtime: '1614144962' user: mrg