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: <20181112061337.GG21824@bombadil.infradead.org>
Date:   Sun, 11 Nov 2018 22:13:37 -0800
From:   Matthew Wilcox <willy@...radead.org>
To:     Arun KS <arunks@...eaurora.org>
Cc:     keescook@...omium.org, khlebnikov@...dex-team.ru,
        minchan@...nel.org, getarunks@...il.com,
        gregkh@...uxfoundation.org, akpm@...ux-foundation.org,
        mhocko@...nel.org, vbabka@...e.cz, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org, vatsa@...eaurora.org
Subject: Re: [PATCH v4 1/4] mm: reference totalram_pages and managed_pages
 once per function

On Mon, Nov 12, 2018 at 11:37:46AM +0530, Arun KS wrote:
> +++ b/arch/um/kernel/mem.c
> @@ -51,8 +51,7 @@ void __init mem_init(void)
>  
>  	/* this will put all low memory onto the freelists */
>  	memblock_free_all();
> -	max_low_pfn = totalram_pages;
> -	max_pfn = totalram_pages;
> +	max_pfn = max_low_pfn = totalram_pages;

We don't normally do "a = b = c".  How about:

 	max_low_pfn = totalram_pages;
-	max_pfn = totalram_pages;
+	max_pfn = max_low_pfn;

> +++ b/arch/x86/kernel/cpu/microcode/core.c
> @@ -434,9 +434,10 @@ static ssize_t microcode_write(struct file *file, const char __user *buf,
>  			       size_t len, loff_t *ppos)
>  {
>  	ssize_t ret = -EINVAL;
> +	unsigned long totalram_pgs = totalram_pages;

Can't we use a better variable name here?  Even nr_pages would look
better to me.

> +++ b/drivers/hv/hv_balloon.c
> +	unsigned long totalram_pgs = totalram_pages;

Ditto

> +++ b/fs/file_table.c
> +	unsigned long totalram_pgs = totalram_pages;

... throughout, I guess.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ