Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3248524pxv; Sun, 27 Jun 2021 23:45:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2G1e4kZifFHSDLo0otSxiOiJgeHzwq3WfjGtEF2a5uYzEGaoGEVgY9bE2lGotW/Hw3h9t X-Received: by 2002:a17:907:62a1:: with SMTP id nd33mr22413152ejc.303.1624862748989; Sun, 27 Jun 2021 23:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624862748; cv=none; d=google.com; s=arc-20160816; b=cZ1a4BzKt10f3wc1U1U1VgZbNR1LaaW7wDA25mpBmOqDNM6deroDLyEyO7WVg7IrnL Xee83Vz3lidE2FxdUozKuMyITH6VuoNQozRl9ikZwjGu2YlMsr0r3PUT3p8KV/otHvVd ospBltQjCfS65UT6sjMH+IBCsLJ6vzdP8A6JNs5nE96ayahwi/sfH/DVGt2GMDJc3Rc1 8eg6M0VHYNB5dM2jRsBoNHerr4xi+atQ2hhAGN+tgquWzWhszdCjV9BuLdlc+q1fnQOL 0hAs9z7VujH46lzHronaDTLukncHmowolCAi4QiT0Q11jU9STHsS8I9IwdUGsXG9QAt0 rLEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:to:from:subject :message-id; bh=SkT4BKIKWXsGRtB4hwLJpJWochOSSsG1n6iMQOC88A8=; b=iaPdXOfbbZ89bkeDTMcxlVI1pkPsw+uyZSlhEfxYfVizP82seZrPyVoE2nLd7lfQTB +NKfaicJ/CcmhjFRCantoxVoIBKG7n1kkXG5jWN61KlKoZJBDyfDhJK+lbzk68x8Pg/C HOUAkdQ9CLPtH51419yeXamNsUIckHLClft5ANTMnTvVRPg0SPoixF07Ye7SACsaDy5d mWRkTOvj69eRETJyRZdExCljpoyQZc36hZ97pFdYqhBkgNdF6izjH8n1uyjgghXcziMr 0uvSKylzgVMdLXIt8nrN1XQiQnCQuNs9Uw8e4sf4NKrtCHAFHkFpvQpAHGq9r73U/WBW QU4Q== ARC-Authentication-Results: i=1; mx.google.com; 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 jx11si13059845ejc.470.2021.06.27.23.45.24; Sun, 27 Jun 2021 23:45:48 -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; 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 S231754AbhF1Gp1 (ORCPT + 99 others); Mon, 28 Jun 2021 02:45:27 -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,