Adapt kernel to KSM