[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220314153223.53753-1-linmiaohe@huawei.com>
Date: Mon, 14 Mar 2022 23:32:23 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: <akpm@...ux-foundation.org>, <hughd@...gle.com>
CC: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
<linmiaohe@...wei.com>
Subject: [PATCH] mm/mlock: remove unneeded start >= vma->vm_end check
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@...wei.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
Powered by blists - more mailing lists