Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1281262pxb; Fri, 21 Jan 2022 14:14:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJya5Ev4ZnpFostHYfJPME1y/NXlkPB4ku2OMa3qgOLT2r4ZVZontrgVbem4PVw2sJmGHuK6 X-Received: by 2002:a17:90b:1648:: with SMTP id il8mr2636482pjb.227.1642803291569; Fri, 21 Jan 2022 14:14:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642803291; cv=none; d=google.com; s=arc-20160816; b=lqHmUcos4jpweBB0T7xllS9oDGoTNN7ce+vNVW049Dzp6KUFaHNUHEPIQENtC3PsKa VbY6916ZkPxWWz9Qy5fGgmybCv6Ttf1KjsTrIdwiPB4n/uwSEnUnwLx88OEhEkV/cIMv C/Sbycfm4giYJ49BdDmHVGGM9rG0WPh6hayaUScLi+Ziti9kgk0bm/o28ct4x7uI5EuV sNAj2ND9wHkX3C90xUZYQ6Lxcyhzb9U7U1WHKck1EUsS++q0G0Ju1jJOeu3DtksDGc6M Y5ozzdDpbnpAzzW8r5Qq0nQ+o5eWfjIga9zct96SbQovQ4NFiZxIsUNwoGgj6/qo9ErY i+/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date; bh=xCja8rRAaJv0942bGxpnjlkqqorZm30uD9tVPZl/sWE=; b=Kz+vCbsvYDlXT4AoPqWyTzAi0URnYk3SaWKFEn4Spns/A4GbDBp57ErQjsmldciruQ DprDGWV/IDx7Qt+3p9zdVcQzZeYsZNjnu1b0MjNTnSFJVd8uvxJ3cLn2Hxp/RgCoGUUW Qrv9NPDlGo0DyeTh1GXW8H6lP8tRRCb+XrjnjQ/3tbcJOYU2GVVIEHyWkZiku0t1EqHx yTKSrSSKRo99I2+OJfElVgXlEeDg5dpzLUGVQcHOjWN+iY84bPcxhoFS35rPU6xb3soZ mrnRNXR2QHpUEHxokoS4zM1cPxo0C6RVrQVOuItp+bMZNp13HP7M6X5SHRbJrpdzWojp tsaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k7si6514897pll.543.2022.01.21.14.14.39; Fri, 21 Jan 2022 14:14:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345476AbiATOW2 (ORCPT + 99 others); Thu, 20 Jan 2022 09:22:28 -0500 Received: from out30-54.freemail.mail.aliyun.com ([115.124.30.54]:49231 "EHLO out30-54.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345781AbiATOWV (ORCPT ); Thu, 20 Jan 2022 09:22:21 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=tonylu@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0V2MYk2g_1642688537; Received: from localhost(mailfrom:tonylu@linux.alibaba.com fp:SMTPD_---0V2MYk2g_1642688537) by smtp.aliyun-inc.com(127.0.0.1); Thu, 20 Jan 2022 22:22:17 +0800 Date: Thu, 20 Jan 2022 22:22:16 +0800 From: Tony Lu To: Guangguan Wang Cc: kgraul@linux.ibm.com, davem@davemloft.net, kuba@kernel.org, linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH net-next] net/smc: Introduce receive queue flow control support Message-ID: Reply-To: Tony Lu References: <20220120065140.5385-1-guangguan.wang@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220120065140.5385-1-guangguan.wang@linux.alibaba.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 20, 2022 at 02:51:40PM +0800, Guangguan Wang wrote: > This implement rq flow control in smc-r link layer. QPs > communicating without rq flow control, in the previous > version, may result in RNR (reveive not ready) error, which > means when sq sends a message to the remote qp, but the > remote qp's rq has no valid rq entities to receive the message. > In RNR condition, the rdma transport layer may retransmit > the messages again and again until the rq has any entities, > which may lower the performance, especially in heavy traffic. > Using credits to do rq flow control can avoid the occurrence > of RNR. > > Test environment: > - CPU Intel Xeon Platinum 8 core, mem 32 GiB, nic Mellanox CX4. > - redis benchmark 6.2.3 and redis server 6.2.3. > - redis server: redis-server --save "" --appendonly no > --protected-mode no --io-threads 7 --io-threads-do-reads yes > - redis client: redis-benchmark -h 192.168.26.36 -q -t set,get > -P 1 --threads 7 -n 2000000 -c 200 -d 10 > > Before: > SET: 205229.23 requests per second, p50=0.799 msec > GET: 212278.16 requests per second, p50=0.751 msec > > After: > SET: 623674.69 requests per second, p50=0.303 msec > GET: 688326.00 requests per second, p50=0.271 msec > > The test of redis-benchmark shows that more than 3X rps > improvement after the implementation of rq flow control. There seems lots of RNR retransmission in your environment. If would be better to give out more benchmark data of different cases about this patch. For different scenarios, such as large packets, perhaps we can use more fine-grained flow control. > #include "smc_ib.h" > > -#define SMC_RMBS_PER_LGR_MAX 255 /* max. # of RMBs per link group */ > +#define SMC_RMBS_PER_LGR_MAX 32 /* max. # of RMBs per link group. Correspondingly, > + * SMC_WR_BUF_CNT should not be less than 2 * > + * SMC_RMBS_PER_LGR_MAX, since every connection at > + * least has two rq/sq credits in average, otherwise > + * may result in waiting for credits in sending process. > + */ This gives a fixed limit for per link group connections. Using tunable knobs to control this for different workload would be better. It also reduce the completion of free slots in the same link group and link. Thank you, Tony Lu