KSM is using about 30% of CPU time

Sorry, but this is expected behavior - KSM need to scan the whole memory all the time, so this need CPU (how much can be controlled in the KSM configuration).

A proper "fix" is to decrease time interval KSM scans the memory.

By default, it's 10 ms, a good value for me is 100 ms:

KSM_SLEEP_MSEC=100


If KSM is to "merge" pages, and then unmerge them after 20 ms, and then merge after 10 ms, in reality, you don't save anything but cause CPU load.

Probably worth making it the default value?
 
Yes, maybe. How much memory do you have and what cpu load do you get with this setting (compared to the default)?

I used it on several servers, with 4 - 8 - 12 - 16 - 24 GB RAM.
CPU usage with default values was usually double-digit (on one core); with 100 ms value, it's somewhere between 1-6%.