Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2174532ybx; Sat, 2 Nov 2019 13:33:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0wSP6Uq586EfTZx372g6EjuG8gxm3rc4v/oq/Lzc5zq5usz9rZ86IPi68jLb2PCm7W0kQ X-Received: by 2002:a17:906:1611:: with SMTP id m17mr16969717ejd.281.1572726794230; Sat, 02 Nov 2019 13:33:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572726794; cv=none; d=google.com; s=arc-20160816; b=DGYF/Bzp1S/AUUTubzCgmOqZQh+e+gcB8Aujumac6WVj0Tft8Uz75FNHcz9/ezSjHW 2qMOOfElpaM3URH6jkvfSZ5OpH4YnJAhpu98BmEeY3CrEDwIDsax8AUTn6iTW157W2bD nPYrkJrCagI38TIFIy+LW6QNcBusJFRKvklfe6EVP0gGANuNwb2ZcikOolEWYTWVP79f TjuUdP3w+WEpu1s4ryqapvm1nQj3igLLgGsPHrpDXZlTt0lHQUJ4YL/OrbU8IISvrQD2 vkTKDA7rNty7X0MLHimYBsqdl/SK11NmTAuYSJIKowHB/bk+GGkkIdEfH47tOPIzmE1n Ohig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=3UJcAg5pgAKoJ5Gm+ePXKf237ihZLN3FrJl8TSBImIg=; b=bWLvybiXVj+afiPA7K7k6QmHt8PPYScnrPmIQGF1eUM4BfjZ0AE8t83cUX48B2Cdnm vN0Gjhq40MGVuxWxPa+bdI8bhmMjkL0yj1oiAICsrTLrgN5gWXDZX5jAOABB+kcXXTxy ujBBcPZksnkvEzqydCy/40lfXZWH1hG2W0pV9E4uSgmokQJloQwyB7Cp5UEZpnAxxnkw 8ECpNRAMHE4ZC6mbEgDjlOF7fQVbZANzqO8u5+iGMPfXA1kpFDF7M6CGRUd4JFXQn9B7 H9P9BskGOoOnLR56cob0HQ9nX6YXC6BHJ+QIn0l1D/PKhl5JepFv+hohTyrWiLfQktR5 n+5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=WQYmjkbB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k16si8373542eji.401.2019.11.02.13.32.39; Sat, 02 Nov 2019 13:33:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=WQYmjkbB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727008AbfKBUbO (ORCPT + 99 others); Sat, 2 Nov 2019 16:31:14 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:39088 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726687AbfKBUbN (ORCPT ); Sat, 2 Nov 2019 16:31:13 -0400 Received: by mail-pf1-f193.google.com with SMTP id x28so6155364pfo.6 for ; Sat, 02 Nov 2019 13:31:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=3UJcAg5pgAKoJ5Gm+ePXKf237ihZLN3FrJl8TSBImIg=; b=WQYmjkbBu/hvk7IO4II81+pXnWWSv7cZzRYKVx/XG0INxzQf7SKwKMr5nQs8teoa5c xKjk7/c6ZhE3qV2FTV3iQHHUC4dxiGZEizSc6/wagvdDtQiZv6m4XzVFHLkCCmgDEHxb fmK1J4M0CMB/cSNTO5GB4Jva0lky8IKV+3nmWBFtSTu+Vtzmn/2YRpKC5zsTeCRhuMNs 6PL3Z57fVG8WIc0Hq3WvWeRGUBmYjfm6/0bmyZNCugZlL3aIvcSKI6XPD/Xy+NHzn1yj CTfXWHb5Pn65JVClRjn5V5G3JNnauyuxY/KfLgkd8yXlJI1RMuEQMp2JlvBdD6pzutWT y/9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=3UJcAg5pgAKoJ5Gm+ePXKf237ihZLN3FrJl8TSBImIg=; b=MaIC+g8fbZEcgz7zpZSgMtnpJOk18Nh0PEycIxcYN0DKh02n+CUW3j/bRPVaiT3NMN HRxoquNNc1VEu9fm0ceNE7+h/f7Bou/jqznPfJckj6REcEXZWFuMYtSH+fjUM8GFr28O szIF+aDDdudO04QrzR2rWgfLmJ3GpZhI1ztEZFH4gmZkgvuhhymEGJcOghZ24nkdvMQA t6f8riGsNaOPsurfqU4MjV64i2P6T17tBTjB/PhN8TY+WqQK4Sy2qpcpmgyI3Y0UXQAp YB29oQWD0Uif8gG0gTdUOC3zLPFdRDOBivZdcx7odcFmXPYaROVpmQNT1MP4p0MSRTmT OH9g== X-Gm-Message-State: APjAAAXNCYqO1dylNz4NKQKKNWw0P8TOv/wB2N0pC/2Arx4XPNnVwfiO si1tLzrOPRuskk598CS6BU4sqw== X-Received: by 2002:a63:f25:: with SMTP id e37mr21668425pgl.269.1572726672787; Sat, 02 Nov 2019 13:31:12 -0700 (PDT) Received: from ?IPv6:2600:1010:b067:e6ce:10dd:e058:94b7:feca? ([2600:1010:b067:e6ce:10dd:e058:94b7:feca]) by smtp.gmail.com with ESMTPSA id j24sm10070252pff.71.2019.11.02.13.31.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 02 Nov 2019 13:31:11 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: [RFC PATCH 11/10] pipe: Add fsync() support [ver #2] Date: Sat, 2 Nov 2019 13:31:10 -0700 Message-Id: References: <25886.1572723272@warthog.procyon.org.uk> Cc: Linus Torvalds , Konstantin Khlebnikov , Rasmus Villemoes , Greg Kroah-Hartman , Peter Zijlstra , Nicolas Dichtel , raven@themaw.net, Christian Brauner , keyrings@vger.kernel.org, linux-usb@vger.kernel.org, linux-block , LSM List , linux-fsdevel , Linux API , Linux Kernel Mailing List In-Reply-To: <25886.1572723272@warthog.procyon.org.uk> To: David Howells X-Mailer: iPhone Mail (17A878) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Nov 2, 2019, at 12:34 PM, David Howells wrote: >=20 > =EF=BB=BFLinus Torvalds wrote: >=20 >>>> Similar synchronization is required for reusing memory after vmsplice()= ? >>>> I don't see other way how sender could safely change these pages. >=20 > Actually, it's probably worse than that. If the output of the pipe gets t= eed > or spliced somewhere else, you still don't know when the vmspliced pages a= re > finished with. >=20 >=20 I sometimes wonder whether vmsplice should be disallowed or severely restric= ted. Even ignoring these usability issues, it makes me very uncomfortable th= at you can have some data queue up on a pipe, tee() it, and get *different* d= ata in the original pipe and the teed copy because the sender used vmsplice a= nd is messing with you. Add in the fact that it=E2=80=99s not obvious that vmsplice *can* be used co= rrectly, and I=E2=80=99m wondering if we should just remove it or make it ju= st do write() under the hood. I suppose the kernel could guarantee that it stops referring to the vmsplice= source pages as soon as anything sees *or* tees the data. This way it would= be, at least in principle, possible to say =E2=80=9Chey, the pipe has consu= med the first n vmspliced bytes, so I can reuse that memory=E2=80=9D.=