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?