Skip to content

RFC shrink skb cb to 44 bytes

Florian Westphal dccp linux-wireless netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest14 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14net: gro: shrink napi_gro_cb to fit into hypothetical 44-byte sized skb cbinclude/linux/netdevice.h+13 -150 replies
2/14net: sched: reduce qdisc size to 24 byteinclude/net/sch_generic.h net/sched/sch_sfq.c+25 -60 replies
3/14ipv6: use flag instead of u16 for hop in inet6_skb_parminclude/linux/ipv6.h net/ipv6/af_inet6.c net/ipv6/datagram.c +1 more+8 -80 replies
4/14drivers: wireless: rt2x00: move skb_dma to queue entrydrivers/net/wireless/rt2x00/rt2400pci.c drivers/net/wireless/rt2x00/rt2500pci.c drivers/net/wireless/rt2x00/rt2800mmio.c +3 more+22 -270 replies
5/14drivers: wireless: ar5523: use container_ofdrivers/net/wireless/ath/ar5523/ar5523.c drivers/net/wireless/ath/ar5523/ar5523.h+4 -51 reply
6/14drivers: wireless: carl9170: shrink carl9170_tx_infodrivers/net/wireless/ath/carl9170/carl9170.h drivers/net/wireless/ath/carl9170/debug.c drivers/net/wireless/ath/carl9170/tx.c+20 -80 replies
7/14net: wireless: iwlwifi: shrink status private areadrivers/net/wireless/iwlwifi/mvm/rs.c drivers/net/wireless/iwlwifi/mvm/tx.c include/net/mac80211.h+5 -70 replies
8/14net: wireless: mac80211: shrink ieee80211_tx_infoinclude/net/mac80211.h net/mac80211/main.c+11 -34 replies
9/14net: wireless: mac80211: shrink private driver areadrivers/net/wireless/ath/ath9k/ath9k.h include/net/mac80211.h+4 -61 reply
10/14dccp: keep failed options on stackinclude/linux/dccp.h net/dccp/dccp.h net/dccp/input.c +5 more+97 -610 replies
11/14dccp: reduce size of dccp_skb_cb to 40 bytesnet/dccp/dccp.h+7 -70 replies
12/14rxrpc: use 32bit jiffies on 64bit platforms, toonet/rxrpc/ar-ack.c net/rxrpc/ar-internal.h net/rxrpc/ar-output.c+51 -310 replies
13/14net: tcp: don't assert sock_skb_cb_check_sizenet/ipv4/tcp.c+2 -10 replies
14/14net: introduce and use KERNEL_MAX_HEADER_PARSE_ADDRLENdrivers/firewire/net.c drivers/net/wireless/airo.c drivers/net/wireless/hostap/hostap_main.c +5 more+19 -12 replies

Reviews trailers per patch

None of the 14 patches has a Reviewed-by or Acked-by.

PatchPontus Fuchs
1/14
2/14
3/14
4/14
5/14T-b
6/14
7/14
8/14
9/14
10/14
11/14
12/14
13/14
14/14

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH RFC 00/14] shrink skb cb to 44 bytes

Following patches shrink all in-tree users of skb->cb[] so that kernel still builds with skb->cb[] set to 44 bytes.

This would create a 4-byte hole, it would be easy to reorder skb members so this hole is filled.

pahole dump for vmlinux with allyesconfig (+this patch series):

http://www.strlen.de/fw/pahole.txt.gz

remarks/known issues:
- adds __packet attribute to a few structures.
Its needed to not have padding at end of the structure, else we get build assertion errors even if all members fit into cb[].
- checkpatch isn't happy yet.
- dccp changes are untested (its on my todo list)
- rxrpc change is untested (on todo list).
- wireless changes are untested, I don't own any of the affected hw.

The idea is to figure out what needs to be done to make build_skb() and friends only touch the first 3 cachelines of the skb on all architectures.

We'd need to reduce skbuff by 40 bytes to achieve this for allyesconfig.

Other sk_buff reduction ideas being worked:

- move truesize to shinfo (which has 4 byte hole)
- turn ->data into offset on 64bit platforms (intrusive, > 1000 files affected)
- move pointers that are ususally not needed (nf_bridge, secpath) to the end, with flag field that tells us when pointer is valid (so we don't have to memset() them unconditionally at allocation time).
- seems we could already to this for the inner header fields since the're only valid once ->encapsulation / inner_protocol_type is set.

Comments and more ideas welcome.