Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6170309rwr; Mon, 24 Apr 2023 15:07:17 -0700 (PDT) X-Google-Smtp-Source: AKy350ZQzPR2LZTGPvQ+vOT94L23Kw/tbv+L3KPi7FrsaurS84ZTRubKDGrR8dYH43RMuslDEYBn X-Received: by 2002:a17:90a:db0f:b0:247:1605:6e1a with SMTP id g15-20020a17090adb0f00b0024716056e1amr17468059pjv.0.1682374037121; Mon, 24 Apr 2023 15:07:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682374037; cv=none; d=google.com; s=arc-20160816; b=wuxawj6YNTqeMB3cqtGgcoaBmzhJDVufhJG+v5hwBtwOrNgnHKCK/do71l+o4WzaIT Z+tHbGmmC6TNTtzDNvLQNtRxZUVd8m6tcBFbkny9jAC2+E6M6m6+JV8pQldEPBOiTiLe 8TtZ/KZEjQY1S4Ye3pfHUM7GbBM6EWer+kf/zXPbfsSo6ZNULPvO8D54exKNTRzqPvW5 Ix9Knkwfcw85Dlu6mCGZn4Hg62LhePvXTO0HLGMFjVqd4nVyyqF6xeuf2ozHyzI1nzfE /JVMrjGXKWqM5nEGeSLcyL0ocrzDSsW9IBZDHvSoKCnRt5Dt/HkkCkBno2ERoIxK/SFt 1jxQ== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=BOc9YH+oGqwIpPSq5V/5aVKlMiMHqBjxPBRqWKmHOfA=; b=EibCjxPXS+f31Q1J3/Q+jPp5xRBaXtp461wyu0dZ+Vb4LDk2vqMVjO5gdxreAOd4iK pBMFRSbt5TijYcPh5u02+LC6Vm5+sOwzMOwYyJmPjYjUAKEpJTgwgVO5OoyCt6QgZ4e7 Gzrd6r0uXNYLTud3nGn8/Wc23dCLUVtlE69eDsjblY6D91wtGvaTwqkry4JMkpfJujJX kYtJkynxZLI2NASOb21Zmdm3IrvsX2HswDEFrAUW00jwcC05XVstQv/euZ15Ea5LY4KH vns4Cys8Nei27Bl8KBMlp4T0r0J7wkkiFDR2qOSzjCrkTKfLWnCcMdRvgLeKfxpMBCCr IiKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b="rmT/wQJt"; 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 kb8-20020a17090ae7c800b002470488de14si16314866pjb.182.2023.04.24.15.06.50; Mon, 24 Apr 2023 15:07:17 -0700 (PDT) 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.20221208.gappssmtp.com header.s=20221208 header.b="rmT/wQJt"; 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 S233129AbjDXWD0 (ORCPT + 99 others); Mon, 24 Apr 2023 18:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233110AbjDXWDY (ORCPT ); Mon, 24 Apr 2023 18:03:24 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C8895BA7 for ; Mon, 24 Apr 2023 15:03:23 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-63d32d21f95so1167689b3a.1 for ; Mon, 24 Apr 2023 15:03:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20221208.gappssmtp.com; s=20221208; t=1682373802; x=1684965802; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=BOc9YH+oGqwIpPSq5V/5aVKlMiMHqBjxPBRqWKmHOfA=; b=rmT/wQJtGXdI2xWEpUP5et6/IDtgx8ko4m/4kTM/DaHFG4IJ0felb43tvKYMorRR0H T83uSU+fp/ninhWqyK6ZEWuZg/VsCfFmsHwSHpEfQnyVWbtbS2db/YFxsl8390fdDrOZ SUor7GQu0n2bY0i8rCrJtLGVqQYKNsrzeePKZMP4Ohf+w/v5R0aijnP9K5wHAHPDL7gT 3J7CRh/5YhfZSZdRxoB1pDBl1UaaMTmtThd3GXx+OxHlMZSbKrjOh8WLS8EHrXIkwHq4 LNvi5qpJH8r4aHaSSUuY+emoY8d5WyXZdgKg9pH0XvPvSNq3bNdDOjPorAil+6ghTf8L aaLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682373802; x=1684965802; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BOc9YH+oGqwIpPSq5V/5aVKlMiMHqBjxPBRqWKmHOfA=; b=WspbgVhUh6e5LnyZLRLT35laIQOd55GO2f+J1+AvE6Bfq8fGq8s7qc2j+PuFXpGtIe WU7IvONJV1fL+RlmwV8C0LE+BpixqXdm9P81OfSyL/sESGLvxPXXIf5QrPC0xtx1W49Y mQk9faNNsVS/tFkrXo81sr6GyvQyzVdGyfz72aRtL2ayHyuKMglWjdYVEgcELA2QUc4T s4rUneXLNQ4k/MwhBllU/2hctE3pU2VBi6InsSJKEO1QY1YKcNphDFh3Zm1LbIcN+rad 7RVMNDyQ77IHl+WaWJSv5tx+KXz1oEwmOGrlXLeMlrZnMOXTg73JqqDa2HOcYg6UytPU y6kQ== X-Gm-Message-State: AAQBX9fMROZKy2pdvihXCa0uuSk9dvG2pr8y8yJfoDZqJoEn4DigOJYh qGo+D0qWLPtJtWiwj1mLsb+9mw== X-Received: by 2002:a05:6a00:f0e:b0:63f:21e:cad8 with SMTP id cr14-20020a056a000f0e00b0063f021ecad8mr17447730pfb.3.1682373802596; Mon, 24 Apr 2023 15:03:22 -0700 (PDT) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id j18-20020a056a00235200b0063d46ec5777sm7888385pfj.158.2023.04.24.15.03.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Apr 2023 15:03:22 -0700 (PDT) Message-ID: <83712767-82b2-42f6-c86f-9e3d4edd44d5@kernel.dk> Date: Mon, 24 Apr 2023 16:03:21 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [GIT PULL] pipe: nonblocking rw for io_uring Content-Language: en-US From: Jens Axboe To: Linus Torvalds Cc: Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230421-seilbahn-vorpreschen-bd73ac3c88d7@brauner> <6882b74e-874a-c116-62ac-564104c5ad34@kernel.dk> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 4/24/23 3:55?PM, Jens Axboe wrote: > On 4/24/23 3:37?PM, Linus Torvalds wrote: >> On Mon, Apr 24, 2023 at 2:22?PM Jens Axboe wrote: >>> >>> If we don't ever wait for IO with the pipe lock held, then we can skip >>> the conditional locking. But with splice, that's not at all the case! We >>> most certainly wait for IO there with the pipe lock held. >> >> I think that then needs to just be fixed. > > I took another look at this, and the main issue is in fact splice > confirming buffers. So I do think that we can make this work by simply > having the non-block nature of it being passed down the ->confirm() > callback as that's the one that'll be waiting for IO. If we have that, > then we can disregard the pipe locking as we won't be holding it over > IO. > > Which is what part of this series does, notably patch 1. > > Only other oddity is pipe_to_sendpage(), which we can probably sanely > ignore. > > IOW, would you be fine with a v2 of this pull request where patch 2 > drops the conditional locking and just passes it to ->confirm()? That's > certainly sane, and just makes the ultimate page locking conditional to > avoid waiting on IO. I'd really hate to still be missing out on pipe > performance with io_uring. I guess that would still have blocking if you have someone doing splice in a blocking fashion, and someone else trying to do RWF_NOWAIT reads or writes to the pipe... The very thing the conditional pipe locking would sort out. Only fool proof alternative would seem to be having splice use a specific pipe lock rather then pipe->mutex. And honestly pipes and splice are so tied together than I'm not sure that doing separate locking would be feasible. -- Jens Axboe