[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20130308133106.ec4f9810b69b105b8f70d82a@linux-foundation.org>
Date: Fri, 8 Mar 2013 13:31:06 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Toshi Kani <toshi.kani@...com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
isimatu.yasuaki@...fujitsu.com, wency@...fujitsu.com,
tangchen@...fujitsu.com
Subject: Re: [PATCH 2/2] mm: remove_memory: Fix end_pfn setting
On Fri, 8 Mar 2013 08:41:41 -0700 Toshi Kani <toshi.kani@...com> wrote:
> remove_memory() calls walk_memory_range() with [start_pfn, end_pfn),
> where end_pfn is exclusive in this range. Therefore, end_pfn needs
> to be set to the next page of the end address.
>
> ...
>
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -1801,7 +1801,7 @@ int __ref remove_memory(int nid, u64 start, u64 size)
> int retry = 1;
>
> start_pfn = PFN_DOWN(start);
> - end_pfn = start_pfn + PFN_DOWN(size);
> + end_pfn = PFN_UP(start + size - 1);
>
> /*
> * When CONFIG_MEMCG is on, one memory block may be used by other
That looks right, although these rounding/boundary things are always
hard. I wonder if `start' and `size' are ever not multiples of
PAGE_SIZE..
How did you discover this? Code inspection, or some runtime
malfunction? Please always include this info when fixing bugs.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists