Re: [PATCH V6 3/3] arm64/mm: Enable memory hot remove

From: Anshuman Khandual
Date: Fri Jun 21 2019 - 08:53:08 EST



On 06/19/2019 09:47 AM, Anshuman Khandual wrote:
> +#ifdef CONFIG_MEMORY_HOTPLUG
> + /*
> + * FIXME: We should have called remove_pagetable(start, end, true).
> + * vmemmap and vmalloc virtual range might share intermediate kernel
> + * page table entries. Removing vmemmap range page table pages here
> + * can potentially conflict with a cuncurrent vmalloc() allocation.
> + *
> + * This is primarily because valloc() does not take init_mm ptl for
> + * the entire page table walk and it's modification. Instead it just
> + * takes the lock while allocating and installing page table pages
> + * via [p4d|pud|pmd|pte]_aloc(). A cuncurrently vanishing page table
> + * entry via memory hotremove can cause vmalloc() kernel page table
> + * walk pointers to be invalid on the fly which can cause corruption
> + * or worst, a crash.

There are couple of typos above which I will fix along with other reviews.