Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F86EC636D7 for ; Fri, 10 Feb 2023 20:50:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233804AbjBJUuT (ORCPT ); Fri, 10 Feb 2023 15:50:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233733AbjBJUuR (ORCPT ); Fri, 10 Feb 2023 15:50:17 -0500 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F0CA7F811 for ; Fri, 10 Feb 2023 12:50:16 -0800 (PST) Received: by mail-pl1-x62b.google.com with SMTP id d8so6549984plr.10 for ; Fri, 10 Feb 2023 12:50:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=BOLdMOZh6oSFDZ674/JlPJ6s1A5z56hiarzibKSdCd0=; b=YUVcAGplnJzJGvRds7SmhH8wPnKRaEgeepF9s1F5wmgGv7LVxnxYoAPDdp5UvJT/2R Ld7uRFZBmvEJ+9tgHJoi15WuSw5vTiOgMPrCyrevfNTtTbRSMllCR3LRro4pPdhNDvzo lGu1lCnRTf8zsHJCgY8g/sAtVMQtKfN7v5mY69TFnrKV96vucUCqYhbdvWFWm5RQRxIW 4mga/BN+7oJdbhPCHqkQI9UW7MQQr89iOk5/r/HYDx+NPGScr25yckQ+jyjBtEpnaXtd LbR7LjjBLKS/03heKb2TcL/2y35OvRTaKChR7BbwUCadlxhP5bRAmjFgNNsXPd8R+yqY l5AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BOLdMOZh6oSFDZ674/JlPJ6s1A5z56hiarzibKSdCd0=; b=Mh/yea7ju0Sd0PkBWjuntDWzdVPNyrCdI3Htt70aJioRvew65ux315LvtQF5p1OJeE WtZtRx3WZvX/H9dI/Y8GMGfDEc375ACFouQqlmysR3SJ88/UHyOBQ69wTgB8i9TSifsk iG/nhoZM0nK0zSQLk1E5tG9daENKvjCAp7yjl+LdaxgZwnpmYS9xF58sz4LJi7vWB76J +AspaqepbtrApuyQCIms8MR0GhBwFMQ2PI6Q+imU2S17nwjpvIdJNTkBqsl4Sjfz355j V1XW2Z8c/MCKkKed2cYqeQDq6XaYr03Gc5t6fwfCJRzze3g7Kvd3jQO9fA1a7sKSpvVO ciRQ== X-Gm-Message-State: AO0yUKU1OE9qhcnZGlMZc75nEb8wF8dI1kMC5sFImFWvYA2k+YXsKatN Ak+5T4gOFXIYcouyUdvpJA0Zqg== X-Google-Smtp-Source: AK7set8i8tlrLyo/k3MJtpUjV25aKJQ2J/6HUx+X4GcdRwQFAttGDyYke7MGUbA6TE6IEUa2RpggtA== X-Received: by 2002:a17:90a:dd45:b0:230:ca3d:3db with SMTP id u5-20020a17090add4500b00230ca3d03dbmr13943705pjv.4.1676062215811; Fri, 10 Feb 2023 12:50:15 -0800 (PST) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id u1-20020a17090a4bc100b002311dbb2bc5sm2586754pjl.45.2023.02.10.12.50.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Feb 2023 12:50:15 -0800 (PST) Message-ID: <7a2e5b7f-c213-09ff-ef35-d6c2967b31a7@kernel.dk> Date: Fri, 10 Feb 2023 13:50:13 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: copy on write for splice() from file to pipe? Content-Language: en-US To: Linus Torvalds Cc: Andy Lutomirski , Dave Chinner , Matthew Wilcox , Stefan Metzmacher , linux-fsdevel , Linux API Mailing List , io-uring , "linux-kernel@vger.kernel.org" , Al Viro , Samba Technical References: <0cfd9f02-dea7-90e2-e932-c8129b6013c7@samba.org> <20230210040626.GB2825702@dread.disaster.area> <20230210065747.GD2825702@dread.disaster.area> <1dd85095-c18c-ed3e-38b7-02f4d13d9bd6@kernel.dk> From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/10/23 1:44 PM, Linus Torvalds wrote: > On Fri, Feb 10, 2023 at 12:39 PM Jens Axboe wrote: >> >> Right, I'm referencing doing zerocopy data sends with io_uring, using >> IORING_OP_SEND_ZC. This isn't from a file, it's from a memory location, >> but the important bit here is the split notifications and how you >> could wire up a OP_SENDFILE similarly to what Andy described. > > Sure, I think it's much more reasonable with io_uring than with splice itself. > > So I was mainly just reacting to the "strict-splice" thing where Andy > was talking about tracking the page refcounts. I don't think anything > like that can be done at a splice() level, but higher levels that > actually know about the whole IO might be able to do something like > that. > > Maybe we're just talking past each other. Maybe slightly, as I was not really intending to comment on the strict splice thing. But yeah I agree on splice, it would not be trivial to do there. At least with io_uring we have the communication channel we need. And tracking page refcounts seems iffy and fraught with potential issues. -- Jens Axboe