lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHGf_=pdVLEkGDvbMC7vjd0F8Y_YFdKX85YcLwR+gCQ8Tf2Mcw@mail.gmail.com>
Date:	Thu, 4 Oct 2012 17:31:26 -0400
From:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To:	Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>
Cc:	x86@...nel.org, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	linux-acpi@...r.kernel.org, rientjes@...gle.com, liuj97@...il.com,
	len.brown@...el.com, cl@...ux.com, minchan.kim@...il.com,
	akpm@...ux-foundation.org, wency@...fujitsu.com
Subject: Re: [PATCH 2/4] acpi,memory-hotplug : rename remove_memory() to offline_memory()

On Wed, Oct 3, 2012 at 6:02 AM, Yasuaki Ishimatsu
<isimatu.yasuaki@...fujitsu.com> wrote:
> From: Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>
>
> 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 <rientjes@...gle.com>
> CC: Jiang Liu <liuj97@...il.com>
> CC: Len Brown <len.brown@...el.com>
> CC: Christoph Lameter <cl@...ux.com>
> Cc: Minchan Kim <minchan.kim@...il.com>
> CC: Andrew Morton <akpm@...ux-foundation.org>
> CC: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>
> Signed-off-by: Wen Congyang <wency@...fujitsu.com>
> ---
>  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 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

Powered by Openwall GNU/*/Linux Powered by OpenVZ