Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3064782ybi; Mon, 17 Jun 2019 15:50:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHenv1zBrPJYvygSOyjfZywT/8WHiJL3pvonQoRn3smIpp6znXC6/OH84boKJDkBUXEB4U X-Received: by 2002:aa7:84d1:: with SMTP id x17mr92976883pfn.188.1560811812132; Mon, 17 Jun 2019 15:50:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560811812; cv=none; d=google.com; s=arc-20160816; b=ib98DrLqgF/ppf/6UJQAu03bxsTJdrzlCk3Q0EwefgH0sgRx/lEaDJ6Oe4zewlDHl1 lotS0roAmBMO8WhocgYdRKk212ilP2oJFqjkHSZeV3QVmBRKPWH3uxmH60u8rhVzn9+T HTituveBSiw3qcu9ZSHtAuonB0TQOJhDC8I4oMLsRMzhIDRHWUu7lCg9rAtbnpaL4R2z 2nZXj8ehqiNUj8VRUWFsSd+DssciYBj69LKwV29dPP0qLw0NsLmizhiKerK3wAbWmLsi EXSrZ6EllA37Tle/uwKJP0FO2sMM6J93gC4gfLywcwyIInwaC6lP/jZZvRSV2z9kgyOW S1uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=gyL9MDr53ON3XgW3+jz8v09uo+hsHPpvFqixpzcPM+M=; b=h7lC3EhimGmdUk5M5BnXyB2dDOx3W4GRGcmMa4TWtKPKXvQfYUmA+e5ubMuFEZ+gkQ lUI5yfBylQU1dUP+uMGb7sQ+wdV7TWEJHp4jbNdgYlwaAqtebzuK0urL3fn8kVTvGdu8 hOog8oKrZBv2xwEyN5QtN6krO/lPvTdcZBFpOodM/6BI4QMNAVU6keSz9nz8yGaM/zWr ekwr9QTaouMDKLkMtncmN4npWBTkx4/+DTxqZzAv36D9ZazBuAqErmWVAoXKTnePLMHD vO8JVXwYOZJb3ae57pcX19crhhY9zxwTQKMYm+ElsGn54vSELu7FfLOB2DafWzGvwAv/ yXmQ== ARC-Authentication-Results: i=1; mx.google.com; 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 p7si8807343plo.114.2019.06.17.15.49.56; Mon, 17 Jun 2019 15:50:12 -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; 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 S1728791AbfFQWsT (ORCPT + 99 others); Mon, 17 Jun 2019 18:48:19 -0400 Received: from mail106.syd.optusnet.com.au ([211.29.132.42]:42742 "EHLO mail106.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725839AbfFQWsT (ORCPT ); Mon, 17 Jun 2019 18:48:19 -0400 Received: from dread.disaster.area (pa49-195-189-25.pa.nsw.optusnet.com.au [49.195.189.25]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 769BE3DC8C8; Tue, 18 Jun 2019 08:48:12 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92) (envelope-from ) id 1hd0PC-0005cY-Ew; Tue, 18 Jun 2019 08:47:14 +1000 Date: Tue, 18 Jun 2019 08:47:14 +1000 From: Dave Chinner To: Linus Torvalds Cc: Kent Overstreet , Dave Chinner , "Darrick J . Wong" , Christoph Hellwig , Matthew Wilcox , Amir Goldstein , Jan Kara , Linux List Kernel Mailing , linux-xfs , linux-fsdevel , Josef Bacik , Alexander Viro , Andrew Morton Subject: Re: pagecache locking (was: bcachefs status update) merged) Message-ID: <20190617224714.GR14363@dread.disaster.area> References: <20190610191420.27007-1-kent.overstreet@gmail.com> <20190611011737.GA28701@kmo-pixel> <20190611043336.GB14363@dread.disaster.area> <20190612162144.GA7619@kmo-pixel> <20190612230224.GJ14308@dread.disaster.area> <20190613183625.GA28171@kmo-pixel> <20190613235524.GK14363@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 cx=a_idp_d a=K5LJ/TdJMXINHCwnwvH1bQ==:117 a=K5LJ/TdJMXINHCwnwvH1bQ==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=dq6fvYVFJ5YA:10 a=Z4Rwk6OoAAAA:8 a=7-415B0cAAAA:8 a=yB7Y4sE8DmJNDpec8TgA:9 a=CjuIK1q_8ugA:10 a=HkZW87K1Qel5hWWM3VKY:22 a=biEYGPWJfzWAr4FL6Ov7:22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 14, 2019 at 06:01:07PM -1000, Linus Torvalds wrote: > On Thu, Jun 13, 2019 at 5:08 PM Linus Torvalds > wrote: > > > > I do not believe that posix itself actually requires that at all, > > although extended standards may. > > So I tried to see if I could find what this perhaps alludes to. > > And I suspect it's not in the read/write thing, but the pthreads side > talks about atomicity. > > Interesting, but I doubt if that's actually really intentional, since > the non-thread read/write behavior specifically seems to avoid the > whole concurrency issue. The wording of posix changes every time they release a new version of the standard, and it's _never_ obvious what behaviour the standard is actually meant to define. They are always written with sufficient ambiguity and wiggle room that they could mean _anything_. The POSIX 2017.1 standard you quoted is quite different to older versions, but it's no less ambiguous... > The pthreads atomicity thing seems to be about not splitting up IO and > doing it in chunks when you have m:n threading models, but can be > (mis-)construed to have threads given higher atomicity guarantees than > processes. Right, but regardless of the spec we have to consider that the behaviour of XFS comes from it's Irix heritage (actually from EFS, the predecessor of XFS from the late 1980s). i.e. the IO exclusion model dates to long before POSIX had anything to say about pthreads, and it's wording about atomicity could only refer to to multi-process interactions. These days, however, is the unfortunate reality of a long tail of applications developed on other Unix systems under older POSIX specifications that are still being ported to and deployed on Linux. Hence the completely ambiguous behaviours defined in the older specs are still just as important these days as the completely ambiguous behaviours defined in the new specifications. :/ Cheers, Dave. -- Dave Chinner david@fromorbit.com