在 2024/11/19 4:48, Kuniyuki Iwashima 写道: > From: liqiang <liqiang64@xxxxxxxxxx> > Date: Mon, 18 Nov 2024 21:21:47 +0800 >> @@ -596,10 +632,26 @@ static struct smc_buf_desc *smc_llc_get_next_rmb(struct smc_link_group *lgr, >> static struct smc_buf_desc *smc_llc_get_first_rmb(struct smc_link_group *lgr, >> int *buf_lst) >> { >> - *buf_lst = 0; >> + smc_llc_lock_in_turn(lgr->rmbs_lock, buf_lst, SMC_LLC_INTURN_LOCK_INIT); >> return smc_llc_get_next_rmb(lgr, buf_lst, NULL); >> } >> >> +static inline void smc_llc_bufs_wrlock_all(struct rw_semaphore *lock, int nums) >> +{ >> + int i = 0; >> + >> + for (; i < nums; i++) >> + down_write(&lock[i]); > > LOCKDEP will complain here. You may want to test with > CONFIG_PROVE_LOCKING=y Thanks for your reply, other implementations should be considered here. > > >> +} >> + >> +static inline void smc_llc_bufs_wrunlock_all(struct rw_semaphore *lock, int nums) >> +{ >> + int i = 0; >> + >> + for (; i < nums; i++) >> + up_write(&lock[i]); >> +} >> + >> static int smc_llc_fill_ext_v2(struct smc_llc_msg_add_link_v2_ext *ext, >> struct smc_link *link, struct smc_link *link_new) >> { > -- Cheers, Li Qiang