diff mbox series

[bpf-next,1/3] dev: Move received_rps counter next to RPS members in softnet data

Message ID 20220818165906.64450-2-toke@redhat.com (mailing list archive)
State Changes Requested
Delegated to: BPF
Headers show
Series A couple of small refactorings of BPF program call sites | expand

Checks

Context Check Description
bpf/vmtest-bpf-next-PR fail PR summary
netdev/tree_selection success Clearly marked for bpf-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 445444 this patch: 445444
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 1067 this patch: 1067
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 466748 this patch: 466748
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-VM_Test-3 fail Logs for Kernel LATEST on z15 with gcc
bpf/vmtest-bpf-next-VM_Test-4 success Logs for llvm-toolchain
bpf/vmtest-bpf-next-VM_Test-5 success Logs for set-matrix
bpf/vmtest-bpf-next-VM_Test-2 fail Logs for Kernel LATEST on ubuntu-latest with llvm-16
bpf/vmtest-bpf-next-VM_Test-1 success Logs for Kernel LATEST on ubuntu-latest with gcc

Commit Message

Toke Høiland-Jørgensen Aug. 18, 2022, 4:59 p.m. UTC
Move the received_rps counter value next to the other RPS-related members
in softnet_data. This closes two four-byte holes in the structure, making
room for another pointer in the first two cache lines without bumping the
xmit struct to its own line.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
---
 include/linux/netdevice.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jakub Kicinski Aug. 19, 2022, 3:01 a.m. UTC | #1
On Thu, 18 Aug 2022 18:59:03 +0200 Toke Høiland-Jørgensen wrote:
> Move the received_rps counter value next to the other RPS-related members
> in softnet_data. This closes two four-byte holes in the structure, making
> room for another pointer in the first two cache lines without bumping the
> xmit struct to its own line.

What's the pointer you're making space for (which I hope will explain
why this patch is part of this otherwise bpf series)?
Toke Høiland-Jørgensen Aug. 19, 2022, 12:38 p.m. UTC | #2
Jakub Kicinski <kuba@kernel.org> writes:

> On Thu, 18 Aug 2022 18:59:03 +0200 Toke Høiland-Jørgensen wrote:
>> Move the received_rps counter value next to the other RPS-related members
>> in softnet_data. This closes two four-byte holes in the structure, making
>> room for another pointer in the first two cache lines without bumping the
>> xmit struct to its own line.
>
> What's the pointer you're making space for (which I hope will explain
> why this patch is part of this otherwise bpf series)?

The XDP queueing series adds a pointer to keep track of which interfaces
were scheduled for transmission using the XDP dequeue hook (similar to
how the qdisc wake code works):

https://lore.kernel.org/r/20220713111430.134810-12-toke@redhat.com

Note that it's still up in the air if this ends up being the way this
will be implemented, so I'm OK with dropping this patch for now if you'd
rather wait until it's really needed. OTOH it also seemed like a benign
change on its own, so I figured I might as well include this patch when
sending these out. WDYT?

-Toke
Jakub Kicinski Aug. 19, 2022, 10:54 p.m. UTC | #3
On Fri, 19 Aug 2022 14:38:14 +0200 Toke Høiland-Jørgensen wrote:
> Jakub Kicinski <kuba@kernel.org> writes:
> > On Thu, 18 Aug 2022 18:59:03 +0200 Toke Høiland-Jørgensen wrote:  
> >> Move the received_rps counter value next to the other RPS-related members
> >> in softnet_data. This closes two four-byte holes in the structure, making
> >> room for another pointer in the first two cache lines without bumping the
> >> xmit struct to its own line.  
> >
> > What's the pointer you're making space for (which I hope will explain
> > why this patch is part of this otherwise bpf series)?  
> 
> The XDP queueing series adds a pointer to keep track of which interfaces
> were scheduled for transmission using the XDP dequeue hook (similar to
> how the qdisc wake code works):
> 
> https://lore.kernel.org/r/20220713111430.134810-12-toke@redhat.com

I see, it makes more sense now :)

> Note that it's still up in the air if this ends up being the way this
> will be implemented, so I'm OK with dropping this patch for now if you'd
> rather wait until it's really needed. OTOH it also seemed like a benign
> change on its own, so I figured I might as well include this patch when
> sending these out. WDYT?

Whatever is easiest :)
Toke Høiland-Jørgensen Aug. 22, 2022, 10:17 a.m. UTC | #4
Jakub Kicinski <kuba@kernel.org> writes:

> On Fri, 19 Aug 2022 14:38:14 +0200 Toke Høiland-Jørgensen wrote:
>> Jakub Kicinski <kuba@kernel.org> writes:
>> > On Thu, 18 Aug 2022 18:59:03 +0200 Toke Høiland-Jørgensen wrote:  
>> >> Move the received_rps counter value next to the other RPS-related members
>> >> in softnet_data. This closes two four-byte holes in the structure, making
>> >> room for another pointer in the first two cache lines without bumping the
>> >> xmit struct to its own line.  
>> >
>> > What's the pointer you're making space for (which I hope will explain
>> > why this patch is part of this otherwise bpf series)?  
>> 
>> The XDP queueing series adds a pointer to keep track of which interfaces
>> were scheduled for transmission using the XDP dequeue hook (similar to
>> how the qdisc wake code works):
>> 
>> https://lore.kernel.org/r/20220713111430.134810-12-toke@redhat.com
>
> I see, it makes more sense now :)
>
>> Note that it's still up in the air if this ends up being the way this
>> will be implemented, so I'm OK with dropping this patch for now if you'd
>> rather wait until it's really needed. OTOH it also seemed like a benign
>> change on its own, so I figured I might as well include this patch when
>> sending these out. WDYT?
>
> Whatever is easiest :)

Alright, I'm OK with either so let's leave it up to the (BPF)
maintainers if they want to drop this patch or just merge the whole
series? :)

-Toke
diff mbox series

Patch

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 1a3cb93c3dcc..fe9aeca2fce9 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3100,7 +3100,6 @@  struct softnet_data {
 	/* stats */
 	unsigned int		processed;
 	unsigned int		time_squeeze;
-	unsigned int		received_rps;
 #ifdef CONFIG_RPS
 	struct softnet_data	*rps_ipi_list;
 #endif
@@ -3133,6 +3132,7 @@  struct softnet_data {
 	unsigned int		cpu;
 	unsigned int		input_queue_tail;
 #endif
+	unsigned int		received_rps;
 	unsigned int		dropped;
 	struct sk_buff_head	input_pkt_queue;
 	struct napi_struct	backlog;