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: <ccee8f63-f5dd-6231-5625-a67ad3b80a6d@oracle.com>
Date:   Sun, 3 Oct 2021 19:36:54 -0700
From:   Mike Kravetz <mike.kravetz@...cle.com>
To:     Matthew Wilcox <willy@...radead.org>,
        Nghia Le <nghialm78@...il.com>
Cc:     akpm@...ux-foundation.org, nathan@...nel.org,
        ndesaulniers@...gle.com, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
        lukas.bulwahn@...il.com, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] mm/hugetlb.c: remove dead store in demote_size_show()

On 10/3/21 6:54 AM, Matthew Wilcox wrote:
> On Sun, Oct 03, 2021 at 06:41:13PM +0700, Nghia Le wrote:
>>  {
>>  	struct hstate *h;
>> -	unsigned long demote_size;
>>  	int nid;
>>  
>>  	h = kobj_to_hstate(kobj, &nid);
>> -	demote_size = h->demote_order;
>>  
>>  	return sysfs_emit(buf, "%lukB\n",
>>  			(unsigned long)(PAGE_SIZE << h->demote_order) / SZ_1K);
> 
> I'd suggest this function would look better written as:
> 
> 	int nid;
> 	struct hstate *h = kobj_to_hstate(kobj, &nid);
> 	unsigned long demote_size = (PAGE_SIZE << h->demote_order) / SZ_1K;
> 
> 	return sysfs_emit(buf, "%lukB\n", demote_size);
> 

Thank you Nghia Le for spotting this, and thank you Matthew for the
suggestion.

This is still just in Andrew's tree and subject to modification before
the next merge window.  I am still expecting additional comments on the
series.

If another version of the series is needed, I will include Matthew's
suggestion.   If not, I will ask Andrew how he would prefer to fold in
the changes.
-- 
Mike Kravetz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ