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 BEA69C05027 for ; Fri, 10 Feb 2023 22:16:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233746AbjBJWQ4 (ORCPT ); Fri, 10 Feb 2023 17:16:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233340AbjBJWQs (ORCPT ); Fri, 10 Feb 2023 17:16:48 -0500 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E63B96C7C7 for ; Fri, 10 Feb 2023 14:16:45 -0800 (PST) Received: by mail-pl1-x635.google.com with SMTP id w5so7988779plg.8 for ; Fri, 10 Feb 2023 14:16:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; t=1676067405; 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=3nq+R/MHvba6mSMNHwpnAJjpxGAz3OEgA07xNnbPejQ=; b=JsbSGRKKBf19CrAGTba3I8q+qoR4pRR/u15vwJb8uG9D+tlXhQskUeQChl+B0CE6/G d7DaFVmiOiHkRi/W9CFcG1/YBnGO6ZybityrFmb6yy+Pr+H1dmmTJaFobJbok5rmzqnw JMJa4yZJHmIP/hJRWaqlKMWjQKVWMlkrkHEf6G55qFnGVsQr8eE4DAVj3rzNQSwkMDow ygFjgS0RB5wg/DLOnrnZoXsF9rld6K/hiMVoXmQsuR+W1HorjBhYBb3VPydkcdGCf589 +SnuVLumT+mkjXzOtA+xz7oJEt6CEYP68BxSNi+gmR3aeagBFcND2ykRP/qUq4RFhdLZ a9hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1676067405; 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=3nq+R/MHvba6mSMNHwpnAJjpxGAz3OEgA07xNnbPejQ=; b=7xNTQXdEpNKI7VrVg5qfPdyPDkg54wyvym6rY/lz74ijCirnquOIuh3qprC5/WpjCA J7AgU7fyV6/YphUGAwUlU55iQNeKJZt7bIlNTc7PXTmyRBq7pg5zV6kMtouh7cILEkaM 0fUH5E8O3asl0CygM8rU6zPoPuE+7bGcyawUti83kBdacS6Ijgehmcs0NBnY4YWQs2GG IQf+6pTtsWnEmtnJTif5jWWXoCbjFb+GLic1cwiOyd8BzpL8TcxMKIESAf0BMzFV7nmD 24HVdXy1hqdCM8/mP4mgcmwW9z+cOst17AhdLciQMJMG8VAkblfEN2m21Suv7FmnqjkL oWyg== X-Gm-Message-State: AO0yUKWhPV2WQEw8/wvfkWkw8b/oGeHpks9ZO5AQrJVd0MaqFxNC4bdw W12abFWcaFJezfaltmohaHxrSw== X-Google-Smtp-Source: AK7set9xih2xsUwTzpXo/PHtOMC524gx4b1nt/NUfdLXSb41BaVsRdjRCGLw+94gRBxpEnPu1MVuFQ== X-Received: by 2002:a17:902:e748:b0:19a:723a:81b2 with SMTP id p8-20020a170902e74800b0019a723a81b2mr3760922plf.5.1676067405376; Fri, 10 Feb 2023 14:16:45 -0800 (PST) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id d21-20020a170902aa9500b0019a71017ab2sm1897737plr.91.2023.02.10.14.16.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Feb 2023 14:16:44 -0800 (PST) Message-ID: Date: Fri, 10 Feb 2023 15:16: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 , 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 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> From: Jens Axboe In-Reply-To: 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:08?PM, Linus Torvalds wrote: > 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? I was in no way advocating for this series, but it seems relevant as we are discussing splice :-). I have pointed Ming at this discussion too. -- Jens Axboe