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 4359DC636D7 for ; Fri, 10 Feb 2023 20:39:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233241AbjBJUjt (ORCPT ); Fri, 10 Feb 2023 15:39:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233008AbjBJUjr (ORCPT ); Fri, 10 Feb 2023 15:39:47 -0500 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D82A57775 for ; Fri, 10 Feb 2023 12:39:46 -0800 (PST) Received: by mail-pj1-x102f.google.com with SMTP id e10-20020a17090a630a00b0022bedd66e6dso11184830pjj.1 for ; Fri, 10 Feb 2023 12:39:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; t=1676061586; 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=hOgh7AvLAEWr6MHPlHv0hgSblyWQEvUMOhxbQH1+hyo=; b=jc2vNS6CTgDl5wGMWicplBDwMvBI5B5pqGQ9DaNZQ307PdlpVexxHxXwRO7mUkX4NY 7fRQynw4kF8Oi2c4WShg0TbmesAXOhBwUP/ZDuN2qCO4aXUK0UZREXQBMwjpL7kmigkp rXAkKJ0F4wN7ACfcxYmWv6a/ZDbG/+cg82oKRyXQ/Lm+c1IogSo6u4a4+21f8ZLF0Owj BmISDB5fJOMG0q7j8CjfevhDocQFVyO1+tUeDOgi23M3EBTSDalxZmuN9Tnm/6svMWXF VB1Kb91lB3AGgf5NAATPTOY28mbd9FstMUMd9wo/WtKwHesj1wp3QpdDs4RvCAzzLbdo kDsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1676061586; 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=hOgh7AvLAEWr6MHPlHv0hgSblyWQEvUMOhxbQH1+hyo=; b=mru4kqIKjXBK8BsxxPg23dkDS97R9eEVntrss0fEuYG7un4erDFy0jIeB655j839nS DNW+awA9XVy8Sb8nVgJA3ZmbWUmst3zXbcECWWVCyOwfVFa5BWdmFZpsq+F+SiPjvcU7 LnmCqnvHCKWYwxPJ+7dg6tuPxgl55v1BNv9+cWPhpsu7r/9rJG2dAlRf3RqCWrmVxFXG UYBjmpwsiKjdkqbKTS1w8qZeP4SCHbtZdOfwVnYw3QGZDNeBw+UubtDEMwwgiTr4+YpU crRpwNkSq2b3C+djxuX5p7qR1//z9KWftn38D5f3/CTVH7HrLF0Xn0qQKoAPq56wz0ZC BE8Q== X-Gm-Message-State: AO0yUKWNkOcqS/k2un7pd20wwzdYEMrHIR1qiPrcobLaG8rxSO/lsVq1 WrfkBlZA/FAOVhlIbEZN9WCMaQ== X-Google-Smtp-Source: AK7set+Y8TkAMh6d9nz8+dUcs2UW1ALm0QmrsJs0TveWKd9aTsokQRTlusL/k4JePfB0Sa0dyZsGSg== X-Received: by 2002:a17:902:f685:b0:199:190c:3c0c with SMTP id l5-20020a170902f68500b00199190c3c0cmr17850124plg.2.1676061585288; Fri, 10 Feb 2023 12:39:45 -0800 (PST) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id l3-20020a170903120300b00196053474a8sm3774234plh.53.2023.02.10.12.39.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Feb 2023 12:39:44 -0800 (PST) Message-ID: Date: Fri, 10 Feb 2023 13:39:43 -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> <20230210021603.GA2825702@dread.disaster.area> <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:36 PM, Linus Torvalds wrote: > On Fri, Feb 10, 2023 at 12:32 PM Jens Axboe wrote: >> >> No, we very much do have that for io_uring zerocopy sends, which was in >> the bit below you snipped from the reply. It'll tell you when data has >> been sent out, and when the data has been acked. > > Hmm. splice() itself definitely doesn't have that data - there's no > "io context" for it. > > There is only the pipe buffers, and they are released when the data > has been accepted - which is not the same as used (eg the networking > layer just takes another ref to the page and says "I'm done"). > > Maybe adding some io context to the pipe buffer would be possible, but > it's certainly not obvious how, without changing splice() semantics > completely. 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. -- Jens Axboe