@@ -4604,6 +4604,9 @@ void lru_gen_look_around(struct page_vma_mapped_walk *pvmw)
if (spin_is_contended(pvmw->ptl))
return;
+ /* avoid taking the LRU lock under the PTL when possible */
+ walk = current->reclaim_state ? current->reclaim_state->mm_walk : NULL;
+
start = max(pvmw->address & PMD_MASK, pvmw->vma->vm_start);
end = min(pvmw->address | ~PMD_MASK, pvmw->vma->vm_end - 1) + 1;
@@ -4619,7 +4622,6 @@ void lru_gen_look_around(struct page_vma_mapped_walk *pvmw)
}
pte = pvmw->pte - (pvmw->address - start) / PAGE_SIZE;
- walk = current->reclaim_state ? current->reclaim_state->mm_walk : NULL;
rcu_read_lock();
arch_enter_lazy_mmu_mode();
Signed-off-by: Yu Zhao <yuzhao@google.com> --- mm/vmscan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)