All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com, fw@strlen.de
Subject: Re: [PATCH net-next 4/5] net: skbuff: push nf_trace down the bitfield
Date: Sun, 16 Apr 2023 21:12:21 -0700	[thread overview]
Message-ID: <20230416211221.4650013f@kernel.org> (raw)
In-Reply-To: <ZDpg14bxJMcimOya@calendula>

On Sat, 15 Apr 2023 10:31:19 +0200 Pablo Neira Ayuso wrote:
> On Fri, Apr 14, 2023 at 09:01:04AM -0700, Jakub Kicinski wrote:
> > nf_trace is a debug feature, AFAIU, and yet it sits oddly
> > high in the sk_buff bitfield. Move it down, pushing up
> > dst_pending_confirm and inner_protocol_type.
> > 
> > Next change will make nf_trace optional (under Kconfig)
> > and all optional fields should be placed after 2b fields
> > to avoid 2b fields straddling bytes.
> > 
> > dst_pending_confirm is L3, so it makes sense next to ignore_df.
> > inner_protocol_type goes up just to keep the balance.  
> 
> Well, yes, this is indeed a debug feature.
> 
> But if only one single container enables debugging, this cache line
> will be visited very often. The debugging infrastructure is guarded
> under a static_key, which is global.

I wasn't thinking about cacheline placement, really, although you're
right, under some custom configs it may indeed push the bit from the
second to the third cache line.

The problem is that I can't make the bit optional if it sits this far
up in the bitfield because (as mentioned) 2 bit fields start to
straddle bytes. And that leads to holes.

WiFi is a bit lucky because it has 2 bits and largest fields are also 
2b so it can't cause straddling when Kconfig'ed out.

  reply	other threads:[~2023-04-17  4:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230416211221.4650013f@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.