mm: optimize Kernel Samepage Merging (KSM)

Change-Id: Ib29ad7d3f09c88fb7e38b593ccbaa5166490fdd0