Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4973783pxj; Tue, 22 Jun 2021 12:07:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNXwldgOwr5/0bALkt1g3Qge9/TLEhhcF6DV7FxRLV87Fi5NEaEthmzbL2pOq1Y8dzPHBL X-Received: by 2002:a17:907:10d8:: with SMTP id rv24mr5535607ejb.542.1624388868572; Tue, 22 Jun 2021 12:07:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624388868; cv=none; d=google.com; s=arc-20160816; b=zyxeAxWd/Q38iDS4A3qurCJu6UBNv4d48GCNQDs5LzU7DdoCSajcmA9IGdQ7kSEiWj AUrF7wq1ZVdWIYted6rOMtDRQ6MOvcxk60kfr++c6MMqBjG21RWGC9wT2DisK+rfvj1P mkk/1ZHHSFiPZZF6EUL4IIhWppfvti6nmdVqyOnjwkcuKmq3aseM5wqm/Yb1R4/23hGH 7LwuJ45RSsp2kMO0u+HOPfecB2EyZAEpJ6tAKa1hxvGfEP0Tnqr0yeJgDDgr7SMi4Yab k9aMMcatL4pJ05kl6q3BuPmUnXP2pNGuesbpEdq2ZC64rTsEEQRXX2OvE5ntpcHidDBQ Yadg== 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=NbgA8QIx+XqhCi0SORr4fbmWID+tgg6d06A5tQns5GE=; b=C9ptNd9OGOydaSOXoZ6pbKa5HKupWew36+UMI+WDHemNtuEUd9xPJ2Hs+2w5mmZ6A/ AU4VCAZYHjbUW2vKfLBdfoQmN7XVkRpDvzIDzXtsdelsUumBDRgX89Xlcw9zJaVJcOd0 /Dm2Xftg1EEHurtHbQxaHLsSJnh2Eh2LwYJN04zmV8Fhd5Cs4TioCep9VpUMNI0rkyaF NiI0I/tuSN/LpiaXvd/fvRobOU5FjBVF6Z10dgdBbGb/HkJ4f7zDCF36VBPAr5bVzoz1 ImflvKj8cT4SEj5hl4g5j+7SVkLINqijHN97X9nYnrgO/oaGF5qxScWeLPH1caHqv+pn VcqA== 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 c16si20141403edt.599.2021.06.22.12.07.25; Tue, 22 Jun 2021 12:07: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 S232713AbhFVTIN (ORCPT + 99 others); Tue, 22 Jun 2021 15:08:13 -0400 Received: from cloud48395.mywhc.ca ([173.209.37.211]:56562 "EHLO cloud48395.mywhc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230146AbhFVTIM (ORCPT ); Tue, 22 Jun 2021 15:08:12 -0400 Received: from modemcable064.203-130-66.mc.videotron.ca ([66.130.203.64]:33442 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 1lvlie-0003DP-3y; Tue, 22 Jun 2021 15:05:56 -0400 Message-ID: <32495917a028e9c70b75357029a87ca593378dde.camel@trillion01.com> Subject: Re: [PATCH v4] io_uring: reduce latency by reissueing the operation From: Olivier Langlois To: Pavel Begunkov , Jens Axboe , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 22 Jun 2021 15:05:55 -0400 In-Reply-To: <7c47078a-9e2d-badf-a47d-1ca78e1a3253@gmail.com> References: <9e8441419bb1b8f3c3fcc607b2713efecdef2136.1624364038.git.olivier@trillion01.com> <678deb93-c4a5-5a14-9687-9e44f0f00b5a@gmail.com> <7c47078a-9e2d-badf-a47d-1ca78e1a3253@gmail.com> Organization: Trillion01 Inc Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Tue, 2021-06-22 at 19:01 +0100, Pavel Begunkov wrote: > On 6/22/21 6:54 PM, Pavel Begunkov wrote: > > On 6/22/21 1:17 PM, Olivier Langlois wrote: > > > > > > > > ?static bool __io_poll_remove_one(struct io_kiocb *req, > > > @@ -6437,6 +6445,7 @@ static void __io_queue_sqe(struct io_kiocb > > > *req) > > > ????????struct io_kiocb *linked_timeout = > > > io_prep_linked_timeout(req); > > > ????????int ret; > > > ? > > > +issue_sqe: > > > ????????ret = io_issue_sqe(req, > > > IO_URING_F_NONBLOCK|IO_URING_F_COMPLETE_DEFER); > > > ? > > > ????????/* > > > @@ -6456,12 +6465,16 @@ static void __io_queue_sqe(struct > > > io_kiocb *req) > > > ????????????????????????io_put_req(req); > > > ????????????????} > > > ????????} else if (ret == -EAGAIN && !(req->flags & > > > REQ_F_NOWAIT)) { > > > -???????????????if (!io_arm_poll_handler(req)) { > > > +???????????????switch (io_arm_poll_handler(req)) { > > > +???????????????case IO_APOLL_READY: > > > +???????????????????????goto issue_sqe; > > > +???????????????case IO_APOLL_ABORTED: > > > ????????????????????????/* > > > ???????????????????????? * Queued up for async execution, worker > > > will release > > > ???????????????????????? * submit reference when the iocb is > > > actually submitted. > > > ???????????????????????? */ > > > ????????????????????????io_queue_async_work(req); > > > +???????????????????????break; > > > > Hmm, why there is a new break here? It will miscount > > @linked_timeout > > if you do that. Every io_prep_linked_timeout() should be matched > > with > > io_queue_linked_timeout(). > > Never mind, I said some nonsense and apparently need some coffee but this is a pertinant question, imho. I guess that you could get away without it since it is the last case of the switch statement... I am not sure what kernel coding standard says about that. However, I can tell you that there was also a break statement at the end of the case for IO_APOLL_READY and checkpatch.pl did complain about it saying that it was useless since it was following a goto statement. Therefore, I did remove that one. checkpatch.pl did remain silent about the other remaining break. Hence this is why I left it there. Greetings,