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: <Y3bQiDw11t4pRokP@lunn.ch>
Date:   Fri, 18 Nov 2022 01:23:36 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Umang Jain <umang.jain@...asonboard.com>
Cc:     Florian Fainelli <f.fainelli@...il.com>,
        Broadcom internal kernel review list 
        <bcm-kernel-feedback-list@...adcom.com>,
        Ray Jui <rjui@...adcom.com>, Dan Carpenter <error27@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Hans Verkuil <hverkuil-cisco@...all.nl>,
        Dave Stevenson <dave.stevenson@...pberrypi.com>,
        Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
        linux-rpi-kernel@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
        kieran.bingham@...asonboard.com
Subject: Re: [PATCH 2/3] vc04_services: mmal-vchiq: Use bool for
 vchiq_mmal_component.in_use

>  struct vchiq_mmal_component {
> -	u32 in_use:1;
> +	bool in_use:1;
>  	bool enabled:1;

The patch you referenced says:

+If a structure has many true/false values, consider consolidating them into a
+bitfield with 1 bit members, or using an appropriate fixed width type, such as
+u8.

The code did exactly this, using two bits fields, in one u32. A bool
probably takes up 4 bytes, maybe 8 bytes, so this change probably
doubles the storage size for these two fields. Are these fields on the
hot path, where an extra AND instruction would make a difference?

    Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ