On Fri, 7 Aug 2020 13:29:33 +0530 "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxxxxx> wrote: > Like zap_pte_range add cond_resched so that we can avoid softlockups as reported > below. On non-preemptible kernel with large I/O map region (like the one we get > when using persistent memory with sector mode), an unmap of the namespace can report > below softlockups. > > ... > > --- a/mm/vmalloc.c > +++ b/mm/vmalloc.c > @@ -102,6 +102,8 @@ static void vunmap_pmd_range(pud_t *pud, unsigned long addr, unsigned long end, > if (pmd_none_or_clear_bad(pmd)) > continue; > vunmap_pte_range(pmd, addr, next, mask); > + > + cond_resched(); > } while (pmd++, addr = next, addr != end); > } That looks sane. I'll aim for merging it in 5.9-rc2ish, with a cc:stable, OK?