Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp99251pxp; Tue, 8 Mar 2022 21:38:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJy0tgBOv4gFoXCPPaUUKi7pVGCKbvxIywag5yMyCxJxJWPfya7mclNDoYmQ8g8lmB99neW0 X-Received: by 2002:a17:90a:4b4c:b0:1be:e5da:dc89 with SMTP id o12-20020a17090a4b4c00b001bee5dadc89mr8753640pjl.45.1646804282438; Tue, 08 Mar 2022 21:38:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646804282; cv=none; d=google.com; s=arc-20160816; b=j5X6kB/Xz/35BB9xbAosh2P+7+KDnv5KLr7wE7QNf6Z8YpBxSpEN7RDFrCDViw/utV 5YkcSuG75O9wFam5ezZG6H7fnWrMFSvSWbq0z0uj8kQ23+CyjHTfrcQ1UB/oOwsAvkWO 3eY2lwG5S+5WeCukxnxPU3c3XwPITHPGV/Xl2+FJAKssV3wXFuujBWUks6ukeljOmCqQ q9IhwPNuy8PlicT6bPzrsNPBweR45MZvTOQJQxb1SwuUq7ub8IPrfkqXLYFrYRM9Nk2w jeh5UtoiCFxuJ0h9Gqjt8m1xg3WJFuMUJ1j8EqdDCsFvQcoCfz/NzeUPkkZvRaYWAGLT sizg== 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:cc:to:from :subject:message-id; bh=vdeJnRBE/xujjFBJONTZJeogvEWs5pesdDNOl8Q1xCM=; b=0zMlMwKD+qVTvOKqqQuH7jsxNA4dd3iGwjqIHnQ5MQzAJzKy/ohEGNQLXTRWzFN4gm rNg6uEcrIrPtQnta1GxCZOnKay9v4crHhKZaN+kAB9Lv100NYoDglZZcfyFhDjmgY9Kg 8byJyP5V1zAiP+ZhEYjtqg9Bb4HVu8dW4t36MkmyDthUUlgyeH5pWVOs4KTuM74tSBBt oVfBYNpLwomchMWIrkXYqnIs3rlme7jEohEkctUK6uDbzfF5c3R+emGoMKSsTQJnyqAK 7pwXXDUtoJV8Kq6U9pA9y4Zghv5nLtUHJTL/9Z5VFGqsAuDEluUUiyvrjxCJGR5T7jxJ MkWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a15-20020a170902b58f00b0014d23053da0si912915pls.65.2022.03.08.21.37.45; Tue, 08 Mar 2022 21:38:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229717AbiCIFh7 (ORCPT + 99 others); Wed, 9 Mar 2022 00:37:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbiCIFhs (ORCPT ); Wed, 9 Mar 2022 00:37:48 -0500 Received: from cloud48395.mywhc.ca (cloud48395.mywhc.ca [173.209.37.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 452E414F280; Tue, 8 Mar 2022 21:36:50 -0800 (PST) Received: from [45.44.224.220] (port=34370 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 1nRp0C-0007Rd-NM; Wed, 09 Mar 2022 00:36:48 -0500 Message-ID: <36cd0f716bda419f477c3256769f382a31461481.camel@trillion01.com> Subject: Re: [PATCH v5 1/2] io_uring: minor io_cqring_wait() optimization From: Olivier Langlois To: Jens Axboe , Pavel Begunkov Cc: Hao Xu , io-uring , linux-kernel Date: Wed, 09 Mar 2022 00:36:47 -0500 In-Reply-To: <7f39095c-1070-7a70-91a0-b0ccb33c368b@kernel.dk> References: <84513f7cc1b1fb31d8f4cb910aee033391d036b4.1646777484.git.olivier@trillion01.com> <7f39095c-1070-7a70-91a0-b0ccb33c368b@kernel.dk> Organization: Trillion01 Inc Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.42.4 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: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2022-03-08 at 17:54 -0700, Jens Axboe wrote: > On 3/8/22 3:17 PM, Olivier Langlois wrote: > > Move up the block manipulating the sig variable to execute code > > that may encounter an error and exit first before continuing > > executing the rest of the function and avoid useless computations > > I don't think this is worthwhile doing. If you're hitting an error > in any of them, it's by definition not the fast path. > Well, by itself it is not a big improvement but it is still an improvement. but most importantly, it has to be considered in the context of the current patchset because in patch #2, the following step is to 1. acquire the napi spin lock 2. splice the context napi list into a local one. 3. release the lock If this patch is not in place before patch #2, you would need undo all that before returning from the sig block which would make the function bigger when all that is completely avoidable by accepting this patch... Both patches were together in v1 but I decided to break them apart thinking that this was the right thing to do...