Messages in this thread | | | From | Pavel Tatashin <> | Date | Fri, 27 Jul 2018 11:24:15 -0400 | Subject | Re: [PATCH v4 4/4] mm/page_alloc: Introduce free_area_init_core_hotplug |
| |
Hi Oscar,
> static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start)
Remove __ref from this function and add it to free_area_init_core_hotplug() instead, as that is the only function from a different section. This will reduce the scope of ref, and no need to place reset_node_managed_pages() into a different section as it is compiled only when CONFIG_MEMORY_HOTPLUG=y
> +#ifdef CONFIG_MEMORY_HOTPLUG > +void __paginginit free_area_init_core_hotplug(int nid) > +{ > + enum zone_type j; > + pg_data_t *pgdat = NODE_DATA(nid); > + > + pgdat_init_internals(pgdat); > + for (j = 0; j < MAX_NR_ZONES; j++) { > + struct zone *zone = pgdat->node_zones + j; > + zone_init_internals(zone, j, nid, 0); > + } > +}
Style: I would write the for() loop above like this:
for (i = 0; i < MAX_NR_ZONES; i++) zone_init_internals(&pgdat->node_zones[i], i, nid, 0);
Other than this all good: Reviewed-by: Pavel Tatashin <pasha.tatashin@oracle.com>
Thank you, Pavel
| |