This is a RFC, even patch3 is a hack to fix the softlock issue when populate or depopulate pte with large region, looking forward to your reply and advise, thanks. Kefeng Wang (3): mm: kasan: shadow: add cond_resched() in kasan_populate_vmalloc_pte() mm: kasan: shadow: move free_page() out of page table lock mm: kasan: shadow: HACK add cond_resched_lock() in kasan_depopulate_vmalloc_pte() include/linux/kasan.h | 9 ++++++--- mm/kasan/shadow.c | 20 +++++++++++++------- mm/vmalloc.c | 7 ++++--- 3 files changed, 23 insertions(+), 13 deletions(-) -- 2.41.0