]> asedeno.scripts.mit.edu Git - linux.git/commit
bpf: cpumap use ptr_ring_consume_batched
authorJesper Dangaard Brouer <brouer@redhat.com>
Fri, 12 Apr 2019 15:07:32 +0000 (17:07 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 18 Apr 2019 02:09:24 +0000 (19:09 -0700)
commit77361825bb01ecadf3ac8622e2e4dbc28806e858
treec521a9c061e9cc31281cc613cb9ed7b11e517286
parent00967e84f742f87603e769529628e32076ade188
bpf: cpumap use ptr_ring_consume_batched

Move ptr_ring dequeue outside loop, that allocate SKBs and calls network
stack, as these operations that can take some time. The ptr_ring is a
communication channel between CPUs, where we want to reduce/limit any
cacheline bouncing.

Do a concentrated bulk dequeue via ptr_ring_consume_batched, to shorten the
period and times the remote cacheline in ptr_ring is read

Batch size 8 is both to (1) limit BH-disable period, and (2) consume one
cacheline on 64-bit archs. After reducing the BH-disable section further
then we can consider changing this, while still thinking about L1 cacheline
size being active.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/cpumap.c