On Tue 19-12-17 20:29:56, Tetsuo Handa wrote: > On 2017/12/15 4:53, Yang Shi wrote: > > diff --git a/mm/khugepaged.c b/mm/khugepaged.c > > index ea4ff25..ecc2b68 100644 > > --- a/mm/khugepaged.c > > +++ b/mm/khugepaged.c > > @@ -1674,7 +1674,12 @@ static unsigned int khugepaged_scan_mm_slot(unsigned int pages, > > spin_unlock(&khugepaged_mm_lock); > > > > mm = mm_slot->mm; > > - down_read(&mm->mmap_sem); > > + /* > > + * Not wait for semaphore to avoid long time waiting, just move > > + * to the next mm on the list. > > + */ > > + if (unlikely(!down_read_trylock(&mm->mmap_sem))) > > + goto breakouterloop_mmap_sem; > > if (unlikely(khugepaged_test_exit(mm))) > > vma = NULL; > > else > > > > You are jumping before initializing vma. > > mm/khugepaged.c: In function ‘khugepaged’: > mm/khugepaged.c:1757:31: warning: ‘vma’ may be used uninitialized in this function [-Wmaybe-uninitialized] > if (khugepaged_test_exit(mm) || !vma) { > ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ > mm/khugepaged.c:1659:25: note: ‘vma’ was declared here > struct vm_area_struct *vma; > ^~~ http://lkml.kernel.org/r/20171215125129.2948634-1-arnd@xxxxxxxx -- Michal Hocko SUSE Labs -- 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>