From owner-freebsd-arch@FreeBSD.ORG Mon Oct 6 14:46:54 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 769DC16A4B3 for ; Mon, 6 Oct 2003 14:46:54 -0700 (PDT) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 92A4B43FD7 for ; Mon, 6 Oct 2003 14:46:53 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.9/8.12.9) with ESMTP id h96Lkpgk093487 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK CN=khavrinen.lcs.mit.edu issuer=SSL+20Client+20CA); Mon, 6 Oct 2003 17:46:52 -0400 (EDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.9/8.12.9/Submit) id h96Lkpx0093486; Mon, 6 Oct 2003 17:46:51 -0400 (EDT) (envelope-from wollman) Date: Mon, 6 Oct 2003 17:46:51 -0400 (EDT) From: Garrett Wollman Message-Id: <200310062146.h96Lkpx0093486@khavrinen.lcs.mit.edu> To: phk@phk.freebsd.dk X-Newsgroups: mit.lcs.mail.freebsd-arch In-Reply-To: <21229.1065441969@critter.freebsd.dk> Organization: MIT Laboratory for Computer Science X-Spam-Score: -3.3 () IN_REP_TO X-Scanned-By: MIMEDefang 2.37 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: Mon, 06 Oct 2003 21:46:54 -0000 PHK writes: >Most code which does disk I/O from userland uses malloc'ed buffers for >the sectors and the alignment comes for free, but we currently have >no requirement that it be so. I believe that the Standard allows practically arbitrary restrictions on what may be done with devices (since most devices, aside from ttys, are outside the scope of the Standard anyway). It says that read() may fail if: [ENXIO] A request was made of a nonexistent device, or the request was outside the capabilities of the device. (I'm assuming you're talking about reads from devices, as opposed to reads from files.) I think that gives us plenary authority to require appropriate alignment of data buffers used to access disk devices directly. -GAWollman