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] [day] [month] [year] [list]
Message-ID: <20200327132722.rovaz5hghl5vhhl7@master>
Date:   Fri, 27 Mar 2020 13:27:22 +0000
From:   Wei Yang <richard.weiyang@...il.com>
To:     Jason Gunthorpe <jgg@...pe.ca>
Cc:     Wei Yang <richard.weiyang@...il.com>, akpm@...ux-foundation.org,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] mm/page_alloc.c: leverage compiler to zero out
 used_mask

On Thu, Mar 26, 2020 at 07:36:04PM -0300, Jason Gunthorpe wrote:
>On Thu, Mar 26, 2020 at 10:24:44PM +0000, Wei Yang wrote:
>> Since we always clear used_mask before getting node order, we can
>> leverage compiler to do this instead of at run time.
>> 
>> Signed-off-by: Wei Yang <richard.weiyang@...il.com>
>>  mm/page_alloc.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>> 
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index 0e823bca3f2f..2144b6ceb119 100644
>> +++ b/mm/page_alloc.c
>> @@ -5587,14 +5587,13 @@ static void build_zonelists(pg_data_t *pgdat)
>>  {
>>  	static int node_order[MAX_NUMNODES];
>>  	int node, load, nr_nodes = 0;
>> -	nodemask_t used_mask;
>> +	nodemask_t used_mask = {.bits = {0}};
>
>If this style is to be done it should just be '= {}';
>
>This case demonstrates why the popular '= {0}' idiom is not such a
>good idea, as it only works if the first member is an integral type.
>

Thanks for your comment. I think David found a better solution.

>Jason

-- 
Wei Yang
Help you, Help me

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ