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: <20200429132940epcms5p81e75e09469b62253ff512222c568556f@epcms5p8>
Date:   Wed, 29 Apr 2020 18:59:40 +0530
From:   Vaneet Narang <v.narang@...sung.com>
To:     Michal Hocko <mhocko@...nel.org>,
        Maninder Singh <maninder1.s@...sung.com>
CC:     "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        AMIT SAHRAWAT <a.sahrawat@...sung.com>
Subject: RE:(2) [PATCH 1/1] mm/vmscan.c: change prototype for
 shrink_page_list

Hi Michal, 

>> >
>> >Acked-by: Michal Hocko <mhocko@...e.com>
>> >
>> >Is there any reason to move declarations here?
>> >
>> 
>> "unsigned int ret" was changed mistakenely, sending V2.
>> and "unsigned int nr_reclaimed" is changed to remove hole.
 
>Could you be more specific? Have you seen a better stack allocation
>footprint?

We didn't check stack allocation footprint, we did changes just by looking into the code.
we thought changing reclaimed type from long to int on 64 bit platform will add 
hole of 4 bytes between two stack variables nr_reclaimed & nr_taken.

So we tried to remove that hole by packing it with bool.

 	unsigned long nr_scanned;                 --> Size and alignment 8 byte for long 
-	unsigned long nr_reclaimed = 0;           --> Changing to int will make its size as 4  
 	unsigned long nr_taken;                   --> nr_taken needs alignment of 8 so will add hole.
 	struct reclaim_stat stat;
 	int file = is_file_lru(lru);
 	enum vm_event_item item;
 	struct pglist_data *pgdat = lruvec_pgdat(lruvec);
 	struct zone_reclaim_stat *reclaim_stat = &lruvec->reclaim_stat;
+	unsigned int nr_reclaimed = 0;            --> So moving to this place to pack it along with bool 
 	bool stalled = false;


Overall stack footprint might not change as compiler makes function stack pointer as 16 byte aligned but we did this 
as we normally follow this coding convention when defining structures or stack variables. 

Thanks & Regards,
Vaneet Narang
 
 

 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ