On Wed, Oct 3, 2012 at 6:02 AM, Yasuaki Ishimatsu
<[email protected]> wrote:
> From: Yasuaki Ishimatsu <[email protected]>
>
> add_memory() hot adds a physical memory. But remove_memory does not
> hot remove a phsical memory. It only offlines memory. The name
> confuse us.
>
> So the patch renames remove_memory() to offline_memory(). We will
> use rename_memory() for hot removing memory.
>
> CC: David Rientjes <[email protected]>
> CC: Jiang Liu <[email protected]>
> CC: Len Brown <[email protected]>
> CC: Christoph Lameter <[email protected]>
> Cc: Minchan Kim <[email protected]>
> CC: Andrew Morton <[email protected]>
> CC: KOSAKI Motohiro <[email protected]>
> Signed-off-by: Yasuaki Ishimatsu <[email protected]>
> Signed-off-by: Wen Congyang <[email protected]>
> ---
>  drivers/acpi/acpi_memhotplug.c |    2 +-
>  include/linux/memory_hotplug.h |    2 +-
>  mm/memory_hotplug.c            |    6 +++---
>  3 files changed, 5 insertions(+), 5 deletions(-)

Probably, the better way is to just remove remove_memory() and use
offline_pages().

btw, current remove_memory() pfn calculation is just buggy.


> int remove_memory(u64 start, u64 size)
> {
>       unsigned long start_pfn, end_pfn;
>
>       start_pfn = PFN_DOWN(start);
>       end_pfn = start_pfn + PFN_DOWN(size);

It should be:

        start_pfn = PFN_DOWN(start);
        end_pfn = PFN_UP(start + size)

or

        start_pfn = PFN_UP(start);
        end_pfn = PFN_DOWN(start + size)
--
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/

Reply via email to