summaryrefslogtreecommitdiffstats
path: root/net/smc/smc_core.h
diff options
context:
space:
mode:
authorD. Wythe <alibuda@linux.alibaba.com>2023-02-02 16:26:39 +0800
committerDavid S. Miller <davem@davemloft.net>2023-02-04 09:48:19 +0000
commitb5dd4d6981717f7e2682c0419fe832328c7441cf (patch)
tree458a87fc5c1c6928070c097a341730dcc4633d05 /net/smc/smc_core.h
parent88c940cccbfd4bf8e16d50aa9dc0c15390cd17e5 (diff)
downloadlinux-b5dd4d6981717f7e2682c0419fe832328c7441cf.tar.gz
linux-b5dd4d6981717f7e2682c0419fe832328c7441cf.tar.bz2
linux-b5dd4d6981717f7e2682c0419fe832328c7441cf.zip
net/smc: llc_conf_mutex refactor, replace it with rw_semaphore
llc_conf_mutex was used to protect links and link related configurations in the same link group, for example, add or delete links. However, in most cases, the protected critical area has only read semantics and with no write semantics at all, such as obtaining a usable link or an available rmb_desc. This patch do simply code refactoring, replace mutex with rw_semaphore, replace mutex_lock with down_write and replace mutex_unlock with up_write. Theoretically, this replacement is equivalent, but after this patch, we can distinguish lock granularity according to different semantics of critical areas. Signed-off-by: D. Wythe <alibuda@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_core.h')
-rw-r--r--net/smc/smc_core.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/smc/smc_core.h b/net/smc/smc_core.h
index 285f9bd8e232..bd7198b72dc1 100644
--- a/net/smc/smc_core.h
+++ b/net/smc/smc_core.h
@@ -298,7 +298,7 @@ struct smc_link_group {
/* queue for llc events */
spinlock_t llc_event_q_lock;
/* protects llc_event_q */
- struct mutex llc_conf_mutex;
+ struct rw_semaphore llc_conf_mutex;
/* protects lgr reconfig. */
struct work_struct llc_add_link_work;
struct work_struct llc_del_link_work;