From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04520EB64D9 for ; Thu, 29 Jun 2023 18:19:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7DD9F8D0002; Thu, 29 Jun 2023 14:19:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 78DF28D0001; Thu, 29 Jun 2023 14:19:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62EA08D0002; Thu, 29 Jun 2023 14:19:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 50B628D0001 for ; Thu, 29 Jun 2023 14:19:59 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 10D38A0BF6 for ; Thu, 29 Jun 2023 18:19:59 +0000 (UTC) X-FDA: 80956599318.19.D2758F8 Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by imf24.hostedemail.com (Postfix) with ESMTP id E3128180007 for ; Thu, 29 Jun 2023 18:19:56 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=fUHWntqo; dmarc=none; spf=pass (imf24.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.208.49 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688062797; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=119MmpmBlik/DZD2cugIRiS/KUlXYi8QMOdrxDs/3Jk=; b=dNIU6FtE/GsSMUdqxVvxCI3nSklh8EpKyaJMnJZexRwlAi3RLxmAAlE5w1AxfyIqLzNDqn OmF2jLO3iEFDeBa0w1eV6yxoqawOpGpPS88CAJB0w+IF4rjUjPF5rTmKu5PPWO87VWcl1w 3fM+i+7D/2Cc64XnagKUtfe3QsujZ4Q= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=fUHWntqo; dmarc=none; spf=pass (imf24.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.208.49 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688062797; a=rsa-sha256; cv=none; b=mrMcjB4UyWIbb7tGDjBkbSeHudyqXSPH/OCVFuI9Ewek35ssfHAB7p5CdoInoCZBEjPkic ygMDV1rN/T6GN+Vi6cu03p8Ou3RhbdH9xlgbGeFjoYWfAXLWh5thYtJn6TFSiCllQ6zTzF O3VEaf88fsMqnHF3MRmsgP9rKASBYGI= Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-51cb40f13f6so1159376a12.2 for ; Thu, 29 Jun 2023 11:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1688062795; x=1690654795; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=119MmpmBlik/DZD2cugIRiS/KUlXYi8QMOdrxDs/3Jk=; b=fUHWntqopNqgGR09zF8r/4qyuydTLc1DL0oftk32N+n5+LPRuwJTd0kF47/Lz0FNlL btWGQuGN4B9C/qdKWV9OwSlxnWgLKV7fMWm6r+FyfKzHhNWZ1zonVW5BzXjRxWm427+Z jOgNmjWX6QNOT+qrUbKOQZA2jnsqeKuMR1l9U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688062795; x=1690654795; 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=119MmpmBlik/DZD2cugIRiS/KUlXYi8QMOdrxDs/3Jk=; b=QFUlZOq7diob5GIbiHbrKutjWi2Ec1T+pbm2bn0/3O1Zn8sMQJZ35CYj1O8/V3/V6X Q5KAJI9PiqppXzpQUAbr4MzLMIg5QxI3GrHsZXiJgd9VX6u6ZB62vfjekU2fRHV+ov5F qCQjjwnq9hBBi5AqmXFqa23yCNlvEft8XfXl+pvRKrC+hWmhNfrKerASc1fupN9l+Uoc CM2tspDNDaM0cfIq3MV0ZoVLHrGefUz3rVdT4rB8TGD977VLWU47xH2O7jxndBMR+2Ql vJutTBOktKEcW0XNxzfKuWAy4GSAyH9b025uPeh7JxBvrjncSXqqYrnD7Ww6SKjlfK70 IEvQ== X-Gm-Message-State: ABy/qLbTYfUVhiQcqc4RbO4SnvC4TtZ1UjpY6xXIg6u1RQx++Uxmykuh 2zTLVsDavKV4vdEnsW5WXw6fWLeOFUvZK4pwwSobWp/M X-Google-Smtp-Source: APBJJlGMlDImU/roopq04RZuJ8u2893ptbERcSRZbJmtPjWrtxUUm0MUXgJi0Ta0roLAL37mbFoYkQ== X-Received: by 2002:a17:906:37cc:b0:94f:449e:75db with SMTP id o12-20020a17090637cc00b0094f449e75dbmr202182ejc.52.1688062794996; Thu, 29 Jun 2023 11:19:54 -0700 (PDT) Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com. [209.85.208.44]) by smtp.gmail.com with ESMTPSA id xa10-20020a170907b9ca00b009892cca8ae3sm7106828ejc.165.2023.06.29.11.19.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Jun 2023 11:19:54 -0700 (PDT) Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-51d7e8dd118so1170659a12.1 for ; Thu, 29 Jun 2023 11:19:53 -0700 (PDT) X-Received: by 2002:a05:6402:5147:b0:51d:e30e:5b10 with SMTP id n7-20020a056402514700b0051de30e5b10mr1164043edd.40.1688062793473; Thu, 29 Jun 2023 11:19:53 -0700 (PDT) MIME-Version: 1.0 References: <20230629155433.4170837-1-dhowells@redhat.com> <4bd92932-c9d2-4cc8-b730-24c749087e39@mattwhitlock.name> In-Reply-To: <4bd92932-c9d2-4cc8-b730-24c749087e39@mattwhitlock.name> From: Linus Torvalds Date: Thu, 29 Jun 2023 11:19:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 0/4] splice: Fix corruption in data spliced to pipe To: Matt Whitlock Cc: David Howells , netdev@vger.kernel.org, Matthew Wilcox , Dave Chinner , Jens Axboe , linux-fsdevel@kvack.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: E3128180007 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 8qhych76b1qnqwum9c8dgn8r6rjhppyw X-HE-Tag: 1688062796-603031 X-HE-Meta: U2FsdGVkX1+PV1eqHE5GigA2Yw7K4a6XtVQIAN8jE5wG2uDxgq+CwAe0vwBY+AT/xgLAaYkv/dy6wCkcGQ/2wx11ot454Iv3A3dQr93+ijSMfinBXldy8Kf9gsyernkD+N6q1zPoNH7hilVB2dsW0HLaR58zqwSXtV0265dwr9msbY5O5fy12a3gQQQIjw4KeHPQm2VA7oHxVDVRoefC7TyryLWRds3HBR+HqSLUcdgelakLGgA+EOdt+QqvauisihbnIO0rlL28rS239XxiD2yZATR6SjntgS4b4rvuV1wD4iDDaDOv8TlUaE5ceS8JIXGifHn7jlcurxRVQbF7eKZp/dLBJNTnmhgJN395iTNJy1j3AzdveJ0GB6ZGpbDRL4zKDhbnpnLY5u5I+UtpvVvbLGLEmuEaNkWjWu9f4/N1Domfs8+6u9C0qeiTiOpPcLgCEizL7kN3pNZQL1J1MLafP/+r7/UxMjTEOvaoaXIw0OI5o9GKm8rwRG67lZiabTF/qquTwoYFe/OC0zz6OniJ7oAEeE8Dm/FmFcJ2VCD1M9ddxNCUkk1zIZ3egg98/FIuReQaRaAU0G9Libu8N0l+zYfvBhDJrQsaSI0q9qamGR6EM3OnI/D8MdW4M6SPICqfLia30OfmiqUrYQONrCoI7kkbnwdrp9BV7zIzGPKXv4nQcdcTXwIJK58EySkcMetuN+i8OZd3knWSY32HwzS7m6H5vTd7OqenKVQgyLarYkKro9XZygMPPPH/xqi/xGc1ocHytmDHrigAUb2uYGPzAeF/bERN8QlO/N21GpBpuaVVc1dhovVOShhSdsbjfTr0ve1n9KW1My785uIrvOE619/4GHtJtYQnuFRcTAEDBRroTrT3DAFFhh4Vt8sjFgs8qzuyginAlSKErPN6xYKJCiX//EDQ+veve7icq019uWUtUyqcJfhN+vuHVUL/L/XzN9FYDYe8vF0Bhf4 ak1oXHQM d6oJxp91Cb0oZz+T8ArFBqHIAjRuKdGySAVz0yyS0I//9iX+SKQqccLKOQG8PQclYEFzXURriJ2IXEyf67ocieUdFDjwILDzhZJ405aeIO5ADDA2moPt9DK766dp6vJPFXeHFHDllSvIvKpLJctbCQ0s/ojT6VrADzCSTwh2dvBVEmVl171pdkAOiHKH0Rd9dmimruqvkkHq1WSKWnZc5SMv/ep8SGHk4dY+epDao3SiliAjJxhOO8ud0Xt74DijM6k7a3SF2sUtfXz/uM2m5wDtI9bN7SZMKxhRJeu1hwT6FwN3cs4ZdzQexiWAX51bK5DPPNiRn5OLt3CpabJ6D6il++5gEcdpP7A29mMfDtB2BkS1SRPZnrAc3+UZiz4M+Ut12WMN9oJQ03kdnF9gNBWOo8mG0TXY0lS4RllCig1czfECGI+R7VrJiPzr5RnJrxeSdPsBUxCSGEUXzsdEsNIj4cYfeAKpIZoJcG+rDhzS/Ixl5wJfe8KYovA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 29 Jun 2023 at 11:05, Matt Whitlock wrote: > > I don't know why SPLICE_F_MOVE is being ignored in this thread. Sure, maybe > the way it has historically been implemented was only relevant when the > input FD is a pipe, but that's not what the man page implies. You have the > opportunity to make it actually do what it says on the tin. First off, when documentation and reality disagree, it's the documentation that is garbage. Secondly, your point is literally moot, from what I can tell: SPLICE_F_MOVE Unused for vmsplice(); see splice(2). that's the doc I see right now for "man vmsplice". There's no "implies" there. There's an actual big honking clear statement at the top of the man-page saying that what you claim is simply not even remotely true. Also, the reason SPLICE_F_MOVE is unused for vmsplice() is that actually trying to move pages would involve having to *remove* them from the VM source. And the TLB invalidation involved with that is literally more expensive than the memory copy would be. So no. SPLICE_F_MOVE isn't the answer. Now, we also have SPLICE_F_GIFT. That's actually a more extreme case of "not only should you taekm this page, you can actually try to re-use the end result for your own nefarious purposes". Now, I would actually not disagree with removing that part. It's scary. But I think we don't really have any users (ok, fuse and some random console driver?) Linus