mas_set(&mas, khugepaged_scan.address);
if (unlikely(!mmap_read_trylock(mm)))
goto breakouterloop_mmap_lock;
+
+ rcu_read_lock();
if (likely(!khugepaged_test_exit(mm)))
vma = mas_find(&mas, ULONG_MAX);
pgoff_t pgoff = linear_page_index(vma,
khugepaged_scan.address);
+ rcu_read_unlock();
mmap_read_unlock(mm);
ret = 1;
khugepaged_scan_file(mm, file, pgoff, hpage);
}
}
breakouterloop:
+ rcu_unread_lock();
mmap_read_unlock(mm); /* exit_mmap will destroy ptes after this */
breakouterloop_mmap_lock: