[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <58fcd181-cadb-1e61-fc18-9994b93bb1bc@huawei.com>
Date: Wed, 6 Apr 2022 17:17:51 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: Matthew Wilcox <willy@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>
CC: <hughd@...gle.com>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm/mlock: remove unneeded start >= vma->vm_end check
On 2022/3/15 20:30, Miaohe Lin wrote:
> On 2022/3/15 0:17, Matthew Wilcox wrote:
>> On Mon, Mar 14, 2022 at 11:32:23PM +0800, Miaohe Lin wrote:
>>> 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.
>>
>> faulty logic; vm_start + len might wrap.
What do you mean is vm_start + len might wrap, so vm_end might be < vm_start ?
If so, this could not happen as get_unmapped_area guarantees this.
>
> Many thanks for comment. I agree with you about "vm_start + len" might wrap.
> But what I mean here is that we will never see "start" >= vma->vm_end here
> as find_vma guarantees this. And I leave the "start + len <= vma->vm_start"
> check untouched. So my cleanup should be right. Or am I miss something?
So I think this "start >= vma->vm_end" check is unneeded and we can remove it.
Or am I miss something?
Many thanks!
>
> Thanks.
>
>>
>> .
>>
>
Powered by blists - more mailing lists