Effects of adjusting coherent_pool kernel parameter value
#1
I know that coherent_pool is a Linux kernel command line parameter, and it "sets the size of memory pool for coherent, atomic DMA allocations". I know it is specific to ARM ISA. I know it is set to 1M (1MiB) in bootloader config in Danielt's unofficial Debian installer script, and likely in most other Linux images/installers for PBP. I know in-kernel it defaults to 256KiB. I know (both from own experience and from some experienced Linux systems engineers) that various "performance tweaks" often times at best give marginal improvements or have a placebo effect, at worst can compromise system performance or stability or both. But at least for tweaks like vm.swappiness or the likes there are pretty clear consequences of changing their value either way. Even CMA (Contiguous Memory Allocator) has reasonably clear consequences of tweaking the value - too little and your device drivers for e.g. webcam may be unable to allocate enough RAM to work properly, too much is just pointless though shouldn't hurt your system (in practice it appears to be "eating" into memory usable by normal applications - e.g. when I experimented with very high CMA numbers my applications at some point started OOMing).

What I'm still puzzled by though through and through is coherent_pool - so far I have been unable to figure out what exact effect changing this value would have. It appears there is some interplay with CMA - e.g. if I set coherent_pool to 1M-8M and CMA at their default 64M things seem to work fine, if I drop CMA to 0 I easily get OOMs if coherent_pool is still set to 1M-8M, but system seems to work fine if I set coherent_pool or both to 0 (admittedly, haven't tried using webcam or any USB devices in that setup). So from that I conclude that coherent_pool actually needs CMA to work correctly, even if from https://lwn.net/Articles/479297/ it seems that CMA is a more recent development than coherent_pool. Some googling around shows that people run into some issues with certain drivers if coherent_pool is not set large enough (and especially if CMA is not enabled/large enough - one source had system complain about insufficiently big coherent_pool, and the issue was fixed by increasing CMA size instead), and some other sources claim issues if coherent_pool is set too large.

AFAIK there are some people working on kernel code around here, I am hoping that maybe some of them would know enough about kernel (as large of a knowledge area it is though) to provide some clarity on coherent_pool - what exactly is this setting for, how does it interact with CMA, why is it set by default to 256KiB if it (supposedly) frequently needs (does it?) to be tweaked to larger amounts, what is the effect of increasing or lowering its value too much?
This message was created with 100% recycled electrons
  Reply


Messages In This Thread
Effects of adjusting coherent_pool kernel parameter value - by moonwalkers - 02-08-2021, 06:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to mainline kernel on daniel thompson's debian installer? hellojack 14 7,375 09-07-2023, 09:38 PM
Last Post: Der Geist der Maschine
  kernel module that supports usb-c hdmi alexandre 16 14,546 05-14-2023, 09:58 PM
Last Post: rathofkhan3
Question Debian (Vanilla) no output on display after Kernel update (6.0.8-1) as365n4 1 1,273 12-09-2022, 12:43 PM
Last Post: as365n4
  bootloader menu to pick a kernel - what is the current situation in in early 2022? maxtothemax 4 3,137 02-05-2022, 03:04 PM
Last Post: maxtothemax
  Kernel panics solostian 17 14,176 01-26-2022, 08:08 AM
Last Post: TRS-80
  Kernel 5.17 will improve VP9 support? jiyong 1 2,119 01-16-2022, 08:26 PM
Last Post: xmixahlx
  red/green power led not working with kernel 5.14 alchemist 4 3,776 11-04-2021, 04:09 AM
Last Post: alchemist
  Sound stuttering on Manjaro gnome after latest kernel upgrade? pjsf 0 1,785 07-13-2021, 10:37 PM
Last Post: pjsf
  Kernel panic on boot with danielt's Debian installer hjalfi 11 11,164 07-09-2021, 08:52 AM
Last Post: moonwalkers
  Kernel crash on Manjaro ARM mfashby 0 1,592 07-06-2021, 03:17 PM
Last Post: mfashby

Forum Jump:


Users browsing this thread: 1 Guest(s)