lkml.org 
[lkml]   [2022]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm/mlock: remove unneeded start >= vma->vm_end check
Date
If find_vma returns a vma, it must satisfies that start < vma->vm_end.
Since vma list is sorted in the ascending order, so we will never see
start >= vma->vm_end here. Remove this unneeded check.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
mm/mlock.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/mm/mlock.c b/mm/mlock.c
index fefa9644d0f9..fe278634ebe3 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -509,8 +509,6 @@ static unsigned long count_mm_mlocked_page_nr(struct mm_struct *mm,
return 0;

for (; vma ; vma = vma->vm_next) {
- if (start >= vma->vm_end)
- continue;
if (start + len <= vma->vm_start)
break;
if (vma->vm_flags & VM_LOCKED) {
--
2.23.0
\
 
 \ /
  Last update: 2022-09-17 16:16    [W:0.059 / U:1.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site