I use a Measurement Computing DAQ in Ubuntu to perform continuous analog reads and writes from another system connected to the board. I have been using Ubuntu 16.04 (which went up to Linux kernel 4.15) for about five years now. I was recently exploring upgrading the system to Ubuntu 20.04 - 22.04 and each of those operating systems ships with Linux kernel 5.10 - 5.15. I am noticing that I am getting what appears to be periodic interrupts that are quite drastic (about 50 milliseconds) for every kernel 5.10 or higher. So something appears to have changed from the 5.9 kernel to the 5.10 kernel that is affecting system read() and write() calls with the A/D board. The differences can be seen in my data acquisition software:
And also in an average loop time program I have (that loops through successive read and write calls - along with some math in between):
Note how the maximum times I am seeing go from about 43 microseconds for Linux kernel 5.9 and below to 50 milliseconds for Linux kernel 5.10 and above. I obviously would like to fix this problem, but I am not sure what was changed that could have caused it. Does anyone have any idea what the culprit is, and if it could be fixed by perhaps changing a kernel parameter in the GRUB bootloader? Any pointers at all would certainly be appreciated. Thanks!
I have implemented a minimal example where we continuously call write system commands to update the DAC Outputs.
At minimum, the DAC Write command is calling "get_user" to obtain data from user-space to kernel, and calling "outw" to write the data into the DAC Register.
Now when we are executing the minimal example, we're doing back-to-back write system commands and we're noticing this 50 millisecond delay.
However, when we add a 1 microsecond delay between the write system commands, then the 50 millisecond delay vanishes. Is this possibly an issue with trying to access the user-space information or writing from the kernel to the device too quickly?
Is there a way to analyze what the kernel is doing between accessing user-space and writing data from the kernel to device?