]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Hyper-V: hn: Relinquish cpu in HN_LOCK to avoid deadlock
authorWei Hu <whu@FreeBSD.org>
Thu, 15 Oct 2020 11:44:28 +0000 (11:44 +0000)
committerWei Hu <whu@FreeBSD.org>
Mon, 15 Mar 2021 05:15:21 +0000 (05:15 +0000)
commit70f7b24753336efeb3cf6e73040780b2e4d28d8a
tree9a5ba429d4e98af53e9b4e1b231b8409d00a7f95
parent279041093326704636531051ad188e81b8beb32c
Hyper-V: hn: Relinquish cpu in HN_LOCK to avoid deadlock

The try lock loop in HN_LOCK put the thread spinning on cpu if the lock
is not available. It is possible to cause deadlock if the thread holding
the lock is sleeping. Relinquish the cpu to work around this problem even
it doesn't completely solve the issue. The priority inversion could cause
the livelock no matter how less likely it could happen. A more complete
solution may be needed in the future.

Reported by: Microsoft, Netapp
MFC after: 2 weeks
Sponsored by: Microsoft

(cherry picked from commit b3460f44524b145c6c8a760ebe65052560a810bf)
sys/dev/hyperv/netvsc/if_hn.c