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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 9 Aug 2019 14:39:59 +0530
From:   Anshuman Khandual <anshuman.khandual@....com>
To:     Wei Yang <richardw.yang@...ux.intel.com>,
        akpm@...ux-foundation.org, osalvador@...e.de,
        pasha.tatashin@...cle.com, mhocko@...e.com
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/sparse: use __nr_to_section(section_nr) to get
 mem_section



On 08/09/2019 06:32 AM, Wei Yang wrote:
> __pfn_to_section is defined as __nr_to_section(pfn_to_section_nr(pfn)).

Right.

> 
> Since we already get section_nr, it is not necessary to get mem_section
> from start_pfn. By doing so, we reduce one redundant operation.
> 
> Signed-off-by: Wei Yang <richardw.yang@...ux.intel.com>

Looks right.

With this applied, memory hot add still works on arm64.

Reviewed-by: Anshuman Khandual <anshuman.khandual@....com>

> ---
>  mm/sparse.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/sparse.c b/mm/sparse.c
> index 72f010d9bff5..95158a148cd1 100644
> --- a/mm/sparse.c
> +++ b/mm/sparse.c
> @@ -867,7 +867,7 @@ int __meminit sparse_add_section(int nid, unsigned long start_pfn,
>  	 */
>  	page_init_poison(pfn_to_page(start_pfn), sizeof(struct page) * nr_pages);
>  
> -	ms = __pfn_to_section(start_pfn);
> +	ms = __nr_to_section(section_nr);
>  	set_section_nid(section_nr, nid);
>  	section_mark_present(ms);
>  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ