diff options
author | Vincent Mailhol <mailhol@kernel.org> | 2025-09-17 13:48:24 +0900 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2025-09-19 20:56:34 +0200 |
commit | fc8418eca43d5872e3976636d7c4924094bd07fd (patch) | |
tree | beee5d97a3b86446b800f0cd086a66b690920595 /rust/helpers/page.c | |
parent | 2c9684bfee9476ef5038fe44d96464c632358fbc (diff) |
can: raw: reorder struct uniqframe's members to optimise packing
struct uniqframe has one hole. Reorder the fields to save 8 bytes.
Statistics before:
$ pahole --class_name=uniqframe net/can/raw.o
struct uniqframe {
int skbcnt; /* 0 4 */
/* XXX 4 bytes hole, try to pack */
const struct sk_buff * skb; /* 8 8 */
unsigned int join_rx_count; /* 16 4 */
/* size: 24, cachelines: 1, members: 3 */
/* sum members: 16, holes: 1, sum holes: 4 */
/* padding: 4 */
/* last cacheline: 24 bytes */
};
...and after:
$ pahole --class_name=uniqframe net/can/raw.o
struct uniqframe {
const struct sk_buff * skb; /* 0 8 */
int skbcnt; /* 8 4 */
unsigned int join_rx_count; /* 12 4 */
/* size: 16, cachelines: 1, members: 3 */
/* last cacheline: 16 bytes */
};
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Link: https://patch.msgid.link/20250917-can-raw-repack-v2-1-395e8b3a4437@kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'rust/helpers/page.c')
0 files changed, 0 insertions, 0 deletions