mptcp icon indicating copy to clipboard operation
mptcp copied to clipboard

Reduce size of skb->cb

Open cpaasch opened this issue 9 years ago • 8 comments

When moving to v4.1 we had to increase the size of skb->cb to 56 bytes. This is unacceptable for upstreaming. We need to bring it back down to 48 bytes.

cpaasch avatar Oct 23 '16 17:10 cpaasch

This is interesting. Where can I find skb->cb?

Note: No idea if I can help or not, but I'd love to have a look.

I searched the codebase and found many files referencing combinations of skb and cb. One file needs changing, or many?

faddat avatar Nov 26 '16 17:11 faddat

@faddat skb->cb is in struct sk_buff. We had to increase it from 48 bytes to 56 bytes, to accomodate for the MPTCP-specific fields in struct tcp_skb_cb

Reducing it back to 48 will probably need some major rework.

cpaasch avatar Nov 27 '16 21:11 cpaasch

@faddat - looking more into it, it can probably easily be done by reordering some fields, as we introduced a hole in the struct tcp_skb_cb. You can check with pahole to see if that works.

cpaasch avatar Nov 27 '16 21:11 cpaasch

@faddat And it's me again :)

Actually, seems like we can just reduce the size down to 48 bytes again in struct sk_buff. If you want, you can submit a patch. Please compile-test with IPv6 and Mobile-IPv6 enabled.

cpaasch avatar Nov 27 '16 22:11 cpaasch

@cpaasch - it's not clear for me why you increased the size of the cb from 44 to 48 bytes (before 4.1) then you increased it to 56 bytes (due to 744d5a3e9fe26). Could you explain a bit?

Before 4.1: The dss option need 24 bytes (u32 dss[6]) and it's inside a double union that's already accommodating 16 bytes (struct inet6_skb_parm h6). The cb size should increase with 8 bytes, shouldn't it?

Thanks!

doru91 avatar Mar 03 '17 21:03 doru91

At least, when I test-compiled it with mobile-IPv6-enabled I don't think I got an error. You can maybe just try out whith allyesmod. If it compiles, then 48 is fine.

cpaasch avatar Mar 03 '17 23:03 cpaasch

May I know why it "is unacceptable for upstreaming"?

BigNerd95 avatar Feb 24 '18 08:02 BigNerd95

Increasing the size of the skb slows down the networking stack because accessing fields of the skb will incur additional cacheline misses. The upstream community is trying to minimize the cache misses as much as possible.

cpaasch avatar Feb 24 '18 16:02 cpaasch