From owner-freebsd-current@FreeBSD.ORG Thu Aug 4 08:58:44 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 009BE16A41F; Thu, 4 Aug 2005 08:58:43 +0000 (GMT) (envelope-from sobomax@web.portaone.com) Received: from www.portaone.com (web.portaone.com [195.70.151.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 51D4243D5D; Thu, 4 Aug 2005 08:58:42 +0000 (GMT) (envelope-from sobomax@web.portaone.com) Received: from www.portaone.com (localhost [127.0.0.1]) by www.portaone.com (8.12.11/8.12.11) with ESMTP id j748wcvc021317 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 4 Aug 2005 10:58:38 +0200 (CEST) (envelope-from sobomax@web.portaone.com) Received: (from sobomax@localhost) by www.portaone.com (8.12.11/8.12.11/Submit) id j748wcAw021316; Thu, 4 Aug 2005 10:58:38 +0200 (CEST) (envelope-from sobomax) Date: Thu, 4 Aug 2005 10:58:38 +0200 From: Maxim Sobolev To: Andrey Chernov , Dan Nelson , "current@freebsd.org" Message-ID: <20050804085838.GA20122@www.portaone.com> References: <42F0CCD5.9090200@portaone.com> <20050803150117.GD93405@dan.emsphone.com> <42F0E9B2.9080208@portaone.com> <20050804060251.GA21228@nagual.pp.ru> <20050804060830.GB21228@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050804060830.GB21228@nagual.pp.ru> User-Agent: Mutt/1.5.8i X-Virus-Scanned: ClamAV 0.86.2/1002/Wed Aug 3 12:29:36 2005 on www.portaone.com X-Virus-Status: Clean Cc: Subject: Re: Sub-optimal libc's read-ahead buffering behaviour X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2005 08:58:44 -0000 On Thu, Aug 04, 2005 at 10:08:30AM +0400, Andrey Chernov wrote: > On Thu, Aug 04, 2005 at 10:02:51AM +0400, Andrey Chernov wrote: > > No surprize. Single read can be consider as sort of "atomic" operation. > > But between read & seek character device itself can move its pointer in > > anyplace. > > No only move the pinter, but change contents too. Consider reading > /dev/mem Actually this is good example which supports my point, since with the current behaviour when doing 2 subsequent reads each of them less than 4K in size you will get either outdated data from the second read or even worse - mix of the old data and the new data when second read crosses buffer boundary! I think that any buffering should be disabled for reading from chardev no matter how "historic" our current behaviour is. -Maxim