Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning on module unload: "BUG: using smp_processor_id() in preemptible" #211

Open
aldem opened this issue Mar 12, 2023 · 1 comment
Open

Comments

@aldem
Copy link

aldem commented Mar 12, 2023

Looks very similar to #193, but I believe that the proposed PR actually does not fix it:

Mar 12 22:07:57 proton kernel: BUG: using smp_processor_id() in preemptible [00000000] code: rmmod/188620
Mar 12 22:07:57 proton kernel: caller is netflow_scan_and_export+0x221/0x6c0 [ipt_NETFLOW]
Mar 12 22:07:57 proton kernel: CPU: 0 PID: 188620 Comm: rmmod Tainted: G           OE      6.0.0-0.deb11.6-cloud-amd64 #1  Debian 6.0.12-1~bpo11+1
Mar 12 22:07:57 proton kernel: Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
Mar 12 22:07:57 proton kernel: Call Trace:
Mar 12 22:07:57 proton kernel:  <TASK>
Mar 12 22:07:57 proton kernel:  dump_stack_lvl+0x45/0x5e
Mar 12 22:07:57 proton kernel:  check_preemption_disabled+0xe1/0xf0
Mar 12 22:07:57 proton kernel:  netflow_scan_and_export+0x221/0x6c0 [ipt_NETFLOW]
Mar 12 22:07:57 proton kernel:  ipt_netflow_fini+0x78/0xe63 [ipt_NETFLOW]

It seems that problem is a bit different, I encountered this recently and it happens only on module unload (any version, including current master), when netflow_scan_and_export() finally called to flush the remaining flows:

ipt-netflow/ipt_NETFLOW.c

Lines 5801 to 5802 in b049e91

_unschedule_scan_worker();
netflow_scan_and_export(AND_FLUSH);

As long as the kernel message is nothing more than a warning, and module is not reloaded very often, this is not a big issue, though anything in kernel log starting with a "BUG: " is a bit scary.

However, it would be nice to get rid of this if possible - I fixed this by surrounding the final call with preempt_disable() and preempt_enable() (works for me) but not sure if it could have some negative consequences, especially if it takes some time to finish.

@kalamlacki
Copy link

I build kernel with preempting disabled just for this module purpose. Last time when I mentioned about this BUG someone made stupid change to hide "BUG: using smp_processor_id() in preemptible" and the change was accepted, so for me this module will slowly die on missing support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants