Re: [PATCHv2] mm: Fix warning in move_normal_pmd()

From: Linus Torvalds
Date: Wed Jul 15 2020 - 18:58:11 EST


On Wed, Jul 15, 2020 at 3:22 PM Kirill A. Shutemov <kirill@xxxxxxxxxxxxx> wrote:
>
> Sorry, but the patch is broken.

.. instead of taking up knitting - which I'd invariably also screw up
- I took a look.

Yeah, in addition to checking the vm_prev/vm_next vma's, we need to
check the limits of the 'vma' itself. Because we may not be moving the
whole vma.

So the "extend upwards" can only happen if the end address matches the
end address of the current vma (and vice versa for the "extend down"
case).

Then it would hopefully work.

But now I've screwed it up twice, and have a splitting headache, so
rather than stare at this cross-eyed, I'll take a break and hope that
somebody more competent than me looks at the code.

Linus