From: Song Liu <songliubraving@fb.com>
To: Alexei Starovoitov <ast@fb.com>
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Network Development <netdev@vger.kernel.org>,
bpf <bpf@vger.kernel.org>, Kernel Team <Kernel-team@fb.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@chromium.org>
Subject: Re: [PATCH v2 bpf-next] bpf: fix raw_tp test run in preempt kernel
Date: Wed, 30 Sep 2020 15:48:13 +0000 [thread overview]
Message-ID: <8EFE87FC-84D2-4B63-B057-804A6F9F1F63@fb.com> (raw)
In-Reply-To: <09b5c318-afb3-2c3a-1b2f-936eb1b9b32b@fb.com>
> On Sep 30, 2020, at 8:35 AM, Alexei Starovoitov <ast@fb.com> wrote:
>
> On 9/29/20 11:45 PM, Song Liu wrote:
>>> On Sep 29, 2020, at 8:23 PM, Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
>>>
>>> On Tue, Sep 29, 2020 at 5:20 PM Song Liu <songliubraving@fb.com> wrote:
>>>>
>>>> In preempt kernel, BPF_PROG_TEST_RUN on raw_tp triggers:
>>>>
>>>> [ 35.874974] BUG: using smp_processor_id() in preemptible [00000000]
>>>> code: new_name/87
>>>> [ 35.893983] caller is bpf_prog_test_run_raw_tp+0xd4/0x1b0
>>>> [ 35.900124] CPU: 1 PID: 87 Comm: new_name Not tainted 5.9.0-rc6-g615bd02bf #1
>>>> [ 35.907358] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
>>>> BIOS 1.10.2-1ubuntu1 04/01/2014
>>>> [ 35.916941] Call Trace:
>>>> [ 35.919660] dump_stack+0x77/0x9b
>>>> [ 35.923273] check_preemption_disabled+0xb4/0xc0
>>>> [ 35.928376] bpf_prog_test_run_raw_tp+0xd4/0x1b0
>>>> [ 35.933872] ? selinux_bpf+0xd/0x70
>>>> [ 35.937532] __do_sys_bpf+0x6bb/0x21e0
>>>> [ 35.941570] ? find_held_lock+0x2d/0x90
>>>> [ 35.945687] ? vfs_write+0x150/0x220
>>>> [ 35.949586] do_syscall_64+0x2d/0x40
>>>> [ 35.953443] entry_SYSCALL_64_after_hwframe+0x44/0xa9
>>>>
>>>> Fix this by calling migrate_disable() before smp_processor_id().
>>>>
>>>> Fixes: 1b4d60ec162f ("bpf: Enable BPF_PROG_TEST_RUN for raw_tracepoint")
>>>> Reported-by: Alexei Starovoitov <ast@kernel.org>
>>>> Signed-off-by: Song Liu <songliubraving@fb.com>
>>>>
>>>> ---
>>>> Changes v1 => v2:
>>>> 1. Keep rcu_read_lock/unlock() in original places. (Alexei)
>>>> 2. Use get_cpu() instead of smp_processor_id(). (Alexei)
>>>
>>> Applying: bpf: fix raw_tp test run in preempt kernel
>>> Using index info to reconstruct a base tree...
>>> error: patch failed: net/bpf/test_run.c:293
>>> error: net/bpf/test_run.c: patch does not apply
>>> error: Did you hand edit your patch?
>> This is so weird. I cannot apply it myself. :(
>> [localhost] g co -b bpf-next-temp
>> Switched to a new branch 'bpf-next-temp'
>> [localhost] g format-patch -b HEAD~1 --subject-prefix "PATCH v3 bpf-next"
>> 0001-bpf-fix-raw_tp-test-run-in-preempt-kernel.patch
>
> could you try without -b ?
Yes! -b is the problem here.
I think the right way to format-patch is to use --ignore-space-at-eol
instead of -b.
Thanks,
Song
prev parent reply other threads:[~2020-09-30 15:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-30 0:20 [PATCH v2 bpf-next] bpf: fix raw_tp test run in preempt kernel Song Liu
2020-09-30 3:23 ` Alexei Starovoitov
2020-09-30 6:45 ` Song Liu
2020-09-30 15:35 ` Alexei Starovoitov
2020-09-30 15:48 ` Song Liu [this message]
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=8EFE87FC-84D2-4B63-B057-804A6F9F1F63@fb.com \
--to=songliubraving@fb.com \
--cc=Kernel-team@fb.com \
--cc=alexei.starovoitov@gmail.com \
--cc=ast@fb.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=john.fastabend@gmail.com \
--cc=kpsingh@chromium.org \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).