Re: [Patch]Fix spanned_pages is not updated at a case of memory hot-add.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I really don't like the idea of having this variable called "new_"
> something.  That implies that this is what the new end_pfn is going to
> be.  The *new* one.  In reality, it is what it _might_ have been.  How
> about "tmp_zone_end_pfn"?
> 
> This practice of dealing with spanned_pages is a real pain. 
> 
> I generally try to avoid max/min in code, but this struck me as possibly
> being useful.  Do you find this easier to read, or your patch?

Ah, I think using max is better due to smaller code, indeed.

> 
> diff -puN mm/memory_hotplug.c~fix-spanned-pages mm/memory_hotplug.c
> --- work/mm/memory_hotplug.c~fix-spanned-pages	2006-05-23 09:04:31.000000000 -0700
> +++ work-dave/mm/memory_hotplug.c	2006-05-23 09:22:18.000000000 -0700
> @@ -91,8 +91,8 @@ static void grow_zone_span(struct zone *
>  	if (start_pfn < zone->zone_start_pfn)
>  		zone->zone_start_pfn = start_pfn;
>  
> -	if (end_pfn > old_zone_end_pfn)
> -		zone->spanned_pages = end_pfn - zone->zone_start_pfn;
> +	zone->spanned_pages = max(old_zone_end_pfn, end_pfn) -
> +				zone->zone_start_pfn);
                                                    ^
                                       this parentheses is redundant. :-)

Could you fix and repost it? Or should I?

-- 
Yasunori Goto 


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux