Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2095032ybx; Sat, 2 Nov 2019 11:57:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqytVPo0peoJ18LsijfH+noQsGd9RiKthsXAHH6lTWG0axu1dsqmf+1Gr7I0h134MFCoOTLj X-Received: by 2002:a50:fa42:: with SMTP id c2mr20327633edq.112.1572721029674; Sat, 02 Nov 2019 11:57:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572721029; cv=none; d=google.com; s=arc-20160816; b=H5pfW/x4+p5NUyprMcb2NwKVngd+hozFrX9u7FkS3pV9JdjqEUkGn/GN1rozKzwk3+ UzdbRfQBSeas+3luJZGrNOpBLYOsplVBufTt2dVz3xJ27l/BJinDpXaT26bfvRD1fsCb 18/3tZu+YvaB0UQPMXsOy4Uil9E4vNLkqcqkixCh+XV/E1F05oaqENdlvkSrsip1mvlK mRHOYxknzWLfGa7lnVHDdunEiWqSTOV60Q73Wr4k//nBaQ+xsxN3PAWY4SOUOwg6e1Wa /G54O9vn3x2+Qz745APGrcq8id5h/qwkqx6zsc2vjRpGRVqZBji+RyiDduJt4g5/6Sgb w8Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=UFZsrTxHj8UNSOV0MW3iX+ZNPh241BxYI9RJCfbRj4I=; b=PDSo4A8nPbDqel6mA8TJelBIjg58QDUeb3aSdbqc4FLUGYio7g7h9xwBD8b52uG9yA t+kL2SIafGZPZI9d6N1wa69V33njUzw3ChyHkOm+hKki+oTPtupoDkVZH51RMNyIzwpe 8lJ1VsjR6LASiiWFCrLFkXWSYw//kFfVcP/d676TjU2g2csz5pp7GlKN8yzhE558qnnP TVLYusRSmwcG2dQBad9YtD9APvzOD5WicmgifBRCWNSuXyvBYUQwGwa5NKOCyVKiDPJN TY3WMA99kLAxW2BoQgDk076rk43XYVi5kaEkgqRxWG1hsoXb+whbpEoOxbthWquI6ukb RaAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=fwWi36Cj; 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 g6si4056686edk.210.2019.11.02.11.56.35; Sat, 02 Nov 2019 11:57:09 -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=@linux-foundation.org header.s=google header.b=fwWi36Cj; 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 S1727008AbfKBSyA (ORCPT + 99 others); Sat, 2 Nov 2019 14:54:00 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:39887 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbfKBSyA (ORCPT ); Sat, 2 Nov 2019 14:54:00 -0400 Received: by mail-lj1-f194.google.com with SMTP id y3so13473072ljj.6 for ; Sat, 02 Nov 2019 11:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UFZsrTxHj8UNSOV0MW3iX+ZNPh241BxYI9RJCfbRj4I=; b=fwWi36Cjm33TVpJsMKyyeNJuPa+EzO/w2jcz8N5ivZnB2LBgFElTwve7u7JUY1CQlk LBP3NYhj8mwMGDKFLZC3aAKJjtxEeb837zFLkONBVlInZ3n9BYz2CiSK5BYhQEqMplN+ cxbruKuD+a9IFTjckV4CYWfQYTCffHao0G3wg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UFZsrTxHj8UNSOV0MW3iX+ZNPh241BxYI9RJCfbRj4I=; b=CRldgUQBU8K5UFEjyFh6XVKVVkkd7KRSeaHkR/RaatyXX/J13Pf1M6zP7ISrUxIJbU MEI573CFbgVpEO3kaEeiSxJIqUJ0nPcHwWv2mPuUX+MpXs2H0glDY9pnNiyN9rae8IvB 0RMTPEXcQUbiuUkxV65Yp7SORoXEj2Y8SVfH3NbBOw+VBFV3ZsoJalfPiS3zGqQBV6Ip xn6TeUz+qp39eG+TEHG6kiSrs49lqH1vBgQARQVR4bs8mnmFHS5WR/EPdwm5IdbANlYW 0yNt/FKLhQ+4cECCPfKO6b1iVLAESAmY+nCdhB6JnbFazlGSLb0UHVxN8mXVgHY9Mya8 96uQ== X-Gm-Message-State: APjAAAWqljcuEYmsKKWmctpGSf6HjcTGaX8758uXHjGwSNdrURjUM9Tg zTloRsN2Tl2HKVa8huLifeg+4c5fxdk= X-Received: by 2002:a2e:87c3:: with SMTP id v3mr12958629ljj.61.1572720837288; Sat, 02 Nov 2019 11:53:57 -0700 (PDT) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com. [209.85.167.50]) by smtp.gmail.com with ESMTPSA id b141sm4276436lfg.67.2019.11.02.11.53.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 02 Nov 2019 11:53:54 -0700 (PDT) Received: by mail-lf1-f50.google.com with SMTP id j14so9443770lfb.8 for ; Sat, 02 Nov 2019 11:53:54 -0700 (PDT) X-Received: by 2002:ac2:4c86:: with SMTP id d6mr11465241lfl.106.1572720834124; Sat, 02 Nov 2019 11:53:54 -0700 (PDT) MIME-Version: 1.0 References: <157186182463.3995.13922458878706311997.stgit@warthog.procyon.org.uk> <30394.1571936252@warthog.procyon.org.uk> <17311.1572534953@warthog.procyon.org.uk> In-Reply-To: <17311.1572534953@warthog.procyon.org.uk> From: Linus Torvalds Date: Sat, 2 Nov 2019 11:53:38 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 11/10] pipe: Add fsync() support [ver #2] To: David Howells Cc: 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 31, 2019 at 8:16 AM David Howells wrote: > > Konstantin Khlebnikov wrote: > > > Similar synchronization is required for reusing memory after vmsplice()? > > I don't see other way how sender could safely change these pages. > > Sounds like a point - if you have multiple parallel contributors to the pipe > via vmsplice(), then FIONREAD is of no use. To use use FIONREAD, you have to > let the pipe become empty before you can be sure. Well, the rules for vmsplice is simply to not change the source pages. It's zero-copy, after all. If you want to change the source pages, you need to just use write() instead. That said, even then the right model isn't fsync(). If you really want to have something like "notify me when this buffer has been used", it should be some kind of sequence count thing, not a "wait for empty". Which might be useful in theory, but would be something quite different (and honestly, I wouldn't expect it to find all that widespread use) Linus