Thread (10 messages) read the whole thread 10 messages, 2 authors, 2021-01-15

Re: [PATCH bpf-next v8 1/3] bpf: remove extra lock_sock for TCP_ZEROCOPY_RECEIVE

From: Alexei Starovoitov <hidden>
Date: 2021-01-15 03:28:32
Also in: bpf

On Wed, Jan 13, 2021 at 1:33 PM Stanislav Fomichev [off-list ref] wrote:
Add custom implementation of getsockopt hook for TCP_ZEROCOPY_RECEIVE.
We skip generic hooks for TCP_ZEROCOPY_RECEIVE and have a custom
call in do_tcp_getsockopt using the on-stack data. This removes
3% overhead for locking/unlocking the socket.

Without this patch:
     3.38%     0.07%  tcp_mmap  [kernel.kallsyms]  [k] __cgroup_bpf_run_filter_getsockopt
            |
             --3.30%--__cgroup_bpf_run_filter_getsockopt
                       |
                        --0.81%--__kmalloc

With the patch applied:
     0.52%     0.12%  tcp_mmap  [kernel.kallsyms]  [k] __cgroup_bpf_run_filter_getsockopt_kern

Signed-off-by: Stanislav Fomichev <redacted>
Cc: Martin KaFai Lau <redacted>
Cc: Song Liu <redacted>
Cc: Eric Dumazet <edumazet@google.com>
Acked-by: Martin KaFai Lau <redacted>
Few issues in this patch and the patch 2 doesn't apply:
Switched to a new branch 'tmp'
Applying: bpf: Remove extra lock_sock for TCP_ZEROCOPY_RECEIVE
.git/rebase-apply/patch:295: trailing whitespace.
#endif
.git/rebase-apply/patch:306: trailing whitespace.
union tcp_word_hdr {
.git/rebase-apply/patch:309: trailing whitespace.
};
.git/rebase-apply/patch:311: trailing whitespace.
#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
.git/rebase-apply/patch:313: trailing whitespace.
enum {
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.
Applying: bpf: Try to avoid kzalloc in cgroup/{s,g}etsockopt
error: patch failed: kernel/bpf/cgroup.c:1390
error: kernel/bpf/cgroup.c: patch does not apply
Patch failed at 0002 bpf: Try to avoid kzalloc in cgroup/{s,g}etsockopt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help