Bug 1905747
Summary: | kernel-rt-debug: WARNING: possible circular locking dependency detected(&serv->sv_lock -> (softirq_ctrl.lock).lock) | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Chunyu Hu <chuhu> |
Component: | kernel-rt | Assignee: | Wander <wcosta> |
kernel-rt sub component: | Locking | QA Contact: | Chunyu Hu <chuhu> |
Status: | CLOSED ERRATA | Docs Contact: | |
Severity: | low | ||
Priority: | unspecified | CC: | bhu, jlelli, kcarcia, lgoncalv, llong, mstowell, wcosta, williams |
Version: | 8.4 | Keywords: | Triaged |
Target Milestone: | rc | ||
Target Release: | 8.4 | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | kernel-rt-4.18.0-312.rt7.93.el8 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-11-09 17:28:30 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1954361, 1975917 | ||
Bug Blocks: | 1969483 |
Description
Chunyu Hu
2020-12-09 00:09:29 UTC
What happens in CPU 0: * svc_close_list acquires sv_lock (https://gitlab.com/redhat/rhel/src/kernel/rhel-8/-/blob/8.4-rt/net/sunrpc/svc_xprt.c#L1064) and calls svc_xprt_do_enqueue via svc_xprt_enqueue * svc_xprt_do_enqueue acquires sp_lock calling spin_lock_bh (https://gitlab.com/redhat/rhel/src/kernel/rhel-8/-/blob/8.4-rt/net/sunrpc/svc_xprt.c#L429) * spin_lock_bh eventually calls __local_bh_disable_ip * __local_bh_disable_ip acquires softirq_ctrl.lock (https://gitlab.com/redhat/rhel/src/kernel/rhel-8/-/blob/8.4-rt/kernel/softirq.c#L166) * spin_lock_bh then calls rt_spin_lock to acquire the lock passed to it In this scenario, the thread in the CPU 0 acquires locks in the following order: * sv_lock * softirq_ctrl.lock * sp_lock In CPU 1, svc_sock_update_bufs calls spin_lock_bh on sv_lock (https://gitlab.com/redhat/rhel/src/kernel/rhel-8/-/blob/8.4-rt/net/sunrpc/svcsock.c#L1205), so it will acquire softirq_ctrl.lock and then sv_lock, resulting in the following locking order: * softirq_ctrl.lock * sv_lock The opposite order of CPU 0, triggering the warning. However softirq_ctrl.lock is a per CPU lock, so in this case, it is a false positive. The remaining question (at least for me) is if the code enforces the correct behavior when the kernel schedules both threads in the same CPU. *** Bug 1928777 has been marked as a duplicate of this bug. *** Waiman, Juri and I was talking about this bug and we wonder if you see any problem in backporting BZ1954361 to 8.4 stock. I can do it if you agree. (In reply to Wander from comment #9) > Waiman, Juri and I was talking about this bug and we wonder if you see any > problem in backporting BZ1954361 to 8.4 stock. I can do it if you agree. I suppose that you want to backport the lockdep part of the 8.5 patchset. Right? I don't have any problem with that. Go the 8.4 BZ, set the z-stream? flag and post a comment on what patches to be backported. -Longman Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: kernel-rt security and bug fix update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:4140 |