From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from cloud48395.mywhc.ca (cloud48395.mywhc.ca [173.209.37.211]) (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 09FE28060F; Fri, 2 Feb 2024 20:20:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=173.209.37.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706905208; cv=none; b=JnF9F9rwcFIJsPZvNjMyMfpfaYTm0cFdUY2R7WyTNYJA1doIrb3CDQ7NsX+0ZotnN0visB8psbjwvMgjzW4G6sMSNZztVXhQoLtSJmhGfQKGsDnd7U6utfoeI8WCe02xn8McbyH4nHlFPkaTQBALRE2kZD2RuN+V9RIVdELjztA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706905208; c=relaxed/simple; bh=Evn1w5AGptPF1Z63kSmh93Q8mPIcfW2DAXEfIIjINrM=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=Ubw1+xLp4JoJmdAoCcLyE0pzez3Luvf9Nx95PMv7kugUSdIhTJRN4tbMIdapxT+UuH+YBBM74z/3YppXxYbav9K2PD8vA/SiganBXWYld0pSoWRhscNjQb7H+ZsC2di8JA8+j8LE4QDciZwX5rvmQRZ5FS4jUGg5saC63UFGDT4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=trillion01.com; spf=pass smtp.mailfrom=trillion01.com; arc=none smtp.client-ip=173.209.37.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=trillion01.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=trillion01.com Received: from [45.44.224.220] (port=57996 helo=[192.168.1.177]) by cloud48395.mywhc.ca with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rW017-0003tB-0c; Fri, 02 Feb 2024 15:20:05 -0500 Message-ID: <0ae91303c53aff4758bc07ee70add5c0f1ec524e.camel@trillion01.com> Subject: Re: [PATCH v15 0/7] io_uring: add napi busy polling support From: Olivier Langlois To: Jens Axboe , Stefan Roesch , io-uring@vger.kernel.org, kernel-team@fb.com Cc: ammarfaizi2@gnuweeb.org, netdev@vger.kernel.org, kuba@kernel.org Date: Fri, 02 Feb 2024 15:20:04 -0500 In-Reply-To: References: <20230608163839.2891748-1-shr@devkernel.io> <58bde897e724efd7771229734d8ad2fb58b3ca48.camel@trillion01.com> <2b238cec-ab1b-4160-8fb0-ad199e1d0306@kernel.dk> <45a21ffe4878d77acba01ec43005c80a83f0e31a.camel@trillion01.com> <34560e193660122ea142daa0fbeb381eb7b0eb6d.camel@trillion01.com> Autocrypt: addr=olivier@trillion01.com; prefer-encrypt=mutual; keydata=mQINBFYd0ycBEAC53xedP1NExPwtBnDkVuMZgRiLmWoQQ8U7vEwt6HVGSsMRHx9smD76i5rO/iCT6tDIpZoyJsTOh1h2NTn6ZkoFSn9lNOJksE77/n7HNaNxiBfvZHsuNuI53CkYFix9JhzP3tg5nV/401re30kRfA8OPivpnj6mZhU/9RTwjbVPPb8dPlm2gFLXwGPeDITgSRs+KJ0mM37fW8EatJs0a8J1Nk8wBvT7ce+S2lOrxDItra9pW3ukze7LMirwvdMRC5bdlw2Lz03b5NrOUq+Wxv7szn5Xr9f/HdaCH7baWNAO6H/O5LbJ3zndewokEmKk+oCIcXjaH0U6QK5gJoO+3Yt5dcTo92Vm3VMxzK2NPFXgpLa7lR9Ei0hzQ0zptyFFyftt9uV71kMHldaQaSfUTsu9dJbnS2kI/j+F2S1q6dgKi3DEm0ZRGvjsSGrkgPJ5T16GI1cS2iQntawdr0A1vfXiB9xZ1SMGxL/l6js9BVlIx/CBGOJ4L190QmxJlcAZ2VnQzrlramRUv01xb00I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wyUIR3MlCVipsAxhxiG7paZygB8dLSK6gWI4LvIpDXtWF0nHniYcfGVF4mlMJoujhzP+/4gZXPiVYIeFJIwTMF7Fp17wKAb3YpF9xlNfq9daxW7NX+H/1pa0X/tv94RlhLlDmshfahQiy8QFlAHYZ+00ANCsNmL04CUcEhKrNYo5p3LzthKSYPak9tRuPBjfgDajmkb6q6kOrYxDtxGoiDZ+UY8Chyaeu8hmi4LtMW6FaaYZesBz2IhKSBPQxhQ1kr0fI+B2jPnul0//8Y1jvm58avLk0u0sIuqsQ== Organization: Trillion01 Inc Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.2 Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud48395.mywhc.ca X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - trillion01.com X-Get-Message-Sender-Via: cloud48395.mywhc.ca: authenticated_id: olivier@trillion01.com X-Authenticated-Sender: cloud48395.mywhc.ca: olivier@trillion01.com X-Source: X-Source-Args: X-Source-Dir: On Wed, 2024-01-31 at 13:52 -0700, Jens Axboe wrote: > On 1/31/24 12:56 PM, Olivier Langlois wrote: > > On Wed, 2024-01-31 at 12:59 -0500, Olivier Langlois wrote: > > > On Wed, 2024-01-31 at 10:32 -0700, Jens Axboe wrote: > > > >=20 > > > > Thanks for testing! > > > >=20 > > > > Any chance that you could run some tests with and without NAPI > > > > that > > > > help > > > > validate that it actually works? That part is what I'm most > > > > interested > > > > in, not too worried about the stability of it as I have > > > > scrutinized > > > > it > > > > pretty close already. > > > >=20 > > >=20 > > > There is maybe a test that I can perform. The data that I receive > > > is > > > timestamped. I have a small test program that checks the age of > > > the > > > updates on their reception... > > >=20 > > > I would expect that it should be possible to perceive the busy > > > polling > > > effect by comparing the average update age with and without the > > > feature > > > enabled... > > >=20 > > > A word of warning... The service that my client is connecting to > > > has > > > relocated recently. I used to have an RTT of about 8mSec with it > > > to > > > about 400-500 mSec today... > > >=20 > > > because of the huge RTT, I am unsure that the test is going to be > > > conclusive at all... > > >=20 > > > However, I am also in the process of relocating my client closer > > > to > > > the > > > service. If you can wait a week or so, I should able to do that > > > test > > > with a RTT < 1 mSec... > > >=20 > > > Beside that, I could redo the same test that Stefan did with the > > > ping > > > client/server setup but would that test add any value to the > > > current > > > collective knowledge? > > >=20 > > > I'll do the update age test when I restart my client and I'll > > > report > > > back the result but my expectations aren't very high that it is > > > going > > > to be conclusive due to the huge RTT. > > >=20 > > >=20 > > As I expected, the busy polling difference in the update age test > > is so > > small compared to the RTT that the result is inconclusive, IMHO... > >=20 > > The number of collected updates to build the stats is 500. > >=20 > > System clocks are assumed to be synchronized and the RTT is the > > difference between the local time and the update timestamp. > > Actually, it may be more accurate to say that the displayed RTT > > values > > are in fact TT... > >=20 > > latency NO napi busy poll: > > [2024-01-31 11:28:34] INFO Main/processCollectedData rtt > > min/avg/max/mdev =3D 74.509/76.752/115.969/3.110 ms > >=20 > > latency napi busy poll: > > [2024-01-31 11:33:05] INFO Main/processCollectedData rtt > > min/avg/max/mdev =3D 75.347/76.740/134.588/1.648 ms > >=20 > > I'll redo the test once my RTT is closer to 1mSec. The relative > > gain > > should be more impressive... >=20 > Also happy to try and run it here, if you can share it? If not I have > some other stuff I can try as well, with netbench. >=20 I have redone my test with a fixed liburing lib that actually enable io_uring NAPI busy polling correctly and I have slightly more convincing result: latency NO napi busy poll (kernel v7.2.3): [2024-02-02 11:42:41] INFO Main/processCollectedData rtt min/avg/max/mdev =3D 73.089/75.142/107.169/2.954 ms latency napi busy poll (kernel v7.2.3): [2024-02-02 11:48:18] INFO Main/processCollectedData rtt min/avg/max/mdev =3D 72.862/73.878/124.536/1.288 ms FYI, I said that I could redo the test once I relocate my client to have a RTT < 1ms... I might not be able to do that. I might settle for an AWS VPS instead of a bare metal setup and when you are running the kernel on a VPS, AFAIK, the virtual Ethernet driver does not have NAPI...