lkml.org 
[lkml]   [2018]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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

\
 
 \ /
  Last update: 2018-07-27 17:25    [W:0.240 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site