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 928CDC6379F for ; Fri, 10 Feb 2023 22:09:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233274AbjBJWI7 (ORCPT ); Fri, 10 Feb 2023 17:08:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232755AbjBJWI4 (ORCPT ); Fri, 10 Feb 2023 17:08:56 -0500 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C3F96BAA7 for ; Fri, 10 Feb 2023 14:08:55 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id m2so19298447ejb.8 for ; Fri, 10 Feb 2023 14:08:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=abSFB59ri4FOl7mUi8eUgUBhSEYjEYSp3hrpjZkmJ0U=; b=NcU1uFZdoJAjGPI44x/T/oJNFFkClW4PcLYk/vV5Feaov42tAJqpKYVo9/YlqDXw24 MP1ObyJcJdHSRWORQxht+uP0G/aT/dcYZ9VhAyTSNq5BQ9jK4YMDeinqtABv+BxW+AIh cxBZ6zXZfc4dJfwH59qtqzuo+YrVtdjQpLas8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=abSFB59ri4FOl7mUi8eUgUBhSEYjEYSp3hrpjZkmJ0U=; b=R8JufrA66zuNf4A5PH42X06mBnoqIevi0oA6wYW3zlz8kb/YCRswGppMQG+TISEb9w gmrdCb9x5j9/zCDhj5YFJPHBoIhNW6110CHnvrr+ZEL3sfs/C+liAZbJVmhc6G+Po94k YdHRHsB+SebWQI/Q+qsbuD6zYXzRFC1KM6qvukzL5y4m7Jlj6FO1mnSwds5n1y5vIo/s 1aUbh4C3c9zzrER0aHx0Pqqv/AhL4xwFpislutVT70XNQyWIZXY5bWQfh/rtI+tSdE2/ HuaBh3ZQjIC2Llg4jPR+n6npljfmO6soedja0YT2lxWVZsXzmqireJ8X9CKOnrgHhg9E /qTw== X-Gm-Message-State: AO0yUKUraEirit15Rs4V1FKpoWuq4q1iWQ2qsRcHQX1rZgFzZaVD0KUg yqAfDr5wcjaLBiNEW7pINw83zlwMe8uIJI6sD8s= X-Google-Smtp-Source: AK7set9ABNxKKuv5wzzLPQChOvkeToOVDIEgihv3c7V0SOJ2Vq6ySwxiV76rjkGiorMHcAgAlSNohA== X-Received: by 2002:a17:907:6e0f:b0:8ae:6b88:e52d with SMTP id sd15-20020a1709076e0f00b008ae6b88e52dmr14135469ejc.7.1676066933515; Fri, 10 Feb 2023 14:08:53 -0800 (PST) Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com. [209.85.208.42]) by smtp.gmail.com with ESMTPSA id u10-20020a170906108a00b008a9e37ca37fsm2943386eju.166.2023.02.10.14.08.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Feb 2023 14:08:52 -0800 (PST) Received: by mail-ed1-f42.google.com with SMTP id bt8so248588edb.12 for ; Fri, 10 Feb 2023 14:08:52 -0800 (PST) X-Received: by 2002:a50:c353:0:b0:4ac:b616:4ba9 with SMTP id q19-20020a50c353000000b004acb6164ba9mr189716edb.5.1676066932381; Fri, 10 Feb 2023 14:08:52 -0800 (PST) MIME-Version: 1.0 References: <0cfd9f02-dea7-90e2-e932-c8129b6013c7@samba.org> <1dd85095-c18c-ed3e-38b7-02f4d13d9bd6@kernel.dk> <7a2e5b7f-c213-09ff-ef35-d6c2967b31a7@kernel.dk> <2bb12591-9d24-6b26-178f-05e939bf3251@kernel.dk> In-Reply-To: <2bb12591-9d24-6b26-178f-05e939bf3251@kernel.dk> From: Linus Torvalds Date: Fri, 10 Feb 2023 14:08:35 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: copy on write for splice() from file to pipe? To: Jens Axboe , Ming Lei 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 10, 2023 at 1:51 PM Jens Axboe wrote: > > Speaking of splice/io_uring, Ming posted this today: > > https://lore.kernel.org/io-uring/20230210153212.733006-1-ming.lei@redhat.com/ Ugh. Some of that is really ugly. Both 'ignore_sig' and 'ack_page_consuming' just look wrong. Pure random special cases. And that 'ignore_sig' is particularly ugly, since the only thing that sets it also sets SPLICE_F_NONBLOCK. And the *only* thing that actually then checks that field is 'splice_from_pipe_next()', where there are exactly two signal_pending() checks that it adds to, and (a) the first one is to protect from endless loops (b) the second one is irrelevant when SPLICE_F_NONBLOCK is set So honestly, just NAK on that series. I think that instead of 'ignore_sig' (which shouldn't exist), that first 'signal_pending()' check in splice_from_pipe_next() should just be changed into a 'fatal_signal_pending()'. But that 'ack_page_consuming' thing looks even more disgusting, and since I'm not sure why it even exists, I don't know what it's doing wrong. Let's agree not to make splice() worse, while people are talking about how bad it already is, ok? Linus