[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B71DC@saturn3.aculab.com>
Date: Wed, 17 Apr 2013 09:43:45 +0100
From: "David Laight" <David.Laight@...LAB.COM>
To: "Daniel Borkmann" <dborkman@...hat.com>, <davem@...emloft.net>
Cc: <netdev@...r.kernel.org>, <linux-sctp@...r.kernel.org>
Subject: RE: [PATCH net-next 4/9] net: sctp: sctp_outq: consolidate chars into bitfield
> __u32 outstanding_bytes;
>
> - /* Are we doing fast-rtx on this queue */
> - char fast_rtx;
> -
> - /* Corked? */
> - char cork;
> -
> - /* Is this structure empty? */
> - char empty;
> + __u8 fast_rtx:1, /* Are we doing fast-rtx on this queue */
> + cork:1, /* Corked? */
> + empty:1; /* Is this structure empty? */
> };
Use of bitfields just makes the code slower.
The only real excuse for using them is to reduce the size
of a structure that is allocated a lot.
In the above you are just increasing the padding from
1 byte to 3 bytes.
David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists