On 3/9/21 9:41 AM, Oscar Salvador wrote:
> We can optimize in the case we are adding consecutive sections, so no
> memset(PAGE_UNUSED) is needed.
> In that case, let us keep track where the unused range of the previous
> memory range begins, so we can compare it with start of the range to be
> added.
> If they are equal, we know sections are added consecutively.
> 
> For that purpose, let us introduce 'unused_pmd_start', which always holds
> the beginning of the unused memory range.
> 
> In the case a section does not contiguously follow the previous one, we
> know we can memset [unused_pmd_start, PMD_BOUNDARY) with PAGE_UNUSE.
> 
> This patch is based on a similar patch by David Hildenbrand:
> 
> https://lore.kernel.org/linux-mm/[email protected]/
> 
> Signed-off-by: Oscar Salvador <[email protected]>

This is much more clear now.  Thanks!

Acked-by: Dave Hansen <[email protected]>

Reply via email to