Hi Matthew,
I will do both of your suggestions (custom kernel config, patch uvm_swap_stats() ).
However, I noticed something unusual yesterday with sysctl: I have the line "sysctl machdep.cpu.frequency.current" in my .zshrc file so I should get my cpu's current frequency, and that works the 1st time I log in. However, often, when I start a 2nd (or 3rd or...) ssh session, the machine hangs that login at that line; ^T shows this:
< many same lines before with ^T, just diff systime >
[ 108947.5647601] load: 1.07 cmd: sysctl 9875 [tstile] 0.00u 0.51s 0% 1308k
[ 108947.5977861] load: 1.07 cmd: sysctl 9875 [tstile] 0.00u 0.51s 0% 1308k
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C
^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z
[ 108955.9438290] load: 1.06 cmd: sysctl 9875 [tstile] 0.00u 0.51s 0% 1308k
< many same lines after with ^T, just diff systime >
sysctl sits there forever in this 'tstile' state.
Note that ^C and ^Z seem to only echo, and not get caught. (I did not report this as I cannot (yet) reliably reproduce this after I reboot and try again; but has happened about 3x so far, reboot fixes it)
I'm now wondering if this isn't some specific Raspberry Pi 4A hardware problem -- because I, too, tried continuous "swapctl -l" loops with no failures.
I'm wondering if there's something about the way the sysctl database allows member access? I don't think the swapctl program is at fault -- I think it is getting something bogus and simply reporting the bogosity.
Thanks for banging on this; these 'intermittents' are incredible pains. If it's real, there is likely some 'race' somewhere. If it's HW, well... sorry. But, gosh, everything else is rock-solid.
Let me collect more data; don't pull your hair out!
Thanks again,
Mike