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] [day] [month] [year] [list]
Message-ID: <1369327533.5673.75.camel@misato.fc.hp.com>
Date:	Thu, 23 May 2013 10:45:33 -0600
From:	Toshi Kani <toshi.kani@...com>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Wen Congyang <wency@...fujitsu.com>,
	Tang Chen <tangchen@...fujitsu.com>,
	Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jiang Liu <liuj97@...il.com>,
	Vasilis Liaskovitis <vasilis.liaskovitis@...fitbricks.com>,
	linux-mm@...ck.org
Subject: Re: [PATCH *5/5] Memory hotplug / ACPI: Simplify memory removal
 (was: Re: [PATCH 5/5] ACPI / memhotplug: Drop unnecessary code)

On Thu, 2013-05-23 at 00:09 +0200, Rafael J. Wysocki wrote:
> On Monday, May 20, 2013 01:55:33 PM Toshi Kani wrote:
> > On Mon, 2013-05-20 at 21:47 +0200, Rafael J. Wysocki wrote:
> > > On Monday, May 20, 2013 11:27:56 AM Toshi Kani wrote:
> > > > On Sun, 2013-05-19 at 01:34 +0200, Rafael J. Wysocki wrote:
> > > > > From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> > 
> >  :
> > 
> > > > > -	lock_memory_hotplug();
> > > > > -
> > > > > -	/*
> > > > > -	 * we have offlined all memory blocks like this:
> > > > > -	 *   1. lock memory hotplug
> > > > > -	 *   2. offline a memory block
> > > > > -	 *   3. unlock memory hotplug
> > > > > -	 *
> > > > > -	 * repeat step1-3 to offline the memory block. All memory blocks
> > > > > -	 * must be offlined before removing memory. But we don't hold the
> > > > > -	 * lock in the whole operation. So we should check whether all
> > > > > -	 * memory blocks are offlined.
> > > > > -	 */
> > > > > -
> > > > > -	ret = walk_memory_range(start_pfn, end_pfn, NULL,
> > > > > -				is_memblock_offlined_cb);
> > > > > -	if (ret) {
> > > > > -		unlock_memory_hotplug();
> > > > > -		return ret;
> > > > > -	}
> > > > > -
> > > > 
> > > > I think the above procedure is still useful for safe guard.
> > > 
> > > But then it shoud to BUG_ON() instead of returning an error (which isn't very
> > > useful for anything now).
> > 
> > Right since we cannot fail at that state.
> > 
> > > > > -	/* remove memmap entry */
> > > > > -	firmware_map_remove(start, start + size, "System RAM");
> > > > > -
> > > > > -	arch_remove_memory(start, size);
> > > > > -
> > > > > -	try_offline_node(nid);
> > > > 
> > > > The above procedure performs memory hot-delete specific operations and
> > > > is necessary.
> > > 
> > > OK, I see.  I'll replace this patch with something simpler, then.
> > 
> > Thanks.
> 
> The replacement patch is appended.

The updated patch looks good.

Reviewed-by: Toshi Kani <toshi.kani@...com>

Thanks,
-Toshi


> 
> Thanks,
> Rafael
> 
> ---
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> Subject: Memory hotplug / ACPI: Simplify memory removal
> 
> Now that the memory offlining should be taken care of by the
> companion device offlining code in acpi_scan_hot_remove(), the
> ACPI memory hotplug driver doesn't need to offline it in
> remove_memory() any more.  Moreover, since the return value of
> remove_memory() is not used, it's better to make it be a void
> function and trigger a BUG() if the memory scheduled for removal is
> not offline.
> 
> Change the code in accordance with the above observations.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
>  drivers/acpi/acpi_memhotplug.c |   13 +------
>  include/linux/memory_hotplug.h |    2 -
>  mm/memory_hotplug.c            |   71 ++++-------------------------------------
>  3 files changed, 12 insertions(+), 74 deletions(-)



--
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