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 0D703C636D7 for ; Fri, 10 Feb 2023 22:51:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229527AbjBJWvz (ORCPT ); Fri, 10 Feb 2023 17:51:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjBJWvx (ORCPT ); Fri, 10 Feb 2023 17:51:53 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87AEA11EA4 for ; Fri, 10 Feb 2023 14:51:51 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id gj9-20020a17090b108900b0023114156d36so11187449pjb.4 for ; Fri, 10 Feb 2023 14:51:51 -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=R4N26B9VGGTnqC3xqOaxRLSDi0f2Dt0eKjIQvb/X62o=; b=u5HRO63gAcA4nfusNIOQSq65f86ZTJ3MqNvxRzAX5W+R22e0AtrfGMumqSuVrq1lF9 NsFXM7VxYdTkvyXmirDO3xIUpW+ewcW65e2UkdwGOQJ9YYAwpFCJYyHSbkZWApVHEZGE trnv6AWqvv6dHFaEgCi4hVQIt+kM56QLFx8gqLW0NWJFYOuOwB8G583A//zD1Sai/c7C Yv8iBj0gA1lfIgrL3ID5Im4XMbfR6eu3isQI3hqYm8g51dYY/9UgnTVjXvGyKAjaFsRq qoIJ6191tOa8qIoM1uzUoaYGc2WROgSeZ+8ShxrfdZMyZQIyFSeReusVE5uiSq1tUukg zUbw== 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=R4N26B9VGGTnqC3xqOaxRLSDi0f2Dt0eKjIQvb/X62o=; b=0laM5xQmCteOMZyQsFLnHLqPLz0DlHIIMkZAoSF8GNNZqWO5Ndc+MBE/tShW6sS4rJ 9c+hwgRS1xIG0sCpc1Xf0KrFfPVom8JWJqXb1PisLLrWzaORbm3g1q1iWA1033WdOAeL ATws4CxFzsbB6fUZ++b91lv/Co04xJ4Fp+Wig3cjJsA69DVAjSJY7eGbOZKEVGQHu9HG +0QRjrfKfpZWEVF7V7ftkG0gkCzIZoMYQnFbm0/mN3yYxa8ufvCC2tWZPf2OVeGj2Wjh IbJO68k0MCPkaRmBK6EMoil4m1PL4g0ETcJE4DcWaqAZn8M3sb2BmQUpuzYjx08sY7p5 X58g== X-Gm-Message-State: AO0yUKVTqFtRmKmsUkgQ+HuJjQ3UFkO8/9Chf2pLFjSyPSboo+UIDdQ8 EZS41egZt+knOdL+JCse68IgTg== X-Google-Smtp-Source: AK7set/0HEQG/FQ9H218VpRyJjXTjhHzpcw6zsWsYqjqsJHruBzZv/lO8Nfnn1XVxrZ0jfTCujLcLQ== X-Received: by 2002:a05:6a20:7f8e:b0:be:cd93:66cd with SMTP id d14-20020a056a207f8e00b000becd9366cdmr18769759pzj.2.1676069510837; Fri, 10 Feb 2023 14:51:50 -0800 (PST) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id z29-20020a63b91d000000b0047899d0d62csm3439655pge.52.2023.02.10.14.51.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Feb 2023 14:51:50 -0800 (PST) Message-ID: Date: Fri, 10 Feb 2023 15:51:49 -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: David Laight , 'Linus Torvalds' , Dave Chinner Cc: 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> <20230210061953.GC2825702@dread.disaster.area> <304d5286b6364da48a2bb1125155b7e5@AcuMS.aculab.com> From: Jens Axboe In-Reply-To: <304d5286b6364da48a2bb1125155b7e5@AcuMS.aculab.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/10/23 3:41?PM, David Laight wrote: > From: Linus Torvalds >> Sent: 10 February 2023 17:24 > ... >> And when it comes to networking, in general things like TCP checksums >> etc should be ok even with data that isn't stable. When doing things >> by hand, networking should always use the "copy-and-checksum" >> functions that do the checksum while copying (so even if the source >> data changes, the checksum is going to be the checksum for the data >> that was copied). >> >> And in many (most?) smarter network cards, the card itself does the >> checksum, again on the data as it is transferred from memory. >> >> So it's not like "networking needs a stable source" is some really >> _fundamental_ requirement for things like that to work. > > It is also worth remembering that TCP needs to be able > to retransmit the data and a much later time. > So the application must not change the data until it has > been acked by the remote system. This has been covered, and: > I don't think io_uring has any way to indicate anything > other than 'the data has been accepted by the socket'. This is wrong and has also been covered. -- Jens Axboe