From owner-freebsd-arch@FreeBSD.ORG Sun Apr 13 23:19:13 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA62A10656C6 for ; Sun, 13 Apr 2008 23:19:13 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.175]) by mx1.freebsd.org (Postfix) with ESMTP id 8C1ED8FC18 for ; Sun, 13 Apr 2008 23:19:13 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by wf-out-1314.google.com with SMTP id 25so1360197wfa.7 for ; Sun, 13 Apr 2008 16:19:13 -0700 (PDT) Received: by 10.142.199.10 with SMTP id w10mr696081wff.272.1208128752390; Sun, 13 Apr 2008 16:19:12 -0700 (PDT) Received: from ?10.0.1.199? ( [24.94.72.120]) by mx.google.com with ESMTPS id 30sm10395144wff.11.2008.04.13.16.19.10 (version=SSLv3 cipher=OTHER); Sun, 13 Apr 2008 16:19:11 -0700 (PDT) Date: Sun, 13 Apr 2008 13:19:35 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Poul-Henning Kamp In-Reply-To: <1309.1208100178@critter.freebsd.dk> Message-ID: <20080413131724.X959@desktop> References: <1309.1208100178@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: arch@freebsd.org Subject: Re: f_offset X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2008 23:19:13 -0000 On Sun, 13 Apr 2008, Poul-Henning Kamp wrote: > In message <20080412221654.S959@desktop>, Jeff Roberson writes: > >>> The non p-prefix versions should always be serialized, because there >>> is know way of knowing where they read/write if you don't. >> >> Well that's at odds with what the standard says and what others implement. >> I think there is a clear case for serializing writes. I don't see what >> advantage we get from serializing reads. The heavy cost of >> synchronization should be justified by actual need. > > If you don't serialize read(2) and readv(2), how do you know where > they read from ? Concurrent calls to read() are inherently racy. They will still use the current value of f_offset and store it while they are done. I'm just suggesting we don't use an exclusive lock that is held for the duration of the io to protect the update to the f_offset field. The field will still be updated in such a way that it is atomic. Thanks, Jeff > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk@FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. >