From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Fyn/uU74; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id A8ED05A0265 for ; Tue, 21 Apr 2026 00:33:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776724400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xHkBCROSK14ae1ytFBX+lG4xn8xCR7BIBp4ExQUZf9o=; b=Fyn/uU74nfouxQNUalOxrqGZGqWqdKlIqAkQgM2prUCup8GAYk/OdkSZ0ZZXiyptp9gSdX OhIFTxzS+chY9HmWLv9lIIEujLulc4OzUSctd5dqJ1WF1ED7L0YSXI+dhmphJXOFOwVuQF v3/5p6bQBZ0tqTT28Vr0HVAB8QfLCo4= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-657-eaArB-0XMluNhY105cZU7w-1; Mon, 20 Apr 2026 18:33:19 -0400 X-MC-Unique: eaArB-0XMluNhY105cZU7w-1 X-Mimecast-MFC-AGG-ID: eaArB-0XMluNhY105cZU7w_1776724398 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-43d7b7bacddso2502370f8f.0 for ; Mon, 20 Apr 2026 15:33:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776724398; x=1777329198; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xHkBCROSK14ae1ytFBX+lG4xn8xCR7BIBp4ExQUZf9o=; b=BcRbWcB5esInA9PBNMenX4GMDJ7v90yKPUIc0qY7XCtFxUO2yXeKFdjXuDaDZf7Wf8 I3Qkr1cr56PhR+KOxlR+6nifxJWvhGFwF70BJDDQZpgI1ynuAYFDJMcpe+McRWGhVRmT 3q3KwQGDH4i5TdsJrXAUWysPExv+q5G2/jUdy1sGP6aCwXvguO9IN1DtH0DFAIrahTgh jgXYsJghx55tuOdjdnk2+f/XY6EEmTQCxKiayZSXRT2MpjvdwOKEGhz6+PghTyOWLKtP gC2G/idEYCA3vPNUNrLmMjGM+CpIiBVLr5BSbnEI09U/gcjc8Q1pG9Zh3YVHoNMkV0W2 iFKA== X-Gm-Message-State: AOJu0Yxshq6Mh0ouKm5DfpNTiWKMSoNpB/DVYUVRJGEJTy9Yca0b6qP1 VgvEk+FAPNR8bZHHnPkFr/q0B7joUgixcLrYrnVEFK2InOzTm8pXKT9dh7HiSF1AM4dHJonvHDZ H9XxoD6hkIRVmuZdgVn3cm0jE/i1ZRqLweWoJMll8QbkvyvbeQcd8fQ== X-Gm-Gg: AeBDiev0yNROQjQ/jlDsGKN1BQljhwPJpkLz5oqL7+rTjwbyetewArYUHTPoTjSI5gP INX4r+flbWylwLsNmpZNAR3ILCSwSTCMr2L+p1Uyx2RX/stbtsskDKj0KcffcvZWQ2I3N4jpUs8 ibwz9w5w91Ukje2Ma11rvv2ase9tIgxSCi7HKg0C9KG57NpzP3QjJwYSw/U8M4RCi8x9Omm6ogC YxD1f9MMVgX9BZDhnQugejYRCFh3ol2jg4Gjx+QJJFhAZfNH022R1TV0sxk7W8+aJcgAJ8+YuQA DmSwVoTCeQKTxFRHj0Lig+Lc7R6La2yfoBYhJ4n1KGnR8WV4x0+P7kysufsJx5D5QmWm3To7nLw B4pCayf/CkvUWvYyTPhM6YODJwQDzg8KdcH494kvZ36OmPjWshMna4f0TOaJz X-Received: by 2002:a5d:5f47:0:b0:43d:30d1:857c with SMTP id ffacd0b85a97d-43fe3dbd74bmr24465086f8f.7.1776724397926; Mon, 20 Apr 2026 15:33:17 -0700 (PDT) X-Received: by 2002:a5d:5f47:0:b0:43d:30d1:857c with SMTP id ffacd0b85a97d-43fe3dbd74bmr24465066f8f.7.1776724397432; Mon, 20 Apr 2026 15:33:17 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4cc2cacsm32446827f8f.13.2026.04.20.15.33.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2026 15:33:16 -0700 (PDT) From: Stefano Brivio To: Yumei Huang Subject: Re: [RFC PATCH] tcp: Replace send buffer boost with EPOLLOUT monitoring Message-ID: <20260421003315.39b5edde@elisabeth> In-Reply-To: <20260320103214.99320-1-yuhuang@redhat.com> References: <20260320103214.99320-1-yuhuang@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Tue, 21 Apr 2026 00:33:16 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: YKIKa8yX-Y_R0Pz1RQFhRfxb9S8XkZ8r5eaOroqRAic_1776724398 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: RZZ4QMTYD7UVGAQUVQIKJK7SRKKISI43 X-Message-ID-Hash: RZZ4QMTYD7UVGAQUVQIKJK7SRKKISI43 X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, david@gibson.dropbear.id.au X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Fri, 20 Mar 2026 18:32:14 +0800 Yumei Huang wrote: > Currently we use the SNDBUF boost mechanism to force TCP auto-tuning. > However, it doesn't always work, and sometimes causes a lot of > retransmissions. As a result, the throughput suffers. > > This patch replaces it with monitoring EPOLLOUT when sendmsg() failure > (with EAGAIN and EWOULDBLOCK) and partial sends occur. > > Tested with iperf3 inside pasta: throughput is now comparable to running > iperf3 directly on the host without pasta. However, retransmissions can > still be elevated when RTT >= 50ms. For example, when RTT is between > 200ms and 500ms, retransmission count varies from 30 to 120 in roughly > 80% of test runs. > > Link: https://bugs.passt.top/show_bug.cgi?id=138 > Suggested-by: Stefano Brivio > Signed-off-by: Yumei Huang > --- > tcp.c | 57 +++++++++++++++++---------------------------------------- > 1 file changed, 17 insertions(+), 40 deletions(-) Thanks a lot! This is definitely a massive improvement, and a much needed simplification over the original, so I applied this as it is (I also tested it quite thoroughly). I'm still looking into how we can replace the 75% to 100% linearly scaled usage factor from tcp_get_sndbuf() with a more accurate calculation (assuming it's doable), as a follow-up change, but even once/if we do that, properly reacting on EPOLLOUT as this patch adds is something we'll need anyway. -- Stefano