Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp933525pxp; Wed, 9 Mar 2022 16:19:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpERyBlEFpScGAydY/aB/1NN0rA6oOmZPx2K8DoARm+aHbRTN/DXZKsf0BIvdCKjNKhEEw X-Received: by 2002:a17:902:ecc2:b0:151:dd64:c77a with SMTP id a2-20020a170902ecc200b00151dd64c77amr2131849plh.154.1646871560309; Wed, 09 Mar 2022 16:19:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646871560; cv=none; d=google.com; s=arc-20160816; b=OMbZrIW+mJij7jLHFZTxHF3W+Z1C2UmbCVsCRlg9v4qMrawIfn3ktVYnQdiF793/Tw fMUH/GX5PoGDNQs/W2oTUnPPoak0pUm7JAoCtZ1BBNjsnPwULZVMOUQ4ye3FJXU2CpN1 DhW1ONjd5fFnTAUbIKe4ZHQxgEp8xl1b+hfLHOPXVSd1SA3/iyO6B0eNBJZEEBKDoUA2 j4lMqtnkbV2AxmpS2YznES8Xn5bFw5md7BTT/854RkC6luSPIGiADS27GADeJse/cPoG SXJuNwAAyETXecredk0oy8OqWKJ9FS+mVviBwy8+oCGPqbXqPX5Y9ykEpJRnU9KqRW1q 8Z7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Yh83gLKF0p1HHh6qhQqRKF6fIAAp3Y2uQvxaiLyuPsU=; b=RLeq/VtiLt7Ao8HtiLkXl4ykHTFKQh2MTlrWct3pqgiOqJsZTsCKVvAIsZBVQUZb4g HuoBPAWm+YYWnY7xCn+2rYk6zoMENMk4QiLePxoj5uRB3pdiJu45Av2Jtn3AWUb8M7X1 pYS80F6VfUk/GUJEfYwz7ckT5KBO5YRl4qzDUFhEAjkLeBvBvuTo5w6rppAwRCEB0t+X GxmpCBi1OUEcWtdP+hq59asDcX8kPthhFelsoQgojJXJKOe2zF83JAWjJX8VfaX/YK6m Uy02jpFTM5uS3tY7NhQBNaC0ymmZlA6LImhLEdUFZNsWHuvnLE4ebWZjKBMcxoBT+wYH NiWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=xoNdTgj6; 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 b12-20020a056a000a8c00b004ce5f673049si3480646pfl.229.2022.03.09.16.19.03; Wed, 09 Mar 2022 16:19:20 -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; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=xoNdTgj6; 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 S236116AbiCIXoU (ORCPT + 99 others); Wed, 9 Mar 2022 18:44:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229897AbiCIXoS (ORCPT ); Wed, 9 Mar 2022 18:44:18 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA25CDCE10 for ; Wed, 9 Mar 2022 15:43:17 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id q19so3251895pgm.6 for ; Wed, 09 Mar 2022 15:43:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=Yh83gLKF0p1HHh6qhQqRKF6fIAAp3Y2uQvxaiLyuPsU=; b=xoNdTgj6Ln1Fby9YRHf9Xc9g24AUqIN6pmO1h5HBqRS9ulU7ojjZYPkKArHCMfPiJN sLNBnWD6YYNrisE38OEqgb5UEAnBLGj0yXzUlkYCwBlxeGa8UL7hDBf6sL70YuWcyfbd 3Q5ITx3tG/aIO6lNJMpXkB9lRHAMUR2l1eal5nMm7kJEpp2/TwZHM/whmAhP4P/MJE4i gHOhUndGPjMgyBJH3CQ2q54zvhhiTP4+JquA8FbQXpsXTntZykXiCW8Z8xr4YClA7QuM mEPF8g3jmgvDVnwkoy8cI4FIv2Vxr3jnC0ZMj1d/w5V9lbP/4jPSG4LDdBpy4W0ZvkI5 zMNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Yh83gLKF0p1HHh6qhQqRKF6fIAAp3Y2uQvxaiLyuPsU=; b=pD2tA++aXWsQJ69rT2hJd4SLVWbKcdaPSXiXQD36mMX526CNFMfny1W0MMeNSS8V33 Nu3aGEyRQZ+tZxDFcIkPpexkc2hW5SZ1v7j1k8fnIHDOA/ilXIpgxR3dTrCMk0tiN+A4 GQb7ZSYFH9+1PFNBRsnyPqXEH/RRQsHVDZvcgqmU6xdO3csx1Y78ihqkac9gbZ2ergW8 /FI05u/bS1gJc2jIh6kmRHzD1beC0KcyUOjK0cfn73txjpeHF52KB+68yvdV5YCqTrPi NFTBc9BdIC0q5oDzPMqGyd46iCjTMuz/4Qg3R5GTxbF12kc/pvkx4YmNuv+VJvd3eWij e6ig== X-Gm-Message-State: AOAM530nFxKx/3sfhjZR+oTlxfvvivcdTJtJbp3iZCNOfAx6nb9kDm1U LX8M52yr429Rv1pvqxpjYnHZvQ== X-Received: by 2002:a63:6b42:0:b0:37c:4e5c:a903 with SMTP id g63-20020a636b42000000b0037c4e5ca903mr1683809pgc.463.1646869397195; Wed, 09 Mar 2022 15:43:17 -0800 (PST) Received: from [192.168.1.100] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id k6-20020a056a00134600b004f755f386d8sm4100146pfu.87.2022.03.09.15.43.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Mar 2022 15:43:16 -0800 (PST) Message-ID: Date: Wed, 9 Mar 2022 16:43:15 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v5 1/2] io_uring: minor io_cqring_wait() optimization Content-Language: en-US To: Olivier Langlois , Pavel Begunkov Cc: Hao Xu , io-uring , linux-kernel References: <84513f7cc1b1fb31d8f4cb910aee033391d036b4.1646777484.git.olivier@trillion01.com> <7f39095c-1070-7a70-91a0-b0ccb33c368b@kernel.dk> <36cd0f716bda419f477c3256769f382a31461481.camel@trillion01.com> From: Jens Axboe In-Reply-To: <36cd0f716bda419f477c3256769f382a31461481.camel@trillion01.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,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 3/8/22 10:36 PM, Olivier Langlois wrote: > 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... Yeah ok, it does make sense in the context of patch 2. Thanks! -- Jens Axboe