All of lore.kernel.org
 help / color / mirror / Atom feed
* Backtrace seen when enabling PREEMPT_RT
@ 2025-02-11 16:12 Guenter Roeck
  2025-02-11 17:22 ` Steven Rostedt
  2025-02-12 10:36 ` [PATCH 0/2] lockdep: disable_irq_nosync_lockdep.*() for PREEMPT_RT Sebastian Andrzej Siewior
  0 siblings, 2 replies; 14+ messages in thread
From: Guenter Roeck @ 2025-02-11 16:12 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: Clark Williams, Steven Rostedt, linux-rt-devel

Hi,

When I tried to enable PREEMPT_RT together with various lock debugging
options, I got the attached backtraces.

This is with qemu's ne2k_pci Ethernet emulation.

Question: If I enable PREEMPT_RT tests at kerneltests.org, should I report
such issues or stop testing affected configurations (I understand that
ne2k_pci probably isn't used much nowadays).

Thanks,
Guenter

---
Build reference: v6.14-rc2-8-g3309945911b8
Compiler version: x86_64-linux-gcc (GCC) 13.3.0
Qemu version: 9.1.2 (v9.1.2-51-g94825e22f3)
...
Starting network: [   13.511263] ip (2707) used greatest stack depth: 11928 bytes left
[   13.708177] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
[   13.708226] in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 8, name: kworker/0:0
[   13.708236] preempt_count: 0, expected: 0
[   13.708242] RCU nest depth: 6, expected: 6
[   13.708265] 14 locks held by kworker/0:0/8:
[   13.708280]  #0: ff4dd8b344e6dd38 ((wq_completion)mld){+.+.}-{0:0}, at: process_one_work+0x590/0x6d0
[   13.708568]  #1: ff5a3c8a40057e48 ((work_completion)(&(&idev->mc_ifc_work)->work)){+.+.}-{0:0}, at: process_one_work+0x1df/0x6d0
[   13.708582]  #2: ff4dd8b344fbc620 (&idev->mc_lock){+.+.}-{4:4}, at: mld_ifc_work+0x32/0x560
[   13.708595]  #3: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: mld_sendpack+0x73/0x380
[   13.708616]  #4: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: ip6_finish_output2+0xe0/0xb80
[   13.708629]  #5: ff4dd8b3bf61c818 ((softirq_ctrl.lock)){+.+.}-{3:3}, at: __local_bh_disable_ip+0x94/0x180
[   13.708653]  #6: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: rt_spin_lock+0xdf/0x170
[   13.708669]  #7: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: __local_bh_disable_ip+0xab/0x180
[   13.708682]  #8: ffffffff90806ee0 (rcu_read_lock_bh){....}-{1:3}, at: __dev_queue_xmit+0x71/0x13b0
[   13.708694]  #9: ff4dd8b34566c398 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{3:3}, at: __dev_queue_xmit+0x1061/0x13b0
[   13.708705]  #10: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: rt_spin_trylock+0x52/0xc0
[   13.708717]  #11: ff4dd8b344c66f58 (_xmit_ETHER#2){+...}-{3:3}, at: sch_direct_xmit+0x113/0x2b0
[   13.708737]  #12: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: rt_spin_lock+0xdf/0x170
[   13.708752]  #13: ff4dd8b344c14e40 (&ei_local->page_lock){+.+.}-{3:3}, at: ei_start_xmit+0xb5/0x470
[   13.708793] irq event stamp: 198329
[   13.708799] hardirqs last  enabled at (198328): [<ffffffff8fa1fb36>] _raw_spin_unlock_irqrestore+0x46/0x70
[   13.708808] hardirqs last disabled at (198329): [<ffffffff8f31d897>] ei_start_xmit+0x2a7/0x470
[   13.708816] softirqs last  enabled at (198304): [<ffffffff8e49a5ca>] __local_bh_enable_ip+0x11a/0x160
[   13.708824] softirqs last disabled at (198310): [<ffffffff8f5f1551>] __dev_queue_xmit+0x71/0x13b0
[   13.709017] CPU: 0 UID: 0 PID: 8 Comm: kworker/0:0 Tainted: G                 N 6.14.0-rc2-00008-g3309945911b8 #1
[   13.709056] Tainted: [N]=TEST
[   13.709063] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
[   13.709129] Workqueue: mld mld_ifc_work
[   13.709214] Call Trace:
[   13.709249]  <TASK>
[   13.709292]  dump_stack_lvl+0x78/0xe0
[   13.709331]  __might_resched+0x152/0x210
[   13.709353]  rt_spin_lock+0x5b/0x170
[   13.709363]  ? ei_start_xmit+0xb5/0x470
[   13.709371]  ? __disable_irq_nosync+0x5b/0x90
[   13.709386]  ei_start_xmit+0xb5/0x470
[   13.709390]  ? lock_acquire.part.0+0x9a/0x220
[   13.709444]  dev_hard_start_xmit+0x47/0x260
[   13.709475]  sch_direct_xmit+0x91/0x2b0
[   13.709504]  __dev_queue_xmit+0x10e3/0x13b0
[   13.709524]  ? lock_acquire.part.0+0x9a/0x220
[   13.709534]  ? find_held_lock+0x2b/0x80
[   13.709557]  ? mark_held_locks+0x40/0x70
[   13.709571]  ? eth_header+0x25/0xb0
[   13.709608]  ip6_finish_output2+0x246/0xb80
[   13.709638]  ? ip6_mtu+0x9a/0x190
[   13.709671]  mld_sendpack+0x1bb/0x380
[   13.709734]  mld_ifc_work+0x22f/0x560
[   13.709762]  process_one_work+0x220/0x6d0
[   13.709812]  worker_thread+0x18c/0x320
[   13.709829]  ? __pfx_worker_thread+0x10/0x10
[   13.709836]  kthread+0xfe/0x220
[   13.709854]  ? __pfx_kthread+0x10/0x10
[   13.709871]  ret_from_fork+0x2f/0x50
[   13.709878]  ? __pfx_kthread+0x10/0x10
[   13.709889]  ret_from_fork_asm+0x1a/0x30
[   13.709969]  </TASK>
udhcpc: started, v1.36.1
udhcpc: broadcasting discover
udhcpc: broadcasting select for 10.0.2.15, server 10.0.2.2
udhcpc: lease of 10.0.2.15 obtained from 10.0.2.2, lease time 86400
deleting routers
adding dns 10.0.2.3
OK
Found console ttyS0
Linux version 6.14.0-rc2-00008-g3309945911b8 (groeck@server.roeck-us.net) (x86_64-linux-gcc (GCC) 13.3.0, GNU ld (GNU Binutils) 2.42) #1 SMP PREEMPT_RT Tue Feb 11 07:24:33 PST 2025
Network interface test passed
TPM selftest failed
File system test skipped
Boot successful.
[   15.502550] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
[   15.502593] in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 112, name: kworker/u16:4
[   15.502599] preempt_count: 0, expected: 0
[   15.502602] RCU nest depth: 6, expected: 6
[   15.502606] 15 locks held by kworker/u16:4/112:
[   15.502611]  #0: ff4dd8b344f91138 ((wq_completion)ipv6_addrconf){+.+.}-{0:0}, at: process_one_work+0x590/0x6d0
[   15.502660]  #1: ff5a3c8a403efe48 ((work_completion)(&(&ifa->dad_work)->work)){+.+.}-{0:0}, at: process_one_work+0x1df/0x6d0
[   15.502676]  #2: ffffffff909b1a98 (rtnl_mutex){+.+.}-{4:4}, at: addrconf_dad_work+0x74/0x690
[   15.502693]  #3: ff4dd8b344fbc620 (&idev->mc_lock){+.+.}-{4:4}, at: ipv6_mc_dad_complete+0x1a/0xe0
[   15.502709]  #4: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: mld_sendpack+0x73/0x380
[   15.502724]  #5: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: ip6_finish_output2+0xe0/0xb80
[   15.502740]  #6: ff4dd8b3bf61c818 ((softirq_ctrl.lock)){+.+.}-{3:3}, at: __local_bh_disable_ip+0x94/0x180
[   15.502756]  #7: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: rt_spin_lock+0xdf/0x170
[   15.502772]  #8: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: __local_bh_disable_ip+0xab/0x180
[   15.502787]  #9: ffffffff90806ee0 (rcu_read_lock_bh){....}-{1:3}, at: __dev_queue_xmit+0x71/0x13b0
[   15.502801]  #10: ff4dd8b34566c398 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{3:3}, at: __dev_queue_xmit+0x1061/0x13b0
[   15.502815]  #11: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: rt_spin_trylock+0x52/0xc0
[   15.502829]  #12: ff4dd8b344c66f58 (_xmit_ETHER#2){+...}-{3:3}, at: sch_direct_xmit+0x113/0x2b0
[   15.502847]  #13: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: rt_spin_lock+0xdf/0x170
[   15.502861]  #14: ff4dd8b344c14e40 (&ei_local->page_lock){+.+.}-{3:3}, at: ei_start_xmit+0xb5/0x470
[   15.502878] irq event stamp: 7561
[   15.502881] hardirqs last  enabled at (7560): [<ffffffff8fa1fb36>] _raw_spin_unlock_irqrestore+0x46/0x70
[   15.502889] hardirqs last disabled at (7561): [<ffffffff8f31d897>] ei_start_xmit+0x2a7/0x470
[   15.502895] softirqs last  enabled at (7538): [<ffffffff8e49a5ca>] __local_bh_enable_ip+0x11a/0x160
[   15.502901] softirqs last disabled at (7544): [<ffffffff8f5f1551>] __dev_queue_xmit+0x71/0x13b0
[   15.502916] CPU: 0 UID: 0 PID: 112 Comm: kworker/u16:4 Tainted: G        W        N 6.14.0-rc2-00008-g3309945911b8 #1
[   15.502929] Tainted: [W]=WARN, [N]=TEST
[   15.502931] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
[   15.502940] Workqueue: ipv6_addrconf addrconf_dad_work
[   15.502951] Call Trace:
[   15.502956]  <TASK>
[   15.502969]  dump_stack_lvl+0x78/0xe0
[   15.502982]  __might_resched+0x152/0x210
[   15.503009]  rt_spin_lock+0x5b/0x170
[   15.503015]  ? ei_start_xmit+0xb5/0x470
[   15.503024]  ? __disable_irq_nosync+0x5b/0x90
[   15.503042]  ei_start_xmit+0xb5/0x470
[   15.503048]  ? lock_acquire.part.0+0x9a/0x220
[   15.503116]  dev_hard_start_xmit+0x47/0x260
[   15.503154]  sch_direct_xmit+0x91/0x2b0
[   15.503191]  __dev_queue_xmit+0x10e3/0x13b0
[   15.503241]  ? lock_acquire.part.0+0x9a/0x220
[   15.503254]  ? find_held_lock+0x2b/0x80
[   15.503282]  ? mark_held_locks+0x40/0x70
[   15.503322]  ip6_finish_output2+0x38e/0xb80
[   15.503360]  ? ip6_mtu+0x9a/0x190
[   15.503400]  mld_sendpack+0x1bb/0x380
[   15.503479]  ipv6_mc_dad_complete+0xba/0xe0
[   15.503492]  addrconf_dad_completed+0x388/0x440
[   15.503498]  ? addrconf_dad_work+0x220/0x690
[   15.503543]  ? addrconf_dad_work+0x220/0x690
[   15.503552]  ? addrconf_dad_work+0x328/0x690
[   15.503562]  addrconf_dad_work+0x328/0x690
[   15.503587]  ? lock_acquire+0x33/0x80
[   15.503592]  ? process_one_work+0x1df/0x6d0
[   15.503628]  process_one_work+0x220/0x6d0
[   15.503691]  worker_thread+0x18c/0x320
[   15.503712]  ? __pfx_worker_thread+0x10/0x10
[   15.503721]  kthread+0xfe/0x220
[   15.503744]  ? __pfx_kthread+0x10/0x10
[   15.503765]  ret_from_fork+0x2f/0x50
[   15.503772]  ? __pfx_kthread+0x10/0x10
[   15.503786]  ret_from_fork_asm+0x1a/0x30
[   15.503873]  </TASK>
Rebooting
[   30.831707] ACPI: PM: Preparing to enter system sleep state S5
[   30.836459] reboot: Restarting system
[   30.836571] reboot: machine restart
------------
Skipping x86_64:q35:Icelake-Server:defconfig:rt:smp8:net=i82557a:mem4G:nvme:fstest=gfs2:btrfs ... 
Skipping x86_64:q35:Skylake-Client-IBRS:defconfig:rt:smp2:net=i82558b:efi32:mem1G:sdhci-mmc:ext2 ... 
Skipping x86_64:q35:KnightsMill:defconfig:rt:smp6:net=i82550:mem512:ata:fstest=minix:ext2 ... 
Skipping x86_64:pc:Opteron_G3:defconfig:nosmp:net=e1000:mem1G:usb:ext2 ... 
Skipping x86_64:q35:Opteron_G4:defconfig:nosmp:net=ne2k_pci:efi:mem512:ata:fstest=hfs+:ext2 ... 
Skipping x86_64:q35:Haswell-noTSX-IBRS:defconfig:nosmp:net=pcnet:efi32:mem2G:ata:ext2 ... 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Backtrace seen when enabling PREEMPT_RT
  2025-02-11 16:12 Backtrace seen when enabling PREEMPT_RT Guenter Roeck
@ 2025-02-11 17:22 ` Steven Rostedt
  2025-02-11 22:54   ` Guenter Roeck
  2025-02-12 10:36 ` [PATCH 0/2] lockdep: disable_irq_nosync_lockdep.*() for PREEMPT_RT Sebastian Andrzej Siewior
  1 sibling, 1 reply; 14+ messages in thread
From: Steven Rostedt @ 2025-02-11 17:22 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Sebastian Andrzej Siewior, Clark Williams, linux-rt-devel

On Tue, 11 Feb 2025 08:12:37 -0800
Guenter Roeck <linux@roeck-us.net> wrote:

> Hi,
> 
> When I tried to enable PREEMPT_RT together with various lock debugging
> options, I got the attached backtraces.
> 
> This is with qemu's ne2k_pci Ethernet emulation.
> 
> Question: If I enable PREEMPT_RT tests at kerneltests.org, should I report
> such issues or stop testing affected configurations (I understand that
> ne2k_pci probably isn't used much nowadays).

Yes, I think you should still report this.

> 
> Thanks,
> Guenter
> 
> ---
> Build reference: v6.14-rc2-8-g3309945911b8
> Compiler version: x86_64-linux-gcc (GCC) 13.3.0
> Qemu version: 9.1.2 (v9.1.2-51-g94825e22f3)
> ...
> Starting network: [   13.511263] ip (2707) used greatest stack depth: 11928 bytes left
> [   13.708177] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
> [   13.708226] in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 8, name: kworker/0:0

Interrupts are disabled  while taking a spin_lock() (in RT that's a mutex).

> [   13.708236] preempt_count: 0, expected: 0
> [   13.708242] RCU nest depth: 6, expected: 6
> [   13.708265] 14 locks held by kworker/0:0/8:
> [   13.708280]  #0: ff4dd8b344e6dd38 ((wq_completion)mld){+.+.}-{0:0}, at: process_one_work+0x590/0x6d0
> [   13.708568]  #1: ff5a3c8a40057e48 ((work_completion)(&(&idev->mc_ifc_work)->work)){+.+.}-{0:0}, at: process_one_work+0x1df/0x6d0
> [   13.708582]  #2: ff4dd8b344fbc620 (&idev->mc_lock){+.+.}-{4:4}, at: mld_ifc_work+0x32/0x560
> [   13.708595]  #3: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: mld_sendpack+0x73/0x380
> [   13.708616]  #4: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: ip6_finish_output2+0xe0/0xb80
> [   13.708629]  #5: ff4dd8b3bf61c818 ((softirq_ctrl.lock)){+.+.}-{3:3}, at: __local_bh_disable_ip+0x94/0x180
> [   13.708653]  #6: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: rt_spin_lock+0xdf/0x170
> [   13.708669]  #7: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: __local_bh_disable_ip+0xab/0x180
> [   13.708682]  #8: ffffffff90806ee0 (rcu_read_lock_bh){....}-{1:3}, at: __dev_queue_xmit+0x71/0x13b0
> [   13.708694]  #9: ff4dd8b34566c398 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{3:3}, at: __dev_queue_xmit+0x1061/0x13b0
> [   13.708705]  #10: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: rt_spin_trylock+0x52/0xc0
> [   13.708717]  #11: ff4dd8b344c66f58 (_xmit_ETHER#2){+...}-{3:3}, at: sch_direct_xmit+0x113/0x2b0
> [   13.708737]  #12: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: rt_spin_lock+0xdf/0x170
> [   13.708752]  #13: ff4dd8b344c14e40 (&ei_local->page_lock){+.+.}-{3:3}, at: ei_start_xmit+0xb5/0x470
> [   13.708793] irq event stamp: 198329
> [   13.708799] hardirqs last  enabled at (198328): [<ffffffff8fa1fb36>] _raw_spin_unlock_irqrestore+0x46/0x70
> [   13.708808] hardirqs last disabled at (198329): [<ffffffff8f31d897>] ei_start_xmit+0x2a7/0x470

Hmm, where is that ei_start_xmit+0x2a7, This would be good to run
scripts/decode_stacktrace.sh on this.

-- Steve



> [   13.708816] softirqs last  enabled at (198304): [<ffffffff8e49a5ca>] __local_bh_enable_ip+0x11a/0x160
> [   13.708824] softirqs last disabled at (198310): [<ffffffff8f5f1551>] __dev_queue_xmit+0x71/0x13b0
> [   13.709017] CPU: 0 UID: 0 PID: 8 Comm: kworker/0:0 Tainted: G                 N 6.14.0-rc2-00008-g3309945911b8 #1
> [   13.709056] Tainted: [N]=TEST
> [   13.709063] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
> [   13.709129] Workqueue: mld mld_ifc_work
> [   13.709214] Call Trace:
> [   13.709249]  <TASK>
> [   13.709292]  dump_stack_lvl+0x78/0xe0
> [   13.709331]  __might_resched+0x152/0x210
> [   13.709353]  rt_spin_lock+0x5b/0x170
> [   13.709363]  ? ei_start_xmit+0xb5/0x470
> [   13.709371]  ? __disable_irq_nosync+0x5b/0x90
> [   13.709386]  ei_start_xmit+0xb5/0x470
> [   13.709390]  ? lock_acquire.part.0+0x9a/0x220
> [   13.709444]  dev_hard_start_xmit+0x47/0x260
> [   13.709475]  sch_direct_xmit+0x91/0x2b0
> [   13.709504]  __dev_queue_xmit+0x10e3/0x13b0
> [   13.709524]  ? lock_acquire.part.0+0x9a/0x220
> [   13.709534]  ? find_held_lock+0x2b/0x80
> [   13.709557]  ? mark_held_locks+0x40/0x70
> [   13.709571]  ? eth_header+0x25/0xb0
> [   13.709608]  ip6_finish_output2+0x246/0xb80
> [   13.709638]  ? ip6_mtu+0x9a/0x190
> [   13.709671]  mld_sendpack+0x1bb/0x380
> [   13.709734]  mld_ifc_work+0x22f/0x560
> [   13.709762]  process_one_work+0x220/0x6d0
> [   13.709812]  worker_thread+0x18c/0x320
> [   13.709829]  ? __pfx_worker_thread+0x10/0x10
> [   13.709836]  kthread+0xfe/0x220
> [   13.709854]  ? __pfx_kthread+0x10/0x10
> [   13.709871]  ret_from_fork+0x2f/0x50
> [   13.709878]  ? __pfx_kthread+0x10/0x10
> [   13.709889]  ret_from_fork_asm+0x1a/0x30
> [   13.709969]  </TASK>
> udhcpc: started, v1.36.1
> udhcpc: broadcasting discover
> udhcpc: broadcasting select for 10.0.2.15, server 10.0.2.2
> udhcpc: lease of 10.0.2.15 obtained from 10.0.2.2, lease time 86400
> deleting routers
> adding dns 10.0.2.3
> OK
> Found console ttyS0
> Linux version 6.14.0-rc2-00008-g3309945911b8 (groeck@server.roeck-us.net) (x86_64-linux-gcc (GCC) 13.3.0, GNU ld (GNU Binutils) 2.42) #1 SMP PREEMPT_RT Tue Feb 11 07:24:33 PST 2025
> Network interface test passed
> TPM selftest failed
> File system test skipped
> Boot successful.
> [   15.502550] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
> [   15.502593] in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 112, name: kworker/u16:4
> [   15.502599] preempt_count: 0, expected: 0
> [   15.502602] RCU nest depth: 6, expected: 6
> [   15.502606] 15 locks held by kworker/u16:4/112:
> [   15.502611]  #0: ff4dd8b344f91138 ((wq_completion)ipv6_addrconf){+.+.}-{0:0}, at: process_one_work+0x590/0x6d0
> [   15.502660]  #1: ff5a3c8a403efe48 ((work_completion)(&(&ifa->dad_work)->work)){+.+.}-{0:0}, at: process_one_work+0x1df/0x6d0
> [   15.502676]  #2: ffffffff909b1a98 (rtnl_mutex){+.+.}-{4:4}, at: addrconf_dad_work+0x74/0x690
> [   15.502693]  #3: ff4dd8b344fbc620 (&idev->mc_lock){+.+.}-{4:4}, at: ipv6_mc_dad_complete+0x1a/0xe0
> [   15.502709]  #4: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: mld_sendpack+0x73/0x380
> [   15.502724]  #5: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: ip6_finish_output2+0xe0/0xb80
> [   15.502740]  #6: ff4dd8b3bf61c818 ((softirq_ctrl.lock)){+.+.}-{3:3}, at: __local_bh_disable_ip+0x94/0x180
> [   15.502756]  #7: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: rt_spin_lock+0xdf/0x170
> [   15.502772]  #8: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: __local_bh_disable_ip+0xab/0x180
> [   15.502787]  #9: ffffffff90806ee0 (rcu_read_lock_bh){....}-{1:3}, at: __dev_queue_xmit+0x71/0x13b0
> [   15.502801]  #10: ff4dd8b34566c398 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{3:3}, at: __dev_queue_xmit+0x1061/0x13b0
> [   15.502815]  #11: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: rt_spin_trylock+0x52/0xc0
> [   15.502829]  #12: ff4dd8b344c66f58 (_xmit_ETHER#2){+...}-{3:3}, at: sch_direct_xmit+0x113/0x2b0
> [   15.502847]  #13: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: rt_spin_lock+0xdf/0x170
> [   15.502861]  #14: ff4dd8b344c14e40 (&ei_local->page_lock){+.+.}-{3:3}, at: ei_start_xmit+0xb5/0x470
> [   15.502878] irq event stamp: 7561
> [   15.502881] hardirqs last  enabled at (7560): [<ffffffff8fa1fb36>] _raw_spin_unlock_irqrestore+0x46/0x70
> [   15.502889] hardirqs last disabled at (7561): [<ffffffff8f31d897>] ei_start_xmit+0x2a7/0x470
> [   15.502895] softirqs last  enabled at (7538): [<ffffffff8e49a5ca>] __local_bh_enable_ip+0x11a/0x160
> [   15.502901] softirqs last disabled at (7544): [<ffffffff8f5f1551>] __dev_queue_xmit+0x71/0x13b0
> [   15.502916] CPU: 0 UID: 0 PID: 112 Comm: kworker/u16:4 Tainted: G        W        N 6.14.0-rc2-00008-g3309945911b8 #1
> [   15.502929] Tainted: [W]=WARN, [N]=TEST
> [   15.502931] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
> [   15.502940] Workqueue: ipv6_addrconf addrconf_dad_work
> [   15.502951] Call Trace:
> [   15.502956]  <TASK>
> [   15.502969]  dump_stack_lvl+0x78/0xe0
> [   15.502982]  __might_resched+0x152/0x210
> [   15.503009]  rt_spin_lock+0x5b/0x170
> [   15.503015]  ? ei_start_xmit+0xb5/0x470
> [   15.503024]  ? __disable_irq_nosync+0x5b/0x90
> [   15.503042]  ei_start_xmit+0xb5/0x470
> [   15.503048]  ? lock_acquire.part.0+0x9a/0x220
> [   15.503116]  dev_hard_start_xmit+0x47/0x260
> [   15.503154]  sch_direct_xmit+0x91/0x2b0
> [   15.503191]  __dev_queue_xmit+0x10e3/0x13b0
> [   15.503241]  ? lock_acquire.part.0+0x9a/0x220
> [   15.503254]  ? find_held_lock+0x2b/0x80
> [   15.503282]  ? mark_held_locks+0x40/0x70
> [   15.503322]  ip6_finish_output2+0x38e/0xb80
> [   15.503360]  ? ip6_mtu+0x9a/0x190
> [   15.503400]  mld_sendpack+0x1bb/0x380
> [   15.503479]  ipv6_mc_dad_complete+0xba/0xe0
> [   15.503492]  addrconf_dad_completed+0x388/0x440
> [   15.503498]  ? addrconf_dad_work+0x220/0x690
> [   15.503543]  ? addrconf_dad_work+0x220/0x690
> [   15.503552]  ? addrconf_dad_work+0x328/0x690
> [   15.503562]  addrconf_dad_work+0x328/0x690
> [   15.503587]  ? lock_acquire+0x33/0x80
> [   15.503592]  ? process_one_work+0x1df/0x6d0
> [   15.503628]  process_one_work+0x220/0x6d0
> [   15.503691]  worker_thread+0x18c/0x320
> [   15.503712]  ? __pfx_worker_thread+0x10/0x10
> [   15.503721]  kthread+0xfe/0x220
> [   15.503744]  ? __pfx_kthread+0x10/0x10
> [   15.503765]  ret_from_fork+0x2f/0x50
> [   15.503772]  ? __pfx_kthread+0x10/0x10
> [   15.503786]  ret_from_fork_asm+0x1a/0x30
> [   15.503873]  </TASK>
> Rebooting
> [   30.831707] ACPI: PM: Preparing to enter system sleep state S5
> [   30.836459] reboot: Restarting system
> [   30.836571] reboot: machine restart
> ------------
> Skipping x86_64:q35:Icelake-Server:defconfig:rt:smp8:net=i82557a:mem4G:nvme:fstest=gfs2:btrfs ... 
> Skipping x86_64:q35:Skylake-Client-IBRS:defconfig:rt:smp2:net=i82558b:efi32:mem1G:sdhci-mmc:ext2 ... 
> Skipping x86_64:q35:KnightsMill:defconfig:rt:smp6:net=i82550:mem512:ata:fstest=minix:ext2 ... 
> Skipping x86_64:pc:Opteron_G3:defconfig:nosmp:net=e1000:mem1G:usb:ext2 ... 
> Skipping x86_64:q35:Opteron_G4:defconfig:nosmp:net=ne2k_pci:efi:mem512:ata:fstest=hfs+:ext2 ... 
> Skipping x86_64:q35:Haswell-noTSX-IBRS:defconfig:nosmp:net=pcnet:efi32:mem2G:ata:ext2 ... 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Backtrace seen when enabling PREEMPT_RT
  2025-02-11 17:22 ` Steven Rostedt
@ 2025-02-11 22:54   ` Guenter Roeck
  2025-02-11 23:21     ` Steven Rostedt
  0 siblings, 1 reply; 14+ messages in thread
From: Guenter Roeck @ 2025-02-11 22:54 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Sebastian Andrzej Siewior, Clark Williams, linux-rt-devel

On 2/11/25 09:22, Steven Rostedt wrote:
> On Tue, 11 Feb 2025 08:12:37 -0800
> Guenter Roeck <linux@roeck-us.net> wrote:
> 
>> Hi,
>>
>> When I tried to enable PREEMPT_RT together with various lock debugging
>> options, I got the attached backtraces.
>>
>> This is with qemu's ne2k_pci Ethernet emulation.
>>
>> Question: If I enable PREEMPT_RT tests at kerneltests.org, should I report
>> such issues or stop testing affected configurations (I understand that
>> ne2k_pci probably isn't used much nowadays).
> 
> Yes, I think you should still report this.
> 
>>
>> Thanks,
>> Guenter
>>
>> ---
>> Build reference: v6.14-rc2-8-g3309945911b8
>> Compiler version: x86_64-linux-gcc (GCC) 13.3.0
>> Qemu version: 9.1.2 (v9.1.2-51-g94825e22f3)
>> ...
>> Starting network: [   13.511263] ip (2707) used greatest stack depth: 11928 bytes left
>> [   13.708177] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
>> [   13.708226] in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 8, name: kworker/0:0
> 
> Interrupts are disabled  while taking a spin_lock() (in RT that's a mutex).
> 
>> [   13.708236] preempt_count: 0, expected: 0
>> [   13.708242] RCU nest depth: 6, expected: 6
>> [   13.708265] 14 locks held by kworker/0:0/8:
>> [   13.708280]  #0: ff4dd8b344e6dd38 ((wq_completion)mld){+.+.}-{0:0}, at: process_one_work+0x590/0x6d0
>> [   13.708568]  #1: ff5a3c8a40057e48 ((work_completion)(&(&idev->mc_ifc_work)->work)){+.+.}-{0:0}, at: process_one_work+0x1df/0x6d0
>> [   13.708582]  #2: ff4dd8b344fbc620 (&idev->mc_lock){+.+.}-{4:4}, at: mld_ifc_work+0x32/0x560
>> [   13.708595]  #3: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: mld_sendpack+0x73/0x380
>> [   13.708616]  #4: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: ip6_finish_output2+0xe0/0xb80
>> [   13.708629]  #5: ff4dd8b3bf61c818 ((softirq_ctrl.lock)){+.+.}-{3:3}, at: __local_bh_disable_ip+0x94/0x180
>> [   13.708653]  #6: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: rt_spin_lock+0xdf/0x170
>> [   13.708669]  #7: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: __local_bh_disable_ip+0xab/0x180
>> [   13.708682]  #8: ffffffff90806ee0 (rcu_read_lock_bh){....}-{1:3}, at: __dev_queue_xmit+0x71/0x13b0
>> [   13.708694]  #9: ff4dd8b34566c398 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{3:3}, at: __dev_queue_xmit+0x1061/0x13b0
>> [   13.708705]  #10: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: rt_spin_trylock+0x52/0xc0
>> [   13.708717]  #11: ff4dd8b344c66f58 (_xmit_ETHER#2){+...}-{3:3}, at: sch_direct_xmit+0x113/0x2b0
>> [   13.708737]  #12: ffffffff90806f20 (rcu_read_lock){....}-{1:3}, at: rt_spin_lock+0xdf/0x170
>> [   13.708752]  #13: ff4dd8b344c14e40 (&ei_local->page_lock){+.+.}-{3:3}, at: ei_start_xmit+0xb5/0x470
>> [   13.708793] irq event stamp: 198329
>> [   13.708799] hardirqs last  enabled at (198328): [<ffffffff8fa1fb36>] _raw_spin_unlock_irqrestore+0x46/0x70
>> [   13.708808] hardirqs last disabled at (198329): [<ffffffff8f31d897>] ei_start_xmit+0x2a7/0x470
> 
> Hmm, where is that ei_start_xmit+0x2a7, This would be good to run
> scripts/decode_stacktrace.sh on this.
> 

Does this help ?

[   13.163019] hardirqs last enabled at (52626): _raw_spin_unlock_irqrestore (arch/x86/include/asm/irqflags.h:26 arch/x86/include/asm/irqflags.h:87 arch/x86/include/asm/irqflags.h:147 include/linux/spinlock_api_smp.h:151 kernel/locking/spinlock.c:194)
[   13.163030] hardirqs last disabled at (52627): ei_start_xmit (include/linux/interrupt.h:460 (discriminator 1) drivers/net/ethernet/8390/lib8390.c:333 (discriminator 1) drivers/net/ethernet/8390/8390.c:23 (discriminator 1))
[   13.163038] softirqs last enabled at (52602): __local_bh_enable_ip (kernel/softirq.c:247)
[   13.163046] softirqs last disabled at (52608): __dev_queue_xmit (include/linux/bottom_half.h:20 (discriminator 1) include/linux/rcupdate.h:901 (discriminator 1) net/core/dev.c:4509 (discriminator 1))
[   13.163257] CPU: 2 UID: 0 PID: 59 Comm: kworker/2:1 Tainted: G                 N 6.14.0-rc2-00008-g3309945911b8 #1
[   13.163300] Tainted: [N]=TEST
[   13.163307] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
[   13.163376] Workqueue: mld mld_ifc_work
[   13.163466] Call Trace:
[   13.163501]  <TASK>
[   13.163544] dump_stack_lvl (lib/dump_stack.c:123)
[   13.163584] __might_resched (kernel/sched/core.c:8767)
[   13.163607] rt_spin_lock (kernel/locking/spinlock_rt.c:40 kernel/locking/spinlock_rt.c:49 kernel/locking/spinlock_rt.c:57)
[   13.163618] ? ei_start_xmit (drivers/net/ethernet/8390/lib8390.c:337 drivers/net/ethernet/8390/8390.c:23)
[   13.163625] ? __disable_irq_nosync (kernel/irq/manage.c:702)
[   13.163638] ei_start_xmit (drivers/net/ethernet/8390/lib8390.c:337 drivers/net/ethernet/8390/8390.c:23)
[   13.163642] ? lock_acquire.part.0 (kernel/locking/lockdep.c:469 (discriminator 4) kernel/locking/lockdep.c:5853 (discriminator 4))
[   13.163685] dev_hard_start_xmit (include/linux/netdevice.h:5144 include/linux/netdevice.h:5153 net/core/dev.c:3735 net/core/dev.c:3751)
[   13.163709] sch_direct_xmit (net/sched/sch_generic.c:343)
[   13.163735] __dev_queue_xmit (net/core/dev.c:3974 (discriminator 1) net/core/dev.c:4550 (discriminator 1))
[   13.163751] ? lock_acquire.part.0 (kernel/locking/lockdep.c:469 (discriminator 4) kernel/locking/lockdep.c:5853 (discriminator 4))
[   13.163760] ? find_held_lock (kernel/locking/lockdep.c:5341 (discriminator 1))
[   13.163778] ? mark_held_locks (kernel/locking/lockdep.c:4323 (discriminator 1))
[   13.163790] ? eth_header (net/ethernet/eth.c:85)
[   13.163819] ip6_finish_output2 (include/net/neighbour.h:539 (discriminator 2) net/ipv6/ip6_output.c:141 (discriminator 2))
[   13.163843] ? ip6_mtu (net/ipv6/route.c:3220)
[   13.163869] mld_sendpack (net/ipv6/mcast.c:1866)
[   13.163918] mld_ifc_work (net/ipv6/mcast.c:2699)
[   13.163940] process_one_work (kernel/workqueue.c:3241)
[   13.163979] worker_thread (kernel/workqueue.c:3311 (discriminator 2) kernel/workqueue.c:3398 (discriminator 2))
[   13.163993] ? __pfx_worker_thread (kernel/workqueue.c:3344)
[   13.164000] kthread (kernel/kthread.c:464)
[   13.164015] ? __pfx_kthread (kernel/kthread.c:413)
[   13.164030] ret_from_fork (arch/x86/kernel/process.c:154)
[   13.164036] ? __pfx_kthread (kernel/kthread.c:413)
[   13.164046] ret_from_fork_asm (arch/x86/entry/entry_64.S:257)

Guenter


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Backtrace seen when enabling PREEMPT_RT
  2025-02-11 22:54   ` Guenter Roeck
@ 2025-02-11 23:21     ` Steven Rostedt
  0 siblings, 0 replies; 14+ messages in thread
From: Steven Rostedt @ 2025-02-11 23:21 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Sebastian Andrzej Siewior, Clark Williams, linux-rt-devel,
	Peter Zijlstra, Thomas Gleixner

On Tue, 11 Feb 2025 14:54:47 -0800
Guenter Roeck <linux@roeck-us.net> wrote:

> Does this help ?

Yes.

> 
> [   13.163019] hardirqs last enabled at (52626): _raw_spin_unlock_irqrestore (arch/x86/include/asm/irqflags.h:26 arch/x86/include/asm/irqflags.h:87 arch/x86/include/asm/irqflags.h:147 include/linux/spinlock_api_smp.h:151 kernel/locking/spinlock.c:194)
> [   13.163030] hardirqs last disabled at (52627): ei_start_xmit (include/linux/interrupt.h:460 (discriminator 1) drivers/net/ethernet/8390/lib8390.c:333 (discriminator 1) drivers/net/ethernet/8390/8390.c:23 (discriminator 1))

Ug, we have in __ei_start_xmit():

        /*
         *      Slow phase with lock held.
         */

        disable_irq_nosync_lockdep_irqsave(dev->irq, &flags);

        spin_lock(&ei_local->page_lock);


Where we have:

static inline void disable_irq_nosync_lockdep(unsigned int irq)
{
        disable_irq_nosync(irq); 
#ifdef CONFIG_LOCKDEP
        local_irq_disable();
#endif 
}

Where when we have LOCKDEP enabled, it disables interrupts. But as you can
see, that's going to trigger the warning:

  BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48

Because the spin_lock() is a mutex when PREEMPT_RT is enabled, but now we
have interrupts disabled when LOCKDEP in enabled.

Peter, should that be:

static inline void disable_irq_nosync_lockdep(unsigned int irq)
{
        disable_irq_nosync(irq); 
#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
        local_irq_disable();
#endif 
}

Or is that just wishful thinking that this would be solved by such a simple
solution (of course the enable_irq() version also needs to be updated).

-- Steve



> [   13.163038] softirqs last enabled at (52602): __local_bh_enable_ip (kernel/softirq.c:247)
> [   13.163046] softirqs last disabled at (52608): __dev_queue_xmit (include/linux/bottom_half.h:20 (discriminator 1) include/linux/rcupdate.h:901 (discriminator 1) net/core/dev.c:4509 (discriminator 1))
> [   13.163257] CPU: 2 UID: 0 PID: 59 Comm: kworker/2:1 Tainted: G                 N 6.14.0-rc2-00008-g3309945911b8 #1
> [   13.163300] Tainted: [N]=TEST
> [   13.163307] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
> [   13.163376] Workqueue: mld mld_ifc_work
> [   13.163466] Call Trace:
> [   13.163501]  <TASK>
> [   13.163544] dump_stack_lvl (lib/dump_stack.c:123)
> [   13.163584] __might_resched (kernel/sched/core.c:8767)
> [   13.163607] rt_spin_lock (kernel/locking/spinlock_rt.c:40 kernel/locking/spinlock_rt.c:49 kernel/locking/spinlock_rt.c:57)
> [   13.163618] ? ei_start_xmit (drivers/net/ethernet/8390/lib8390.c:337 drivers/net/ethernet/8390/8390.c:23)
> [   13.163625] ? __disable_irq_nosync (kernel/irq/manage.c:702)
> [   13.163638] ei_start_xmit (drivers/net/ethernet/8390/lib8390.c:337 drivers/net/ethernet/8390/8390.c:23)
> [   13.163642] ? lock_acquire.part.0 (kernel/locking/lockdep.c:469 (discriminator 4) kernel/locking/lockdep.c:5853 (discriminator 4))
> [   13.163685] dev_hard_start_xmit (include/linux/netdevice.h:5144 include/linux/netdevice.h:5153 net/core/dev.c:3735 net/core/dev.c:3751)
> [   13.163709] sch_direct_xmit (net/sched/sch_generic.c:343)
> [   13.163735] __dev_queue_xmit (net/core/dev.c:3974 (discriminator 1) net/core/dev.c:4550 (discriminator 1))
> [   13.163751] ? lock_acquire.part.0 (kernel/locking/lockdep.c:469 (discriminator 4) kernel/locking/lockdep.c:5853 (discriminator 4))
> [   13.163760] ? find_held_lock (kernel/locking/lockdep.c:5341 (discriminator 1))
> [   13.163778] ? mark_held_locks (kernel/locking/lockdep.c:4323 (discriminator 1))
> [   13.163790] ? eth_header (net/ethernet/eth.c:85)
> [   13.163819] ip6_finish_output2 (include/net/neighbour.h:539 (discriminator 2) net/ipv6/ip6_output.c:141 (discriminator 2))
> [   13.163843] ? ip6_mtu (net/ipv6/route.c:3220)
> [   13.163869] mld_sendpack (net/ipv6/mcast.c:1866)
> [   13.163918] mld_ifc_work (net/ipv6/mcast.c:2699)
> [   13.163940] process_one_work (kernel/workqueue.c:3241)
> [   13.163979] worker_thread (kernel/workqueue.c:3311 (discriminator 2) kernel/workqueue.c:3398 (discriminator 2))
> [   13.163993] ? __pfx_worker_thread (kernel/workqueue.c:3344)
> [   13.164000] kthread (kernel/kthread.c:464)
> [   13.164015] ? __pfx_kthread (kernel/kthread.c:413)
> [   13.164030] ret_from_fork (arch/x86/kernel/process.c:154)
> [   13.164036] ? __pfx_kthread (kernel/kthread.c:413)
> [   13.164046] ret_from_fork_asm (arch/x86/entry/entry_64.S:257)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 0/2] lockdep: disable_irq_nosync_lockdep.*() for PREEMPT_RT.
  2025-02-11 16:12 Backtrace seen when enabling PREEMPT_RT Guenter Roeck
  2025-02-11 17:22 ` Steven Rostedt
@ 2025-02-12 10:36 ` Sebastian Andrzej Siewior
  2025-02-12 10:36   ` [PATCH 1/2] lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*() Sebastian Andrzej Siewior
                     ` (2 more replies)
  1 sibling, 3 replies; 14+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-02-12 10:36 UTC (permalink / raw)
  To: linux-rt-devel, linux-kernel
  Cc: Peter Zijlstra, Ingo Molnar, Will Deacon, Boqun Feng, Waiman Long,
	Guenter Roeck, Clark Williams, Steven Rostedt,
	Sebastian Andrzej Siewior

Guenter reported a sleeping-while-atomic warning on PREEMPT_RT with the
NE2K card. Turns out it is a questionable construct which requires
lockdep tweak to not get reported. It was added long time ago to deal
with the NE2K and has today two users.

The way I see, we could convert NE2K to NAPI and avoid the construct. It
would do the slow-part/ spin (in the reset case) with "just" BH disabled
which is what it is doing now since all callers disable BH before
calling. There are however many parts using the driver which have to be
touched (CS, PCI, …) and I have just qemu here so I am not too
comfortable doing it. Also I haven't looked what is wrong forcedeth yet.

I have no idea why nobody converted NE2K to NAPI in the last 20 years.
The annotation was added in 2007 while NAPI was added in 2002 via
   abb85ec3ab0ba ("Integrate NAPI work done by Jamal Hadi Salim, Robert Olsson, and Alexey Kuznetsov.…)

The easy part is to just avoid disabling interrupt on PREEMPT_RT since
there is no difference.

Sebastian Andrzej Siewior (2):
  lockdep: Don't disable interrupts on RT in
    disable_irq_nosync_lockdep.*()
  lockdep: Remove disable_irq_lockdep().

 include/linux/interrupt.h | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

-- 
2.47.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/2] lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*()
  2025-02-12 10:36 ` [PATCH 0/2] lockdep: disable_irq_nosync_lockdep.*() for PREEMPT_RT Sebastian Andrzej Siewior
@ 2025-02-12 10:36   ` Sebastian Andrzej Siewior
  2025-02-12 14:11     ` Guenter Roeck
                       ` (3 more replies)
  2025-02-12 10:36   ` [PATCH 2/2] lockdep: Remove disable_irq_lockdep() Sebastian Andrzej Siewior
  2025-02-21 16:35   ` [PATCH 0/2] lockdep: disable_irq_nosync_lockdep.*() for PREEMPT_RT Sebastian Andrzej Siewior
  2 siblings, 4 replies; 14+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-02-12 10:36 UTC (permalink / raw)
  To: linux-rt-devel, linux-kernel
  Cc: Peter Zijlstra, Ingo Molnar, Will Deacon, Boqun Feng, Waiman Long,
	Guenter Roeck, Clark Williams, Steven Rostedt,
	Sebastian Andrzej Siewior

disable_irq_nosync_lockdep() disables interrupts with lockdep enabled to
avoid false positive reports by lockdep that a certain lock has not been
acquired with disabled interrupts. The user of this macros expects that
a lock can be acquried without disabling interrupts because the IRQ line
triggering the interrupt is disabled.

This triggers a warning on PREEMPT_RT because after
disable_irq_nosync_lockdep.*() the following spinlock_t now is acquired
with disabled interrupts.

On PREEMPT_RT there is no difference between spin_lock() and
spin_lock_irq() so avoiding disabling interrupts in this case works for
the two remaining callers as of today.

Don't disable interrupts on PREEMPT_RT in disable_irq_nosync_lockdep.*().

Reported-by: Guenter Roeck <linux@roeck-us.net>
Closes: https://lore.kernel.org/760e34f9-6034-40e0-82a5-ee9becd24438@roeck-us.net
Fixes: e8106b941ceab ("[PATCH] lockdep: core, add enable/disable_irq_irqsave/irqrestore() APIs")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 include/linux/interrupt.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 8cd9327e4e78d..a1b1be9bf73b2 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -448,7 +448,7 @@ irq_calc_affinity_vectors(unsigned int minvec, unsigned int maxvec,
 static inline void disable_irq_nosync_lockdep(unsigned int irq)
 {
 	disable_irq_nosync(irq);
-#ifdef CONFIG_LOCKDEP
+#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
 	local_irq_disable();
 #endif
 }
@@ -456,7 +456,7 @@ static inline void disable_irq_nosync_lockdep(unsigned int irq)
 static inline void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned long *flags)
 {
 	disable_irq_nosync(irq);
-#ifdef CONFIG_LOCKDEP
+#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
 	local_irq_save(*flags);
 #endif
 }
@@ -471,7 +471,7 @@ static inline void disable_irq_lockdep(unsigned int irq)
 
 static inline void enable_irq_lockdep(unsigned int irq)
 {
-#ifdef CONFIG_LOCKDEP
+#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
 	local_irq_enable();
 #endif
 	enable_irq(irq);
@@ -479,7 +479,7 @@ static inline void enable_irq_lockdep(unsigned int irq)
 
 static inline void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long *flags)
 {
-#ifdef CONFIG_LOCKDEP
+#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
 	local_irq_restore(*flags);
 #endif
 	enable_irq(irq);
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/2] lockdep: Remove disable_irq_lockdep().
  2025-02-12 10:36 ` [PATCH 0/2] lockdep: disable_irq_nosync_lockdep.*() for PREEMPT_RT Sebastian Andrzej Siewior
  2025-02-12 10:36   ` [PATCH 1/2] lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*() Sebastian Andrzej Siewior
@ 2025-02-12 10:36   ` Sebastian Andrzej Siewior
  2025-02-12 14:11     ` Guenter Roeck
  2025-03-14 20:23     ` [tip: locking/core] " tip-bot2 for Sebastian Andrzej Siewior
  2025-02-21 16:35   ` [PATCH 0/2] lockdep: disable_irq_nosync_lockdep.*() for PREEMPT_RT Sebastian Andrzej Siewior
  2 siblings, 2 replies; 14+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-02-12 10:36 UTC (permalink / raw)
  To: linux-rt-devel, linux-kernel
  Cc: Peter Zijlstra, Ingo Molnar, Will Deacon, Boqun Feng, Waiman Long,
	Guenter Roeck, Clark Williams, Steven Rostedt,
	Sebastian Andrzej Siewior

disable_irq_lockdep() has no users, last one was probabaly removed in
   0b7c874348ea1 ("forcedeth: fix unilateral interrupt disabling in netpoll path")

Remove disable_irq_lockdep().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 include/linux/interrupt.h | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index a1b1be9bf73b2..c782a74d2a304 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -461,14 +461,6 @@ static inline void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned
 #endif
 }
 
-static inline void disable_irq_lockdep(unsigned int irq)
-{
-	disable_irq(irq);
-#ifdef CONFIG_LOCKDEP
-	local_irq_disable();
-#endif
-}
-
 static inline void enable_irq_lockdep(unsigned int irq)
 {
 #if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/2] lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*()
  2025-02-12 10:36   ` [PATCH 1/2] lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*() Sebastian Andrzej Siewior
@ 2025-02-12 14:11     ` Guenter Roeck
  2025-02-12 14:49     ` Steven Rostedt
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: Guenter Roeck @ 2025-02-12 14:11 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-rt-devel, linux-kernel, Peter Zijlstra, Ingo Molnar,
	Will Deacon, Boqun Feng, Waiman Long, Clark Williams,
	Steven Rostedt

On Wed, Feb 12, 2025 at 11:36:18AM +0100, Sebastian Andrzej Siewior wrote:
> disable_irq_nosync_lockdep() disables interrupts with lockdep enabled to
> avoid false positive reports by lockdep that a certain lock has not been
> acquired with disabled interrupts. The user of this macros expects that
> a lock can be acquried without disabling interrupts because the IRQ line
> triggering the interrupt is disabled.
> 
> This triggers a warning on PREEMPT_RT because after
> disable_irq_nosync_lockdep.*() the following spinlock_t now is acquired
> with disabled interrupts.
> 
> On PREEMPT_RT there is no difference between spin_lock() and
> spin_lock_irq() so avoiding disabling interrupts in this case works for
> the two remaining callers as of today.
> 
> Don't disable interrupts on PREEMPT_RT in disable_irq_nosync_lockdep.*().
> 
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Closes: https://lore.kernel.org/760e34f9-6034-40e0-82a5-ee9becd24438@roeck-us.net
> Fixes: e8106b941ceab ("[PATCH] lockdep: core, add enable/disable_irq_irqsave/irqrestore() APIs")
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Tested-by: Guenter Roeck <linux@roeck-us.net>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/2] lockdep: Remove disable_irq_lockdep().
  2025-02-12 10:36   ` [PATCH 2/2] lockdep: Remove disable_irq_lockdep() Sebastian Andrzej Siewior
@ 2025-02-12 14:11     ` Guenter Roeck
  2025-03-14 20:23     ` [tip: locking/core] " tip-bot2 for Sebastian Andrzej Siewior
  1 sibling, 0 replies; 14+ messages in thread
From: Guenter Roeck @ 2025-02-12 14:11 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-rt-devel, linux-kernel, Peter Zijlstra, Ingo Molnar,
	Will Deacon, Boqun Feng, Waiman Long, Clark Williams,
	Steven Rostedt

On Wed, Feb 12, 2025 at 11:36:19AM +0100, Sebastian Andrzej Siewior wrote:
> disable_irq_lockdep() has no users, last one was probabaly removed in
>    0b7c874348ea1 ("forcedeth: fix unilateral interrupt disabling in netpoll path")
> 
> Remove disable_irq_lockdep().
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/2] lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*()
  2025-02-12 10:36   ` [PATCH 1/2] lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*() Sebastian Andrzej Siewior
  2025-02-12 14:11     ` Guenter Roeck
@ 2025-02-12 14:49     ` Steven Rostedt
  2025-02-21 17:12     ` Boqun Feng
  2025-03-14 20:23     ` [tip: locking/core] " tip-bot2 for Sebastian Andrzej Siewior
  3 siblings, 0 replies; 14+ messages in thread
From: Steven Rostedt @ 2025-02-12 14:49 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-rt-devel, linux-kernel, Peter Zijlstra, Ingo Molnar,
	Will Deacon, Boqun Feng, Waiman Long, Guenter Roeck,
	Clark Williams

On Wed, 12 Feb 2025 11:36:18 +0100
Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:

> disable_irq_nosync_lockdep() disables interrupts with lockdep enabled to
> avoid false positive reports by lockdep that a certain lock has not been
> acquired with disabled interrupts. The user of this macros expects that
> a lock can be acquried without disabling interrupts because the IRQ line
> triggering the interrupt is disabled.
> 
> This triggers a warning on PREEMPT_RT because after
> disable_irq_nosync_lockdep.*() the following spinlock_t now is acquired
> with disabled interrupts.
> 
> On PREEMPT_RT there is no difference between spin_lock() and
> spin_lock_irq() so avoiding disabling interrupts in this case works for
> the two remaining callers as of today.
> 
> Don't disable interrupts on PREEMPT_RT in disable_irq_nosync_lockdep.*().
> 
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Closes: https://lore.kernel.org/760e34f9-6034-40e0-82a5-ee9becd24438@roeck-us.net
> Fixes: e8106b941ceab ("[PATCH] lockdep: core, add enable/disable_irq_irqsave/irqrestore() APIs")
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  include/linux/interrupt.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
> index 8cd9327e4e78d..a1b1be9bf73b2 100644
> --- a/include/linux/interrupt.h
> +++ b/include/linux/interrupt.h
> @@ -448,7 +448,7 @@ irq_calc_affinity_vectors(unsigned int minvec, unsigned int maxvec,
>  static inline void disable_irq_nosync_lockdep(unsigned int irq)
>  {
>  	disable_irq_nosync(irq);
> -#ifdef CONFIG_LOCKDEP
> +#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)

Hmm, should you also add a:

Suggested-by: Steven Rostedt (Google) <rostedt@goodmis.org>

?

  https://lore.kernel.org/all/20250211182113.4875751a@gandalf.local.home/

    ;-)

-- Steve

>  	local_irq_disable();
>  #endif
>  }

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/2] lockdep: disable_irq_nosync_lockdep.*() for PREEMPT_RT.
  2025-02-12 10:36 ` [PATCH 0/2] lockdep: disable_irq_nosync_lockdep.*() for PREEMPT_RT Sebastian Andrzej Siewior
  2025-02-12 10:36   ` [PATCH 1/2] lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*() Sebastian Andrzej Siewior
  2025-02-12 10:36   ` [PATCH 2/2] lockdep: Remove disable_irq_lockdep() Sebastian Andrzej Siewior
@ 2025-02-21 16:35   ` Sebastian Andrzej Siewior
  2 siblings, 0 replies; 14+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-02-21 16:35 UTC (permalink / raw)
  To: linux-rt-devel, linux-kernel
  Cc: Peter Zijlstra, Ingo Molnar, Will Deacon, Boqun Feng, Waiman Long,
	Guenter Roeck, Clark Williams, Steven Rostedt

On 2025-02-12 11:36:17 [+0100], To linux-rt-devel@lists.linux.dev wrote:
> Guenter reported a sleeping-while-atomic warning on PREEMPT_RT with the
> NE2K card. Turns out it is a questionable construct which requires
> lockdep tweak to not get reported. It was added long time ago to deal
> with the NE2K and has today two users.

ping.

Sebastian

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/2] lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*()
  2025-02-12 10:36   ` [PATCH 1/2] lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*() Sebastian Andrzej Siewior
  2025-02-12 14:11     ` Guenter Roeck
  2025-02-12 14:49     ` Steven Rostedt
@ 2025-02-21 17:12     ` Boqun Feng
  2025-03-14 20:23     ` [tip: locking/core] " tip-bot2 for Sebastian Andrzej Siewior
  3 siblings, 0 replies; 14+ messages in thread
From: Boqun Feng @ 2025-02-21 17:12 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-rt-devel, linux-kernel, Peter Zijlstra, Ingo Molnar,
	Will Deacon, Waiman Long, Guenter Roeck, Clark Williams,
	Steven Rostedt

On Wed, Feb 12, 2025 at 11:36:18AM +0100, Sebastian Andrzej Siewior wrote:
> disable_irq_nosync_lockdep() disables interrupts with lockdep enabled to
> avoid false positive reports by lockdep that a certain lock has not been
> acquired with disabled interrupts. The user of this macros expects that
> a lock can be acquried without disabling interrupts because the IRQ line
> triggering the interrupt is disabled.
> 
> This triggers a warning on PREEMPT_RT because after
> disable_irq_nosync_lockdep.*() the following spinlock_t now is acquired
> with disabled interrupts.
> 
> On PREEMPT_RT there is no difference between spin_lock() and
> spin_lock_irq() so avoiding disabling interrupts in this case works for
> the two remaining callers as of today.
> 
> Don't disable interrupts on PREEMPT_RT in disable_irq_nosync_lockdep.*().
> 
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Closes: https://lore.kernel.org/760e34f9-6034-40e0-82a5-ee9becd24438@roeck-us.net
> Fixes: e8106b941ceab ("[PATCH] lockdep: core, add enable/disable_irq_irqsave/irqrestore() APIs")

Is this "Fixes" tag accurate? IIUC, the issue only exists after
CONFIG_PREEMPT_RT is introduced from mainline POV. Or we want this to be
backported in older stable kernels predating CONFIG_PREEMPT_RT?

Regards,
Boqun

> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  include/linux/interrupt.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
> index 8cd9327e4e78d..a1b1be9bf73b2 100644
> --- a/include/linux/interrupt.h
> +++ b/include/linux/interrupt.h
> @@ -448,7 +448,7 @@ irq_calc_affinity_vectors(unsigned int minvec, unsigned int maxvec,
>  static inline void disable_irq_nosync_lockdep(unsigned int irq)
>  {
>  	disable_irq_nosync(irq);
> -#ifdef CONFIG_LOCKDEP
> +#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
>  	local_irq_disable();
>  #endif
>  }
> @@ -456,7 +456,7 @@ static inline void disable_irq_nosync_lockdep(unsigned int irq)
>  static inline void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned long *flags)
>  {
>  	disable_irq_nosync(irq);
> -#ifdef CONFIG_LOCKDEP
> +#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
>  	local_irq_save(*flags);
>  #endif
>  }
> @@ -471,7 +471,7 @@ static inline void disable_irq_lockdep(unsigned int irq)
>  
>  static inline void enable_irq_lockdep(unsigned int irq)
>  {
> -#ifdef CONFIG_LOCKDEP
> +#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
>  	local_irq_enable();
>  #endif
>  	enable_irq(irq);
> @@ -479,7 +479,7 @@ static inline void enable_irq_lockdep(unsigned int irq)
>  
>  static inline void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long *flags)
>  {
> -#ifdef CONFIG_LOCKDEP
> +#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
>  	local_irq_restore(*flags);
>  #endif
>  	enable_irq(irq);
> -- 
> 2.47.2
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [tip: locking/core] lockdep: Remove disable_irq_lockdep()
  2025-02-12 10:36   ` [PATCH 2/2] lockdep: Remove disable_irq_lockdep() Sebastian Andrzej Siewior
  2025-02-12 14:11     ` Guenter Roeck
@ 2025-03-14 20:23     ` tip-bot2 for Sebastian Andrzej Siewior
  1 sibling, 0 replies; 14+ messages in thread
From: tip-bot2 for Sebastian Andrzej Siewior @ 2025-03-14 20:23 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Sebastian Andrzej Siewior, Peter Zijlstra (Intel), Guenter Roeck,
	x86, linux-kernel

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     35e6b537af85d97e0aafd8f2829dfa884a22df20
Gitweb:        https://git.kernel.org/tip/35e6b537af85d97e0aafd8f2829dfa884a22df20
Author:        Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate:    Wed, 12 Feb 2025 11:36:19 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 14 Mar 2025 21:13:20 +01:00

lockdep: Remove disable_irq_lockdep()

disable_irq_lockdep() has no users, last one was probabaly removed in
   0b7c874348ea1 ("forcedeth: fix unilateral interrupt disabling in netpoll path")

Remove disable_irq_lockdep().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20250212103619.2560503-3-bigeasy@linutronix.de
---
 include/linux/interrupt.h | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index a1b1be9..c782a74 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -461,14 +461,6 @@ static inline void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned
 #endif
 }
 
-static inline void disable_irq_lockdep(unsigned int irq)
-{
-	disable_irq(irq);
-#ifdef CONFIG_LOCKDEP
-	local_irq_disable();
-#endif
-}
-
 static inline void enable_irq_lockdep(unsigned int irq)
 {
 #if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [tip: locking/core] lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*()
  2025-02-12 10:36   ` [PATCH 1/2] lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*() Sebastian Andrzej Siewior
                       ` (2 preceding siblings ...)
  2025-02-21 17:12     ` Boqun Feng
@ 2025-03-14 20:23     ` tip-bot2 for Sebastian Andrzej Siewior
  3 siblings, 0 replies; 14+ messages in thread
From: tip-bot2 for Sebastian Andrzej Siewior @ 2025-03-14 20:23 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Guenter Roeck, Steven Rostedt (Google), Sebastian Andrzej Siewior,
	Peter Zijlstra (Intel), x86, linux-kernel

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     87886b32d669abc11c7be95ef44099215e4f5788
Gitweb:        https://git.kernel.org/tip/87886b32d669abc11c7be95ef44099215e4f5788
Author:        Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate:    Wed, 12 Feb 2025 11:36:18 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 14 Mar 2025 21:13:20 +01:00

lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*()

disable_irq_nosync_lockdep() disables interrupts with lockdep enabled to
avoid false positive reports by lockdep that a certain lock has not been
acquired with disabled interrupts. The user of this macros expects that
a lock can be acquried without disabling interrupts because the IRQ line
triggering the interrupt is disabled.

This triggers a warning on PREEMPT_RT because after
disable_irq_nosync_lockdep.*() the following spinlock_t now is acquired
with disabled interrupts.

On PREEMPT_RT there is no difference between spin_lock() and
spin_lock_irq() so avoiding disabling interrupts in this case works for
the two remaining callers as of today.

Don't disable interrupts on PREEMPT_RT in disable_irq_nosync_lockdep.*().

Closes: https://lore.kernel.org/760e34f9-6034-40e0-82a5-ee9becd24438@roeck-us.net
Fixes: e8106b941ceab ("[PATCH] lockdep: core, add enable/disable_irq_irqsave/irqrestore() APIs")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Suggested-by: "Steven Rostedt (Google)" <rostedt@goodmis.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20250212103619.2560503-2-bigeasy@linutronix.de
---
 include/linux/interrupt.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 8cd9327..a1b1be9 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -448,7 +448,7 @@ irq_calc_affinity_vectors(unsigned int minvec, unsigned int maxvec,
 static inline void disable_irq_nosync_lockdep(unsigned int irq)
 {
 	disable_irq_nosync(irq);
-#ifdef CONFIG_LOCKDEP
+#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
 	local_irq_disable();
 #endif
 }
@@ -456,7 +456,7 @@ static inline void disable_irq_nosync_lockdep(unsigned int irq)
 static inline void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned long *flags)
 {
 	disable_irq_nosync(irq);
-#ifdef CONFIG_LOCKDEP
+#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
 	local_irq_save(*flags);
 #endif
 }
@@ -471,7 +471,7 @@ static inline void disable_irq_lockdep(unsigned int irq)
 
 static inline void enable_irq_lockdep(unsigned int irq)
 {
-#ifdef CONFIG_LOCKDEP
+#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
 	local_irq_enable();
 #endif
 	enable_irq(irq);
@@ -479,7 +479,7 @@ static inline void enable_irq_lockdep(unsigned int irq)
 
 static inline void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long *flags)
 {
-#ifdef CONFIG_LOCKDEP
+#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
 	local_irq_restore(*flags);
 #endif
 	enable_irq(irq);

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-03-14 20:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-11 16:12 Backtrace seen when enabling PREEMPT_RT Guenter Roeck
2025-02-11 17:22 ` Steven Rostedt
2025-02-11 22:54   ` Guenter Roeck
2025-02-11 23:21     ` Steven Rostedt
2025-02-12 10:36 ` [PATCH 0/2] lockdep: disable_irq_nosync_lockdep.*() for PREEMPT_RT Sebastian Andrzej Siewior
2025-02-12 10:36   ` [PATCH 1/2] lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*() Sebastian Andrzej Siewior
2025-02-12 14:11     ` Guenter Roeck
2025-02-12 14:49     ` Steven Rostedt
2025-02-21 17:12     ` Boqun Feng
2025-03-14 20:23     ` [tip: locking/core] " tip-bot2 for Sebastian Andrzej Siewior
2025-02-12 10:36   ` [PATCH 2/2] lockdep: Remove disable_irq_lockdep() Sebastian Andrzej Siewior
2025-02-12 14:11     ` Guenter Roeck
2025-03-14 20:23     ` [tip: locking/core] " tip-bot2 for Sebastian Andrzej Siewior
2025-02-21 16:35   ` [PATCH 0/2] lockdep: disable_irq_nosync_lockdep.*() for PREEMPT_RT Sebastian Andrzej Siewior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.