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: <alpine.DEB.2.10.1508261505560.2973@chino.kir.corp.google.com>
Date:	Wed, 26 Aug 2015 15:06:39 -0700 (PDT)
From:	David Rientjes <rientjes@...gle.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
cc:	Yinghai Lu <yinghai@...nel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Tony Luck <tony.luck@...el.com>, linux-kernel@...r.kernel.org,
	stable@...r.kernel.org
Subject: Re: [PATCH v3] mm: Check if section present during memory block
 registering

On Wed, 26 Aug 2015, Andrew Morton wrote:

> Yup.  I was feeling lazy but you motivated me.
> 
> <grunt, wheeze>
> 
> --- a/drivers/base/node.c~mm-check-if-section-present-during-memory-block-registering-fix
> +++ a/drivers/base/node.c
> @@ -390,14 +390,13 @@ int register_mem_sect_under_node(struct
>  	sect_end_pfn = section_nr_to_pfn(mem_blk->end_section_nr);
>  	sect_end_pfn += PAGES_PER_SECTION - 1;
>  	for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) {
> -		int page_nid, scn_nr;
> +		int page_nid;
>  
>  		/*
>  		 * memory block could have several absent sections from start.
>  		 * skip pfn range from absent section
>  		 */
> -		scn_nr = pfn_to_section_nr(pfn);
> -		if (!present_section_nr(scn_nr)) {
> +		if (!present_section_nr(pfn_to_section_nr(pfn))) {
>  			pfn = round_down(pfn + PAGES_PER_SECTION,
>  					 PAGES_PER_SECTION) - 1;
>  			continue;

Let me get in on this simplification party.

Signed-off-by: David Rientjes <rientjes@...gle.com>
---
diff --git a/drivers/base/node.c b/drivers/base/node.c
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -396,7 +396,7 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, int nid)
 		 * memory block could have several absent sections from start.
 		 * skip pfn range from absent section
 		 */
-		if (!present_section_nr(pfn_to_section_nr(pfn))) {
+		if (!pfn_present(pfn)) {
 			pfn = round_down(pfn + PAGES_PER_SECTION,
 					 PAGES_PER_SECTION) - 1;
 			continue;
--
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