Thread (9 messages) flat view 9 messages, 2 authors, 2024-11-14

Re: [PATCH] net: skip RPS if packet is already on target CPU

From: Eric Dumazet <edumazet@google.com>
Date: 2024-10-29 19:02:20
Also in: lkml

On Tue, Oct 29, 2024 at 7:27 PM Caleb Sander Mateos
[off-list ref] wrote:
If RPS is enabled, all packets with a CPU flow hint are enqueued to the
target CPU's input_pkt_queue and process_backlog() is scheduled on that
CPU to dequeue and process the packets. If ARFS has already steered the
packets to the correct CPU, this additional queuing is unnecessary and
the spinlocks involved incur significant CPU overhead.

In netif_receive_skb_internal() and netif_receive_skb_list_internal(),
check if the CPU flow hint get_rps_cpu() returns is the current CPU. If
so, bypass input_pkt_queue and immediately process the packet(s) on the
current CPU.

Signed-off-by: Caleb Sander Mateos <redacted>
Current implementation was a conscious choice. This has been discussed
several times.

By processing packets inline, you are actually increasing latencies of
packets queued to other cpus.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help