linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: "Luis Claudio R. Goncalves" <lclaudio@uudg.org>
Cc: Clark Williams <williams@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	RT <linux-rt-users@vger.kernel.org>
Subject: Re: v5.2-rt1: kernel: BUG: assuming atomic context at net/core/ptp_classifier.c:106 current
Date: Tue, 13 Aug 2019 18:17:18 +0200	[thread overview]
Message-ID: <20190813161718.ki2q24hi2lx57y75@linutronix.de> (raw)
In-Reply-To: <20190718204655.GA4097@uudg.org>

On 2019-07-18 17:46:55 [-0300], Luis Claudio R. Goncalves wrote:
> Hello,
> 
> Sounds like ptp_classify_raw() should be reached with IRQs disabled to
> safely call BPF_PROG_RUN(). I am just unsure where, down the road, the
> proper context should have been set.
> 
> 08:46:58 darkmatter kernel: BUG: assuming atomic context at net/core/ptp_classifier.c:106
> Jul 17 08:46:58 darkmatter kernel: in_atomic(): 0, irqs_disabled(): 0, pid: 1129, name: irq/35-enp4s0
> Jul 17 08:46:58 darkmatter kernel: CPU: 1 PID: 1129 Comm: irq/35-enp4s0 Not tainted 5.2.0-rt1 #1
> Jul 17 08:46:58 darkmatter kernel: Hardware name: Hewlett-Packard p7-1512/2ADA, BIOS 8.15 02/05/2013
> Jul 17 08:46:58 darkmatter kernel: Call Trace:
> Jul 17 08:46:58 darkmatter kernel: dump_stack+0x67/0x90
> Jul 17 08:46:58 darkmatter kernel: __cant_sleep.cold+0x68/0x74
> Jul 17 08:46:58 darkmatter kernel: ptp_classify_raw+0x1f/0xa0
> Jul 17 08:46:58 darkmatter kernel: skb_defer_rx_timestamp+0x5a/0xb0
> Jul 17 08:46:58 darkmatter kernel: netif_receive_skb_internal+0x34/0xe0
> Jul 17 08:46:58 darkmatter kernel: napi_gro_receive+0x66/0x1c0
> Jul 17 08:46:58 darkmatter kernel: rtl8169_poll+0x216/0x610 [r8169]
> Jul 17 08:46:58 darkmatter kernel: net_rx_action+0x208/0x490
> Jul 17 08:46:58 darkmatter kernel: __do_softirq+0x140/0x3c9
> Jul 17 08:46:58 darkmatter kernel: __local_bh_enable_ip+0x13d/0x160
> Jul 17 08:46:58 darkmatter kernel: irq_forced_thread_fn+0x70/0x80
> Jul 17 08:46:58 darkmatter kernel: irq_thread+0xf6/0x1d0
> Jul 17 08:46:58 darkmatter kernel: kthread+0x103/0x140
> Jul 17 08:46:58 darkmatter kernel: ret_from_fork+0x3a/0x50
> Jul 17 08:46:58 darkmatter kernel: bpfilter: Loaded bpfilter_umh pid 1160
> Jul 17 08:46:58 darkmatter kernel: bpfilter: read fail -13

I would argue that this cant_sleep() thingy is nonsense. On !RT you run
in softirq and while this check does not trigger (because the preemption
counter is != 0) you can be preempted by an IRQ.
I have no idea what it intends to protect. The commit does not explain
why it is important to keep preemption disabled while invoking a BPF
program.

> Luis

Sebastian

      reply	other threads:[~2019-08-13 16:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-18 20:46 v5.2-rt1: kernel: BUG: assuming atomic context at net/core/ptp_classifier.c:106 current Luis Claudio R. Goncalves
2019-08-13 16:17 ` Sebastian Andrzej Siewior [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=20190813161718.ki2q24hi2lx57y75@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=lclaudio@uudg.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=williams@redhat.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;
as well as URLs for NNTP newsgroup(s).