From: Wan Jiabing <wanjiabing@vivo.com>
To: Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
Yonghong Song <yhs@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
netdev@vger.kernel.org, bpf@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Wan Jiabing <wanjiabing@vivo.com>
Subject: [PATCH 0/3] bpf: optimize the bpf_kprobe_multi_link_attach function
Date: Thu, 12 May 2022 22:17:07 +0800 [thread overview]
Message-ID: <20220512141710.116135-1-wanjiabing@vivo.com> (raw)
This patch series tries to optimize the bpf_kporbe_multi_link_attach
in bpf_trace.c
Firstly, there is only one 'error' tag to handle error code. But in one
'error' tag, there are three 'free' functions which is not efficient. So
I split this one tag to three tags to make it clear.
Secondly, I simplify double 'if' statements to one statement.
Finally, coccicheck reports an opportunity for vmemdup_user. So I use
vmemdup_user to make code cleaner.
Wan Jiabing (3):
bpf: use 'error_xxx' tags in bpf_kprobe_multi_link_attach
bpf: simplify if-if to if in bpf_kprobe_multi_link_attach
bpf: use vmemdup_user instead of kvmalloc and copy_from_user
kernel/trace/bpf_trace.c | 34 +++++++++++++++-------------------
1 file changed, 15 insertions(+), 19 deletions(-)
--
2.35.1
next reply other threads:[~2022-05-12 14:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 14:17 Wan Jiabing [this message]
2022-05-12 14:17 ` [PATCH 1/3] bpf: use 'error_xxx' tags in bpf_kprobe_multi_link_attach Wan Jiabing
2022-05-12 16:40 ` Song Liu
2022-05-12 17:05 ` David Vernet
2022-05-12 14:17 ` [PATCH 2/3] bpf: simplify if-if to if " Wan Jiabing
2022-05-12 16:44 ` Song Liu
2022-05-12 14:17 ` [PATCH 3/3] bpf: use vmemdup_user instead of kvmalloc and copy_from_user Wan Jiabing
2022-05-12 16:45 ` Song Liu
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=20220512141710.116135-1-wanjiabing@vivo.com \
--to=wanjiabing@vivo.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®