Re: [PATCH net-next 1/1] Separate locks for rmbs/sndbufs linked lists of different lengths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


> +}
> +
> +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)
>  {




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux