Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1501755rdb; Mon, 19 Feb 2024 19:36:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWYBbjJ3BO+HgP2dG6spqFqeXzjcCTvcroVv00Ov//Mmb+NBGIQd1OxO3NtT4k6JdL5YY/4N9MHU0UOxEx+AuALJEPyAlow5zWTwp+6gw== X-Google-Smtp-Source: AGHT+IH3Y45hTqiQC6YdofLOezR722NFZYIUTSsQoVY22J/VLy4atEpkFOGHvmqEmz2SnCQwk3HA X-Received: by 2002:a05:6830:10d:b0:6e4:26c3:bbde with SMTP id i13-20020a056830010d00b006e426c3bbdemr12289310otp.33.1708400210244; Mon, 19 Feb 2024 19:36:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708400210; cv=pass; d=google.com; s=arc-20160816; b=fZp8G0U0Ze1kZQEI8dkfeHcm8GYMV932cPwcR518KPAPKDu+WS2/eg1eBL9g1HSTjZ Bw+2pur0/SetSbNrGyhQLFwP3vCbv+bJFI6BzQAxDr0TeElUII4ZwyslCeTMS40gA16/ 0HVdKOh9Rdi8SDS0V5x5YMLfo9B+1qWv0v6L6ikfzxdiVltufeRSTzLhnTe5cmw+Ln0D jtL1LpYc0936Gy4T73GpjDTv5PTDfvidhQSNnugfQLB3VcxngjDUTbnSsAyZgERcr/cj 6txGlEWuO/dAyIorqoHf9b3TjImIlasKo4SCXvxnH4/1yZiWL0gpZlPoohiSkwzjI0FL skWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=R/VW+J0LluQWcqmcYIaT+iX59/8UWwxw0zPEseH7/1A=; fh=R2LJav7NUBRX2CoWPDckhn3zRz8dtV6E4Qed6PygHq8=; b=eF+zZGV6N/vqjK+/ePrS9cq1oYiMzXmJCrkfxmfZNncFubQaJ/AY6FQVdsDAm7SbVS wICvrywNfm1fBIn7BjAB0Io7fAyZbN01XZkmY7xUA5p4wFkzzGl3eajWWV/9JcYxIn/y AF6BzCUkgpNKPwbqLPpbU2pnKslKJZneVXZKo9zt9vGyDZ4dtdAV0gtguk8NHwIP+hIn Uwscn2kvzfNv9EhtLXEs5k8IkgCdOa5Rr19EpLmWmvPQ9Zzqm8rwJK9FgW6N+GZRMXrn 053dfphQIv5xkTYP1cQIKcky41a5pfTJOIeMP2ohXnl86vBtS+2y1YHLYzfwRenWGYZe E2AQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=lvw5rR0n; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-72275-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72275-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c16-20020a637250000000b005d760c23e09si5552557pgn.146.2024.02.19.19.36.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 19:36:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72275-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=lvw5rR0n; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-72275-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72275-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A4ECCB218CA for ; Tue, 20 Feb 2024 03:36:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B7DC51033; Tue, 20 Feb 2024 03:36:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="lvw5rR0n" Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E74A481B3; Tue, 20 Feb 2024 03:36:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708400193; cv=none; b=O1FGLSjZBG/Eddq2YUfRT7SZ8dYxW3MpfoOejz0DTFhw58yREymPjp/4S1YIakM8LO9pw1I7A7QMQVxjAEGHyf0wU23Xpt70twjoiz8lAWfjQG0G1Gw14OZWfH481lSoUY0fKYRS+Chr32gghFzOgvJg3adEw3UbeGXFPC8XFNY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708400193; c=relaxed/simple; bh=aShSRLt3GevXA1Qx62ev9VFaOPlhkE/c4BBllw9Klyk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=frhOjJLnGhZfE63jOzgnu1tx7LxvJ1NoTi4EDRGq7c+1lT+pWgASbxkVmYXe7SnPr1V1j96fWral5Ljsg90zcbCCgjAmeb05PiqhK2U64b8yvarRz/rPuY/21TTKjFYv41smVwiAuDwPVTAPxkA1nLkXAVijAVhbXRPpo+UgTCI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=lvw5rR0n; arc=none smtp.client-ip=115.124.30.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1708400182; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=R/VW+J0LluQWcqmcYIaT+iX59/8UWwxw0zPEseH7/1A=; b=lvw5rR0nMV6BCpc2t3XXBrlKqbWk+WjYzGO2FrdY4o1GAN44lcWIpGTT1NVtKLEpNydcGcC12t/2W37HCH3MeSI0yUdN/YRaTQW54k8jWppOuiuIasdliJkmnE4z6xGDmLhpNnfxi+iJMo4+p80tugyDHW0sfaz3fPrFhbARNhk= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=guwen@linux.alibaba.com;NM=1;PH=DS;RN=18;SR=0;TI=SMTPD_---0W0v7u33_1708400180; Received: from 30.221.128.233(mailfrom:guwen@linux.alibaba.com fp:SMTPD_---0W0v7u33_1708400180) by smtp.aliyun-inc.com; Tue, 20 Feb 2024 11:36:21 +0800 Message-ID: <58f36cb7-7427-4ed7-9a8e-baaacdd774cb@linux.alibaba.com> Date: Tue, 20 Feb 2024 11:36:20 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next 14/15] net/smc: introduce loopback-ism DMB data copy control To: Wenjia Zhang , wintera@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, jaka@linux.ibm.com, Gerd Bayer Cc: borntraeger@linux.ibm.com, svens@linux.ibm.com, alibuda@linux.alibaba.com, tonylu@linux.alibaba.com, linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240111120036.109903-1-guwen@linux.alibaba.com> <20240111120036.109903-15-guwen@linux.alibaba.com> From: Wen Gu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024/2/16 22:25, Wenjia Zhang wrote: > > > On 11.01.24 13:00, Wen Gu wrote: >> This provides a way to {get|set} whether loopback-ism device supports >> merging sndbuf with peer DMB to eliminate data copies between them. >> >> echo 0 > /sys/devices/virtual/smc/loopback-ism/dmb_copy # support >> echo 1 > /sys/devices/virtual/smc/loopback-ism/dmb_copy # not support >> > Besides the same confusing as Niklas already mentioned, the name of the option looks not clear enough to what it means. > What about: > echo 1 > /sys/devices/virtual/smc/loopback-ism/nocopy_support # merge mode > echo 0 > /sys/devices/virtual/smc/loopback-ism/nocopy_support # copy mode > OK, if we decide to keep the knobs, I will improve the name. Thanks! >> The settings take effect after re-activating loopback-ism by: >> >> echo 0 > /sys/devices/virtual/smc/loopback-ism/active >> echo 1 > /sys/devices/virtual/smc/loopback-ism/active >> >> After this, the link group related to loopback-ism will be flushed and >> the sndbufs of subsequent connections will be merged or not merged with >> peer DMB. >> >> The motivation of this control is that the bandwidth will be highly >> improved when sndbuf and DMB are merged, but when virtually contiguous >> DMB is provided and merged with sndbuf, it will be concurrently accessed >> on Tx and Rx, then there will be a bottleneck caused by lock contention >> of find_vmap_area when there are many CPUs and CONFIG_HARDENED_USERCOPY >> is set (see link below). So an option is provided. >> >> Link: https://lore.kernel.org/all/238e63cd-e0e8-4fbf-852f-bc4d5bc35d5a@linux.alibaba.com/ >> Signed-off-by: Wen Gu >> --- > We tried some simple workloads, and the performance of the no-copy case was remarkable. Thus, we're wondering if it is > necessary to have the tunable setting in this loopback case? Or rather, why do we need the copy option? Is that because > of the bottleneck caused by using the combination of the no-copy and virtually contiguours DMA? Or at least let no-copy > as the default one. Yes, it is because the bottleneck caused by using the combination of the no-copy and virtual-DMB. If we have to use virtual-DMB and CONFIG_HARDENED_USERCOPY is set, then we may be forced to use copy mode in many CPUs environment, to get the good latency performance (the bandwidth performance still drop because of copy mode). But if we agree that physical-DMB is acceptable (it costs 1 physical buffer per conn side in loopback-ism no-copy mode, same as what sndbuf costs when using s390 ISM), then there is no such performance issue and the two knobs can be removed. (see also the reply for 13/15 patch [1]). [1] https://lore.kernel.org/netdev/442061eb-107a-421d-bc2e-13c8defb0f7b@linux.alibaba.com/ Thanks!