add multithread case, and fix ksm testing