From owner-freebsd-arch@FreeBSD.ORG Mon Oct 6 23:29:26 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 32CCC16A4B3; Mon, 6 Oct 2003 23:29:26 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id F297343FCB; Mon, 6 Oct 2003 23:29:24 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h976TH2B032325; Tue, 7 Oct 2003 08:29:18 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Sam Leffler From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 06 Oct 2003 17:53:28 PDT." <200310061753.28562.sam@errno.com> Date: Tue, 07 Oct 2003 08:29:17 +0200 Message-ID: <32324.1065508157@critter.freebsd.dk> cc: arch@freebsd.org Subject: Re: Alignment of disk-I/O from userland. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Oct 2003 06:29:26 -0000 In message <200310061753.28562.sam@errno.com>, Sam Leffler writes: >On Monday 06 October 2003 04:11 pm, Poul-Henning Kamp wrote: >> In message <20031006163218.L55190@pooker.samsco.home>, Scott Long writes: > ...stuff deleted... >> >As for returning an error code for a buffer that we (arbitrarily) believe >> >to be too big to align, [...] >> >> I have never advocated returning an error based on "alignment and size", >> only based on alignment alone. > >Imposing this restriction is a major semantic change that I consider a very >bad idea. You are basically imposing the semantics of O_DIRECT on all i/o >operations going to a device. I think it is important to give best effort to >support unaligned operations `by default. I can imagine restricting this to >some upper size bound but existing applications, regardless of how well you >consider them to be written, must continue to work. Now now, you are missing two of the finer points: 1: Not "on all i/o operations going to a device", but rather "on i/o operations which take the physread/write fast-path to avoid a copyin/out overhead." (disks and tapes mostly). Ttys, /dev/null and all the "typical" devices are unaffected. 2: Right now we _do_ impose this restriction, but our error-reporting is wildly inaccurate. -- 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.