Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3223071pxj; Sun, 20 Jun 2021 14:07:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqMD6OEGrw1whoBXRXCe9zBPyXc5W9jscBjjuBD/6Ke8gLPif2uJXeCRLmDrlUjSs3YPb8 X-Received: by 2002:a05:6402:350a:: with SMTP id b10mr18062311edd.238.1624223240077; Sun, 20 Jun 2021 14:07:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624223240; cv=none; d=google.com; s=arc-20160816; b=gtKuKQCLXqdX8j+17IUCtOnS4MbzRna1EoC4kBOAm9VpBtNmE8zr+hb/HDMdTqfmI2 weKQU1UQ3mU85nR/etHwW7n97TmukbQReR5DZzWD6qG91OQqhqdLU85U9vCIxG+SF7Nt vHpPK/pydof9I41Fs+sEBkTq8KcBi/Y7N3io06NPaJzry6pKTE0kUx5gJH3HepeIXRpq wGNZotQmA7BPLp1uNnNoe7eeb872L6wjCoZ43jJzvnbP7WMA5h084hkOo+aPbYDsinVx wM/12AAQrojloR/EqeBYYu8pLXp+GYJGqTL96VWkRdpYgISW/dfHzAO6nXLe7XOJbS6u nQ7A== 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=tJY+W8rS+Rg0yKQDNSFpCfA5EiiOpNiE0fkKk4pyhNI=; b=LMUIQR+O37pR4CVXe8dAN/RAPh1NQJthu3lbOPLfxsFI30ScsfdFO8tSL5TyEva42V qDNZEI9BTjGWz56fIt4thpQxfTpoSeOip+h4U97kV5MXjp4LcHYnklqNxtFVBoH6dz9x pN3JZF1IXWZ8gM883ybGkuF2H07PoSri6Lw8AQbJdjs7092KNGYGENjTEMY1OYy0XPbc 3JJgPtC2KNRoQBEvHqVEs6HWOoBzry5bKgD47NHnvCFlLnSVpcGd2BrUcwjwgZQPiUwe vFr/QQv1Z/jUIO1oPI4qoiV8804qf0fnTBMvkMn74ZjghnuU+2m6Lg1wy99r2IEw4668 xSKg== 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 ia24si5154328ejc.99.2021.06.20.14.06.57; Sun, 20 Jun 2021 14:07:20 -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 S230212AbhFTVID (ORCPT + 99 others); Sun, 20 Jun 2021 17:08:03 -0400 Received: from cloud48395.mywhc.ca ([173.209.37.211]:48598 "EHLO cloud48395.mywhc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230051AbhFTVIC (ORCPT ); Sun, 20 Jun 2021 17:08:02 -0400 Received: from modemcable064.203-130-66.mc.videotron.ca ([66.130.203.64]:33266 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 1lv4dZ-0000jM-6S; Sun, 20 Jun 2021 17:05:49 -0400 Message-ID: <86a768ba44d3d2009c313bd2b7ddf25e2a3f4b5e.camel@trillion01.com> Subject: Re: [PATCH v2] 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: Sun, 20 Jun 2021 17:05:48 -0400 In-Reply-To: <61668060-6401-ccc0-06e8-29d6320b720a@gmail.com> References: <61668060-6401-ccc0-06e8-29d6320b720a@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 Sun, 2021-06-20 at 20:56 +0100, Pavel Begunkov wrote: > On 6/20/21 8:05 PM, Olivier Langlois wrote: > > > > ? > > -static bool io_arm_poll_handler(struct io_kiocb *req) > > +#define IO_ARM_POLL_OK??? 0 > > +#define IO_ARM_POLL_ERR?? 1 > > +#define IO_ARM_POLL_READY 2 > > Please add a new line here. Can even be moved somewhere > to the top, but it's a matter of taste. If you let me decide, I prefer to let them close to where they are used. There is so much data definitions in the heading section that I feel like putting very minor implementation details to it might overwhelm newcomers instead of helping them to grasp the big picture. but I will add an extra space as you request > > Also, how about to rename it to apoll? io_uring internal > rw/send/recv polling is often abbreviated as such around > io_uring.c > IO_APOLL_OK and so on. no problem. I will. > > > +static int io_arm_poll_handler(struct io_kiocb *req) > > ?{ > > ????????const struct io_op_def *def = &io_op_defs[req->opcode]; > > ????????struct io_ring_ctx *ctx = req->ctx; > > @@ -5153,22 +5156,22 @@ static bool io_arm_poll_handler(struct > > io_kiocb *req) > > ????????int rw; > > ? > > ????????if (!req->file || !file_can_poll(req->file)) > > -???????????????return false; > > +???????????????return IO_ARM_POLL_ERR; > > It's not really an error. Maybe IO_APOLL_ABORTED or so? Ok.