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]
Date:	Mon, 28 Jul 2014 16:24:12 -0700
From:	Dave Hansen <dave.hansen@...el.com>
To:	David Rientjes <rientjes@...gle.com>
CC:	Zhang Zhen <zhenzhang.zhang@...wei.com>, shaohui.zheng@...el.com,
	mgorman@...e.de, mingo@...hat.com, Linux MM <linux-mm@...ck.org>,
	linux-kernel@...r.kernel.org, wangnan0@...wei.com,
	akpm@...ux-foundation.org
Subject: Re: [PATCH] memory hotplug: update the variables after memory removed

On 07/28/2014 04:12 PM, David Rientjes wrote:
> I agree, but I'm not sure the suggestion is any better than the patch.  I 
> think it would be better to just figure out whether anything needs to be 
> updated in the caller and then call a generic function.
> 
> So in arch_add_memory(), do
> 
> 	end_pfn = PFN_UP(start + size);
> 	if (end_pfn > max_pfn)
> 		update_end_of_memory_vars(end_pfn);
> 
> and in arch_remove_memory(),
> 
> 	end_pfn = PFN_UP(start);
> 	if (end_pfn < max_pfn)
> 		update_end_of_memory_vars(end_pfn);
> 
> and then update_end_of_memory_vars() becomes a three-liner.

That does look better than my suggestion, generally.

It is broken in the remove case, though.  In your example, the memory
being removed is assumed to be coming from the end of memory, and that
isn't always the case.  I think you need something like:

	if ((max_pfn >= start_pfn) && (max_pfn < end_pfn)
		update_end_of_memory_vars(start);

But, yeah, that's a lot better than new functions.
--
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