Netdev List
 help / color / mirror / Atom feed
From: Kai <KaiShen@linux.alibaba.com>
To: Tony Lu <tonylu@linux.alibaba.com>
Cc: kgraul@linux.ibm.com, wenjia@linux.ibm.com, jaka@linux.ibm.com,
	kuba@kernel.org, davem@davemloft.net, netdev@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org
Subject: Re: [PATCH net-next v3] net/smc: Use percpu ref for wr tx reference
Date: Mon, 13 Mar 2023 09:20:25 +0800	[thread overview]
Message-ID: <43cd6283-c8c4-7764-f828-39a59596e33c@linux.alibaba.com> (raw)
In-Reply-To: <ZAhHiZ5/3Q3dcL4c@TONYMAC-ALIBABA.local>



On 3/8/23 4:30 PM, Tony Lu wrote:
>> redis-benchmark on smc-r with atomic wr_tx_refcnt:
>> SET: 525817.62 requests per second, p50=0.087 msec
>> GET: 570841.44 requests per second, p50=0.087 msec
>>
>> redis-benchmark on the percpu_ref version:
>> SET: 539956.81 requests per second, p50=0.087 msec
>> GET: 587613.12 requests per second, p50=0.079 msec
> 
> Does the test data need to be refreshed?
> 
Will do.
>> diff --git a/net/smc/smc_core.h b/net/smc/smc_core.h
>> index 08b457c2d294..1645fba0d2d3 100644
>> --- a/net/smc/smc_core.h
>> +++ b/net/smc/smc_core.h
>> @@ -106,7 +106,10 @@ struct smc_link {
>>   	unsigned long		*wr_tx_mask;	/* bit mask of used indexes */
>>   	u32			wr_tx_cnt;	/* number of WR send buffers */
>>   	wait_queue_head_t	wr_tx_wait;	/* wait for free WR send buf */
>> -	atomic_t		wr_tx_refcnt;	/* tx refs to link */
>> +	struct {
>> +		struct percpu_ref	wr_tx_refs;
>> +	} ____cacheline_aligned_in_smp;
>> +	struct completion	tx_ref_comp;
> 
> For the variable names suffixed with wr_*_refs, should we continue to
> use wr_*_refcnt?
> 
> Thanks.
In my opinion, we can't get the count of the percpu reference until it 
we start to destroy it. So maybe using wr_*_refcnt here is more 
appropriate?

  reply	other threads:[~2023-03-13  1:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03  8:21 [PATCH net-next v3] net/smc: Use percpu ref for wr tx reference Kai
2023-03-08  8:30 ` Tony Lu
2023-03-13  1:20   ` Kai [this message]
2023-03-13  3:46     ` Kai

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=43cd6283-c8c4-7764-f828-39a59596e33c@linux.alibaba.com \
    --to=kaishen@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=jaka@linux.ibm.com \
    --cc=kgraul@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tonylu@linux.alibaba.com \
    --cc=wenjia@linux.ibm.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