On Wed, Apr 17, 2019 at 11:39:16AM -0700, Dan Williams wrote:
> @@ -417,10 +417,10 @@ static void shrink_zone_span(struct zone *zone, 
> unsigned long start_pfn,
>        * it check the zone has only hole or not.
>        */
>       pfn = zone_start_pfn;
> -     for (; pfn < zone_end_pfn; pfn += PAGES_PER_SECTION) {
> +     for (; pfn < zone_end_pfn; pfn += PAGES_PER_SUB_SECTION) {
>               ms = __pfn_to_section(pfn);
>  
> -             if (unlikely(!valid_section(ms)))
> +             if (unlikely(!pfn_valid(pfn)))
>                       continue;
>  
>               if (page_zone(pfn_to_page(pfn)) != zone)
> @@ -485,10 +485,10 @@ static void shrink_pgdat_span(struct pglist_data *pgdat,
>        * has only hole or not.
>        */
>       pfn = pgdat_start_pfn;
> -     for (; pfn < pgdat_end_pfn; pfn += PAGES_PER_SECTION) {
> +     for (; pfn < pgdat_end_pfn; pfn += PAGES_PER_SUB_SECTION) {
>               ms = __pfn_to_section(pfn);
>  
> -             if (unlikely(!valid_section(ms)))
> +             if (unlikely(!pfn_valid(pfn)))
>                       continue;
>  
>               if (pfn_to_nid(pfn) != nid)

The last loop from shrink_{pgdat,zone}_span can be reworked to unify both
in one function, and both functions can be factored out a bit.
Actually, I do have a patch that does that, I might dig it up.

The rest looks good:

Reviewed-by: Oscar Salvador <[email protected]>

> 

-- 
Oscar Salvador
SUSE L3
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to