Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp681040pxv; Thu, 24 Jun 2021 17:46:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYrkldkYi8iCrNhbogn67FnQ0/7BWsX3xSdSxop0y5pJFW/kaS/Pq1TfPCyqbMwHMgbFh4 X-Received: by 2002:a6b:ef07:: with SMTP id k7mr6514750ioh.16.1624581985724; Thu, 24 Jun 2021 17:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624581985; cv=none; d=google.com; s=arc-20160816; b=TEcjEipnPHxyamsSMkT+35gTiATyGq4M1mw2g/E9tYw09YlXtChy/Rha/KS2n1IaxZ 65rmL5WKKBJdQR1PtaOklYv8oNzWd7M1F5rTncK44DWKBgI9SF39WHgmGH4OBlpTkeBz xmhw4dNQqMtlqp8sUNjeTNScTQ/XUNNRnAI7A6bDEaDFhuhHNDgNI4t3wxk3teCjhk5X Yi3T560HYz9jM2wTGf2A8h/KNxIQOZSfmQv2N1ixQhWRo1YATq7Njcd0sMQvWFvL2XJH KbOd89pazTl39gNqT+WgoVPSgpFmQJuJNEsRa2+2/VZSspe3+CK5+qFsvB51yDvLiIdt RP6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=OgwpmCa+NGiSxZz9RWiJKCvZzwfB/ohD5NMjDOTctOY=; b=tkabYV80jAz53ezfehmbWQNTUKeEICJAdHnvEZwgJ63xuCXvWjawfX6FF3xpp/Max3 R44XzHXxniaSDzsnCQPgxaNcSRv81xdvxJq2uK74L4Ol/YGsbqbo7o6hyRWzqyWcn6TQ ABBPGJj3IbgIoS8FwHZbaIfkTineRBexhMKcPjGN06U1mpln/5Cn/Z2WjvN81e7FaAoL 05Q+4gQ8Tf+euAG7rzvmzxM+cbSDEKhP/BZ8CvzdW1tOPUYZ3K0YlBFfe0yS0cbDh0+3 y+m2QnSsSJRNIciN4pL4bF2/xW+JhaVz12N2p32mcYjHuH/llMBNIX7jCxHOr//mK0XN rpOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=oWOgFRre; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si4865588ilv.21.2021.06.24.17.46.13; Thu, 24 Jun 2021 17:46:25 -0700 (PDT) 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; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=oWOgFRre; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232729AbhFYAro (ORCPT + 99 others); Thu, 24 Jun 2021 20:47:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbhFYAro (ORCPT ); Thu, 24 Jun 2021 20:47:44 -0400 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4905FC061756 for ; Thu, 24 Jun 2021 17:45:24 -0700 (PDT) Received: by mail-io1-xd34.google.com with SMTP id k11so10619425ioa.5 for ; Thu, 24 Jun 2021 17:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=OgwpmCa+NGiSxZz9RWiJKCvZzwfB/ohD5NMjDOTctOY=; b=oWOgFRreIS+mHG14+LHjt1kSti9Ox9ff76J+4GC4bmLXEr9DRfn5RwTi/YHwIxph4i HkPwh4lLT4elGpQ99ioAK/s6YhcvWwYZb4V8pVDt0qyEGBdiPhFtCzt9oGn9fOV5Cccu viheBNKt4x8TMH7rpITCvnRLENeveGdYzjXRe5m4vIfJ3lvxVpNbmaCMxNxZZ6l0Xujo 6We6Ps+OC6sY/ONgMeGkU58RbCpFFSUrWof0hQXTKutyGQoJvge7OmYuQs1Qu2hGcdDf VrCZUexfPz65+aEu1r4cQmhNtDSURDHMio6TgyN7Cfd9zPOAUQMrMHphQhkDMv/WI3v1 1gSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OgwpmCa+NGiSxZz9RWiJKCvZzwfB/ohD5NMjDOTctOY=; b=XlcdHsgoaACJYt4YLe5aEmnEKtHxvmwXVvewvmGMG7ipwtkBCj3ftzvymOwIzX36aL pnphsTeF0g3tqiOC5ANnSZuxThP/mS/6uB9YlDRTtjn0Ra48huRjeLNrBfFcdm/OzYtw EwCAjZQB6HABmfDuKISj3JLdFahMn25Bo+bqd8ptHlStIMiI4O/dD7ibXZttDKrb89U9 fJnXN6BFvfGIVGA5xWIarOmZ9yXJiInzXafLe+rxh+OxTsNpw3gMGHXOaS1d/+26Rrit 14R++vOeb5qKy7fjGudxjy9fy3z6rZoWFCRcvtDwP21LfcDF1qoYEZyGu59bTnYZzliJ SV0w== X-Gm-Message-State: AOAM531FrEpTLrMQpOfHML4T3rKpm0tBZ9qVH3NLuTRHGYD+VcaCSaaE a9Mjye5lPsXGFhp0wzyghxdbtC/xyW3hRg== X-Received: by 2002:a05:6602:2433:: with SMTP id g19mr6468394iob.100.1624581923556; Thu, 24 Jun 2021 17:45:23 -0700 (PDT) Received: from [192.168.1.134] ([198.8.77.61]) by smtp.gmail.com with ESMTPSA id r6sm2128965ioh.27.2021.06.24.17.45.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Jun 2021 17:45:23 -0700 (PDT) Subject: Re: [PATCH v4] io_uring: reduce latency by reissueing the operation To: Olivier Langlois , Pavel Begunkov , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org References: <9e8441419bb1b8f3c3fcc607b2713efecdef2136.1624364038.git.olivier@trillion01.com> From: Jens Axboe Message-ID: <16c91f57-9b6f-8837-94af-f096d697f5fb@kernel.dk> Date: Thu, 24 Jun 2021 18:45:21 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <9e8441419bb1b8f3c3fcc607b2713efecdef2136.1624364038.git.olivier@trillion01.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/22/21 6:17 AM, Olivier Langlois wrote: > It is quite frequent that when an operation fails and returns EAGAIN, > the data becomes available between that failure and the call to > vfs_poll() done by io_arm_poll_handler(). > > Detecting the situation and reissuing the operation is much faster > than going ahead and push the operation to the io-wq. > > Performance improvement testing has been performed with: > Single thread, 1 TCP connection receiving a 5 Mbps stream, no sqpoll. > > 4 measurements have been taken: > 1. The time it takes to process a read request when data is already available > 2. The time it takes to process by calling twice io_issue_sqe() after vfs_poll() indicated that data was available > 3. The time it takes to execute io_queue_async_work() > 4. The time it takes to complete a read request asynchronously > > 2.25% of all the read operations did use the new path. > > ready data (baseline) > avg 3657.94182918628 > min 580 > max 20098 > stddev 1213.15975908162 > > reissue completion > average 7882.67567567568 > min 2316 > max 28811 > stddev 1982.79172973284 > > insert io-wq time > average 8983.82276995305 > min 3324 > max 87816 > stddev 2551.60056552038 > > async time completion > average 24670.4758861127 > min 10758 > max 102612 > stddev 3483.92416873804 > > Conclusion: > On average reissuing the sqe with the patch code is 1.1uSec faster and > in the worse case scenario 59uSec faster than placing the request on > io-wq > > On average completion time by reissuing the sqe with the patch code is > 16.79uSec faster and in the worse case scenario 73.8uSec faster than > async completion. Thanks for respinning with a (much) better commit message. Applied. -- Jens Axboe