From: Tony Lu <tonylu@linux.alibaba.com>
To: Guangguan Wang <guangguan.wang@linux.alibaba.com>
Cc: Stefan Raspl <raspl@linux.ibm.com>,
kgraul@linux.ibm.com, linux-s390@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kuba@kernel.org, davem@davemloft.net
Subject: Re: [RFC PATCH net-next] net/smc: Introduce receive queue flow control support
Date: Sat, 29 Jan 2022 12:24:47 +0800 [thread overview]
Message-ID: <YfTBj6o8fpcWAfpL@TonyMac-Alibaba> (raw)
In-Reply-To: <a297c8cf-384c-2184-aabb-49ee32476d99@linux.alibaba.com>
On Sat, Jan 29, 2022 at 11:43:22AM +0800, Guangguan Wang wrote:
>
> Yes, there are alternative ways, as RNR caused by the missmatch of send rate and receive rate, which means sending too fast
> or receiving too slow. What I have done in this patch is to backpressure the sending side when sending too fast.
>
> Another solution is to process and refill the receive queue as quickly as posibble, which requires no protocol-level change.
> The fllowing modifications are needed:
> - Enqueue cdc msgs to backlog queues instead of processing in rx tasklet. llc msgs remain unchanged.
It's a good idea to use backlog to free the work in softirq. Rx backlog
can help move the heavy logic out of softirq, and let extra kthread or
workqueue to handle it, then let kernel scheduler to deal with the
balance between userspace process and kthread.
There are two things to be careful, one for introducing more latency,
this should trade off latency and throughput, the other for backlog full.
> - A mempool is needed as cdc msgs are processed asynchronously. Allocate new receive buffers from mempool when refill receive queue.
Yes, we need a elastically expanding RX buffer, also elastically
shrinking. This looks like tcp_mem with tree elements to limit the
memory usage. We also need to free memory automatically, based on memcg
pressure is a good idea.
> - Schedule backlog queues to other cpus, which are calculated by 4-tuple or 5-tuple hash of the connections, to process the cdc msgs,
> in order to reduce the usage of the cpu where rx tasklet runs on.
I am wondering if it is need for now. In general, it should spread the
CPU usage to different cores. The memory usage or CPU usage which one
will reach its limitation before trigger RNR. Maybe there should some
data to support it?
Thank you,
Tony Lu
next prev parent reply other threads:[~2022-01-29 4:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-20 6:51 [RFC PATCH net-next] net/smc: Introduce receive queue flow control support Guangguan Wang
2022-01-20 8:24 ` Leon Romanovsky
2022-01-20 9:20 ` Guangguan Wang
2022-01-20 9:51 ` dust.li
2022-01-21 16:21 ` Guangguan Wang
2022-01-20 11:03 ` Karsten Graul
2022-01-21 16:36 ` Guangguan Wang
2022-01-20 14:22 ` Tony Lu
2022-01-21 16:48 ` Guangguan Wang
2022-01-25 9:42 ` Stefan Raspl
2022-01-29 3:43 ` Guangguan Wang
2022-01-29 4:24 ` Tony Lu [this message]
2022-01-31 12:56 ` Karsten Graul
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=YfTBj6o8fpcWAfpL@TonyMac-Alibaba \
--to=tonylu@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=guangguan.wang@linux.alibaba.com \
--cc=kgraul@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=raspl@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