public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <liqiang64@huawei.com>
Cc: <alibuda@linux.alibaba.com>, <dengguangxing@huawei.com>,
	<dust.li@linux.alibaba.com>, <gaochao24@huawei.com>,
	<guwen@linux.alibaba.com>, <jaka@linux.ibm.com>,
	<linux-kernel@vger.kernel.org>, <linux-s390@vger.kernel.org>,
	<luanjianhai@huawei.com>, <netdev@vger.kernel.org>,
	<tonylu@linux.alibaba.com>, <wenjia@linux.ibm.com>,
	<zhangxuzhou4@huawei.com>, <kuniyu@amazon.com>
Subject: Re: [PATCH net-next 1/1] Separate locks for rmbs/sndbufs linked lists of different lengths
Date: Mon, 18 Nov 2024 12:48:31 -0800	[thread overview]
Message-ID: <20241118204831.70974-1-kuniyu@amazon.com> (raw)
In-Reply-To: <20241118132147.1614-2-liqiang64@huawei.com>

From: liqiang <liqiang64@huawei.com>
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)
>  {

  reply	other threads:[~2024-11-18 20:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-18 13:21 [PATCH net-next 0/1] net/smc: Optimize rmbs/sndbufs lock liqiang
2024-11-18 13:21 ` [PATCH net-next 1/1] Separate locks for rmbs/sndbufs linked lists of different lengths liqiang
2024-11-18 20:48   ` Kuniyuki Iwashima [this message]
2024-11-19  8:13     ` Li Qiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241118204831.70974-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=alibuda@linux.alibaba.com \
    --cc=dengguangxing@huawei.com \
    --cc=dust.li@linux.alibaba.com \
    --cc=gaochao24@huawei.com \
    --cc=guwen@linux.alibaba.com \
    --cc=jaka@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=liqiang64@huawei.com \
    --cc=luanjianhai@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=tonylu@linux.alibaba.com \
    --cc=wenjia@linux.ibm.com \
    --cc=zhangxuzhou4@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox