mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-09-28 19:20:30 +00:00
net/smc: replace mutex rmbs_lock and sndbufs_lock with rw_semaphore
[ Upstream commitaff7bfed90] It's clear that rmbs_lock and sndbufs_lock are aims to protect the rmbs list or the sndbufs list. During connection establieshment, smc_buf_get_slot() will always be invoked, and it only performs read semantics in rmbs list and sndbufs list. Based on the above considerations, we replace mutex with rw_semaphore. Only smc_buf_get_slot() use down_read() to allow smc_buf_get_slot() run concurrently, other part use down_write() to keep exclusive semantics. Signed-off-by: D. Wythe <alibuda@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net> Stable-dep-of:833bac7ec3("net/smc: Fix setsockopt and sysctl to specify same buffer size again") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0fc3c55a3a
commit
206381cee9
3 changed files with 38 additions and 37 deletions
Loading…
Add table
Add a link
Reference in a new issue