Hi Sasha, Thanks for bug reporting. On Mon, Jun 16, 2014 at 11:24:16AM -0400, Sasha Levin wrote: > On 06/06/2014 06:58 PM, Naoya Horiguchi wrote: > > This patch makes do_mincore() use walk_page_vma(), which reduces many lines > > of code by using common page table walk code. > > > > Signed-off-by: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx> > > Hi Naoya, > > This patch is causing a few issues on -next: > > [ 367.679282] BUG: sleeping function called from invalid context at mm/mincore.c:37 cond_resched() in mincore_hugetlb() triggered this. This is done in common pagewalk code, so I should have removed it. ... > And: > > [ 391.118663] BUG: unable to handle kernel paging request at ffff880142aca000 > [ 391.118663] IP: mincore_hole (mm/mincore.c:99 (discriminator 2)) walk->pte_hole cannot assume walk->vma != NULL, so I should've checked it in mincore_hole() before using walk->vma. Could you try the following fixes? Thanks, Naoya Horiguchi --- diff --git a/mm/mincore.c b/mm/mincore.c index d8a5e9f62268..3261788369bd 100644 --- a/mm/mincore.c +++ b/mm/mincore.c @@ -34,7 +34,6 @@ static int mincore_hugetlb(pte_t *pte, unsigned long addr, present = pte && !huge_pte_none(huge_ptep_get(pte)); for (; addr != end; vec++, addr += PAGE_SIZE) *vec = present; - cond_resched(); walk->private += (end - addr) >> PAGE_SHIFT; #else BUG(); @@ -91,7 +90,7 @@ static int mincore_hole(unsigned long addr, unsigned long end, unsigned long nr = (end - addr) >> PAGE_SHIFT; int i; - if (vma->vm_file) { + if (vma && vma->vm_file) { pgoff_t pgoff; pgoff = linear_page_index(vma, addr); -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>