From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEF9BC48BE8 for ; Wed, 16 Jun 2021 12:48:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA21F61166 for ; Wed, 16 Jun 2021 12:48:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232897AbhFPMvB (ORCPT ); Wed, 16 Jun 2021 08:51:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232732AbhFPMvA (ORCPT ); Wed, 16 Jun 2021 08:51:00 -0400 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 526B5C06175F for ; Wed, 16 Jun 2021 05:48:54 -0700 (PDT) Received: by mail-ot1-x335.google.com with SMTP id j11-20020a9d738b0000b02903ea3c02ded8so2334432otk.5 for ; Wed, 16 Jun 2021 05:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=6HpoBlmpJ233t0Q6yG7oBMakkTPLqj6mc2Rb8mKRkQY=; b=IdkaaxAZAcwnbtDiscGZuZ1UEpjaIF4Vp5j2wQvhfhbCMOBIfkAKzT276rxgbwK3Az iXxK/r3JsPCsOy/rAR83WEIMzIfJcBKF6f66ez3MtL6djsOl+UQf8EXeoYBgO3b9dVuJ Sdody38CRrLU5TDxE2WlM3RF8tha3MSQAvk/8Ki7WTSqjp3jICePqn+0bCbYoVmWGhx0 t+vSPLwNnao8U0XiopWhONbo0xoJbbhzIQ5ljwb2cHmeAGOK/x9oOuLzvGqjx+7adScL HVQwP2PZq1UnAEwME3in4ViXbCJw30vIuZq+MKe8vSBNmbxHHyYXrqwj4n2udvnb8y0j azSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=6HpoBlmpJ233t0Q6yG7oBMakkTPLqj6mc2Rb8mKRkQY=; b=Om/lzdFCi5EXMWFj6eXt+jMUZuedGtGlXgXMm5/FUrZNrxy29i+ZboltwZVPOtMJZO DY7hJ8hDT3Vr0yZ0ORRYEnwiTqahEaRqqsPGvIa9D6qKtHVgxW0f7nQmrbkWMpq+SQ7P iOUEJp0CBeuFRSRWZbiyZf7ElRLje9t4eCsCa88p4PsNWnETtgoFXrzcwPtVpsl3gyPT L8sMs4c5SJiHxmuq1TEvlQZdVD8PAzT6XuOn9oxPFeDzv4pK5zSTSrep04/+t26zHJ2R 3oILtRV+enshDqPWUWYg9CJ0Wrukt0LWeA1intq8a247gA7AUw7ZSkW181iF/ZSTdtTX gFjA== X-Gm-Message-State: AOAM533v1XCM1kgqcIliliR6yok4taS5UsPukrpGvdBBQw3PBoTohRNQ GhC8bwBhkL6Ij7UYrE6pMUvkEcegSuGcVA== X-Google-Smtp-Source: ABdhPJxYpo/0EKi1vrLFU/GC3g7eh7t7hAFYcywIIDTCmJEeQ63H+5o3IDuR7o3+4BT/Xs2DxCHG+g== X-Received: by 2002:a9d:6d8c:: with SMTP id x12mr3920896otp.121.1623847733413; Wed, 16 Jun 2021 05:48:53 -0700 (PDT) Received: from [192.168.1.134] ([198.8.77.61]) by smtp.gmail.com with ESMTPSA id u10sm498207otj.75.2021.06.16.05.48.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Jun 2021 05:48:53 -0700 (PDT) Subject: Re: [PATCH] io_uring: reduce latency by reissueing the operation To: Olivier Langlois , Pavel Begunkov , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org References: <60c13bec.1c69fb81.f2c1e.6444SMTPIN_ADDED_MISSING@mx.google.com> From: Jens Axboe Message-ID: Date: Wed, 16 Jun 2021 06:48:52 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <60c13bec.1c69fb81.f2c1e.6444SMTPIN_ADDED_MISSING@mx.google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/9/21 4:08 PM, 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. I think this is obviously the right thing to do, but I'm not too crazy about the 'ret' pointer passed in. We could either add a proper return type instead of the bool and use that, or put the poll-or-queue-async into a helper that then only needs a bool return, and use that return value for whether to re-issue or not. Care to send an updated variant? -- Jens Axboe