Re: [PATCH] mm/vmalloc.c: Remove always-true conditional in vmap_init_free_space

From: Matthew Wilcox
Date: Mon Jul 08 2019 - 13:35:44 EST


On Tue, Jul 09, 2019 at 01:06:31AM +0800, Pengfei Li wrote:
> When unsigned long variables are subtracted from one another,
> the result is always non-negative.
>
> The vmap_area_list is sorted by address.
>
> So the following two conditions are always true.
>
> 1) if (busy->va_start - vmap_start > 0)
> 2) if (vmap_end - vmap_start > 0)
>
> Just remove them.

That condition won't be true if busy->va_start == vmap_start.