netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/5] net: skbuff: hide some bitfield members
@ 2023-04-14 16:01 Jakub Kicinski
  2023-04-14 16:01 ` [PATCH net-next 1/5] net: skbuff: hide wifi_acked when CONFIG_WIRELESS not set Jakub Kicinski
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Jakub Kicinski @ 2023-04-14 16:01 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski

There is a number of protocol or subsystem specific fields
in struct sk_buff which are only accessed by one subsystem.
We can wrap them in ifdefs with minimal code impact.

This gives us a better chance to save a 2B and a 4B holes
resulting with the following savings (assuming a lucky
kernel config):

-	/* size: 232, cachelines: 4, members: 28 */
-	/* sum members: 227, holes: 1, sum holes: 4 */
-	/* sum bitfield members: 8 bits (1 bytes) */
+	/* size: 224, cachelines: 4, members: 28 */
 	/* forced alignments: 2 */
-	/* last cacheline: 40 bytes */
+	/* last cacheline: 32 bytes */

I think that the changes shouldn't be too controversial.
The only one I'm not 100% sure of is the SCTP one,
12 extra LoC for one bit.. But it did fit squarely
in the "this bit has only one user" category.

Jakub Kicinski (5):
  net: skbuff: hide wifi_acked when CONFIG_WIRELESS not set
  net: skbuff: hide csum_not_inet when CONFIG_IP_SCTP not set
  net: skbuff: move alloc_cpu into a potential hole
  net: skbuff: push nf_trace down the bitfield
  net: skbuff: hide nf_trace and ipvs_property

 include/linux/skbuff.h | 38 ++++++++++++++++++++++++++++++++++----
 include/net/sock.h     |  2 +-
 net/core/dev.c         |  3 +--
 net/core/skbuff.c      |  2 ++
 net/sched/act_csum.c   |  3 +--
 net/socket.c           |  2 ++
 6 files changed, 41 insertions(+), 9 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2023-04-17 12:10 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-14 16:01 [PATCH net-next 0/5] net: skbuff: hide some bitfield members Jakub Kicinski
2023-04-14 16:01 ` [PATCH net-next 1/5] net: skbuff: hide wifi_acked when CONFIG_WIRELESS not set Jakub Kicinski
2023-04-14 17:46   ` Florian Fainelli
2023-04-14 16:01 ` [PATCH net-next 2/5] net: skbuff: hide csum_not_inet when CONFIG_IP_SCTP " Jakub Kicinski
2023-04-14 17:47   ` Florian Fainelli
2023-04-14 16:01 ` [PATCH net-next 3/5] net: skbuff: move alloc_cpu into a potential hole Jakub Kicinski
2023-04-14 17:51   ` Florian Fainelli
2023-04-14 16:01 ` [PATCH net-next 4/5] net: skbuff: push nf_trace down the bitfield Jakub Kicinski
2023-04-14 17:50   ` Florian Fainelli
2023-04-14 21:06   ` Florian Westphal
2023-04-15  8:31   ` Pablo Neira Ayuso
2023-04-17  4:12     ` Jakub Kicinski
2023-04-14 16:01 ` [PATCH net-next 5/5] net: skbuff: hide nf_trace and ipvs_property Jakub Kicinski
2023-04-14 17:50   ` Florian Fainelli
2023-04-14 21:09   ` Florian Westphal
2023-04-14 22:07     ` Jakub Kicinski
2023-04-14 23:11       ` Florian Westphal
2023-04-15  0:44         ` Jakub Kicinski
2023-04-15  0:32   ` kernel test robot
2023-04-15  0:43   ` kernel test robot
2023-04-17 12:09   ` Simon Horman
2023-04-15 11:53 ` [PATCH net-next 0/5] net: skbuff: hide some bitfield members Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).