From: Christoffer Dall <christoffer.dall@linaro.org>
To: Jason Wang <jasowang@redhat.com>
Cc: davem@davemloft.net, Marc Zyngier <marc.zyngier@arm.com>,
kvm@vger.kernel.org
Subject: Re: [BUG] tuntap: using smp_processor_id() in preemptible from xdp flush
Date: Tue, 13 Feb 2018 15:35:07 +0100 [thread overview]
Message-ID: <20180213143507.GI23189@cbox> (raw)
In-Reply-To: <a6d8c192-2fa5-bc5e-4253-a93a65c0a4fe@redhat.com>
On Tue, Feb 13, 2018 at 10:15:20PM +0800, Jason Wang wrote:
>
>
> On 2018年02月13日 21:21, Christoffer Dall wrote:
> >With v4.16-rc1 I see a low of these when running my KVM/ARM test loop:
> >
> > BUG: using smp_processor_id() in preemptible [00000000] code: vhost-2877/2900
> > caller is debug_smp_processor_id+0x1c/0x28
> > CPU: 0 PID: 2900 Comm: vhost-2877 Not tainted 4.16.0-rc1 #1333
> > Hardware name: APM X-Gene Mustang board (DT)
> > Call trace:
> > dump_backtrace+0x0/0x180
> > show_stack+0x24/0x30
> > dump_stack+0x8c/0xac
> > check_preemption_disabled+0xf8/0x100
> > debug_smp_processor_id+0x1c/0x28
> > xdp_do_flush_map+0x24/0x48
> > tun_sendmsg+0x90/0xa0
> > handle_tx+0x254/0x548
> > handle_tx_kick+0x20/0x30
> > vhost_worker+0xc0/0x158
> > kthread+0x104/0x130
> > ret_from_fork+0x10/0x1c
> >
> >I confirmed that reverting
> > 762c330d670e, "tuntap: add missing xdp flush", 2018-02-07
> >solves the problem for me.
> >
> >I'm not at all familiar with this part of the kernel and not sure what
> >the proper fix is. I'd be grateful if you could take a look and I'm
> >happy to help test etc.
> >
>
> Thanks for the reporting. Looking like it was because I try hard to do
> batching for XDP devmap which seems a little hard since it assumes XDP was
> running inside NAPI. Simply disable preemption can silent the warning but
> may lead other issue e.g miss some CPU where the process run previously. The
> only way is to disable batching now.
>
> Please help to test the attached patch.
>
I can confirm that the patch solves the issue. I put some stress on a
VM using tuntap by running netperf in TCP_STREAM, TCP_MAERTS, and TCP_RR
on there, and I didn't see any warnings:
Tested-by: Christoffer Dall <christoffer.dall@linaro.org>
Thanks,
-Christoffer
next prev parent reply other threads:[~2018-02-13 14:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-13 13:21 [BUG] tuntap: using smp_processor_id() in preemptible from xdp flush Christoffer Dall
2018-02-13 14:15 ` Jason Wang
2018-02-13 14:35 ` Christoffer Dall [this message]
2018-02-14 2:41 ` Jason Wang
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=20180213143507.GI23189@cbox \
--to=christoffer.dall@linaro.org \
--cc=davem@davemloft.net \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=marc.zyngier@arm.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