From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E989EC49EAB for ; Mon, 28 Jun 2021 06:43:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D006C619B6 for ; Mon, 28 Jun 2021 06:43:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232139AbhF1Gp2 (ORCPT ); Mon, 28 Jun 2021 02:45:28 -0400 Received: from cloud48395.mywhc.ca ([173.209.37.211]:44328 "EHLO cloud48395.mywhc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230134AbhF1Gp0 (ORCPT ); Mon, 28 Jun 2021 02:45:26 -0400 Received: from modemcable064.203-130-66.mc.videotron.ca ([66.130.203.64]:33996 helo=[192.168.1.179]) by cloud48395.mywhc.ca with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1lxkyy-0002pP-Bf; Mon, 28 Jun 2021 02:43:00 -0400 Message-ID: Subject: Re: [PATCH v4] io_uring: reduce latency by reissueing the operation From: Olivier Langlois To: David Laight , 'Jens Axboe' , Pavel Begunkov , "io-uring@vger.kernel.org" , "linux-kernel@vger.kernel.org" Date: Mon, 28 Jun 2021 02:42:59 -0400 In-Reply-To: References: <9e8441419bb1b8f3c3fcc607b2713efecdef2136.1624364038.git.olivier@trillion01.com> <16c91f57-9b6f-8837-94af-f096d697f5fb@kernel.dk> Organization: Trillion01 Inc Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-06-25 at 08:15 +0000, David Laight wrote: > From: Jens Axboe > > Sent: 25 June 2021 01:45 > > > > 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. > > How much slower is it when the data to complete the read isn't > available? > > I suspect there are different workflows where that is almost > always true. > David, in the case that the data to complete isn't available, the request will be processed exactly as it was before the patch. Ideally through io_uring fast polling feature. If not possible because arming the poll has been aborted, the request will be punted to the io- wq. Greetings,