lkml.org 
[lkml]   [2008]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1 of 6] hotplug-memory: refactor online_pages to separate zone growth from page onlining
From
Date

On Thu, 2008-04-03 at 17:05 -0700, Jeremy Fitzhardinge wrote:
>
> +static void grow_zone_span(unsigned long start_pfn, unsigned long
> end_pfn)
> +{
> unsigned long old_zone_end_pfn;
> + struct zone *zone;
> + unsigned long flags;
> +
> + /*
> + * This doesn't need a lock to do pfn_to_page().
> + * The section can't be removed here because of the
> + * memory_block->state_sem.
> + */
> + zone = page_zone(pfn_to_page(start_pfn));
> + pgdat_resize_lock(zone->zone_pgdat, &flags);
>
> zone_span_writelock(zone);
>
> @@ -149,19 +171,9 @@
> zone->zone_start_pfn;
>
> zone_span_writeunlock(zone);
> -}
>
> -static void grow_pgdat_span(struct pglist_data *pgdat,
> - unsigned long start_pfn, unsigned long end_pfn)
> -{
> - unsigned long old_pgdat_end_pfn =
> - pgdat->node_start_pfn + pgdat->node_spanned_pages;
> -
> - if (start_pfn < pgdat->node_start_pfn)
> - pgdat->node_start_pfn = start_pfn;
> -
> - pgdat->node_spanned_pages = max(old_pgdat_end_pfn, end_pfn) -
> - pgdat->node_start_pfn;
> + grow_pgdat_span(zone->zone_pgdat, start_pfn, end_pfn);
> + pgdat_resize_unlock(zone->zone_pgdat, &flags);
> }
>
> static int online_pages_range(unsigned long start_pfn, unsigned long
> nr_pages,
> @@ -180,16 +192,12 @@
> return 0;
> }

I don't particularly like this change to have grow_pgdat_span() called
*from* grow_zone_span(). Seems backwards to me. But, this diff look
funny (not your fault) so I may just be seeing things. :)

-- Dave



\
 
 \ /
  Last update: 2008-04-04 03:09    [W:0.109 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site