From owner-freebsd-arch@FreeBSD.ORG Tue Oct 7 08:41:21 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 BEF3016A4B3 for ; Tue, 7 Oct 2003 08:41:21 -0700 (PDT) Received: from Daffy.timing.com (ns1int.timing.com [206.168.13.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id D459C43F75 for ; Tue, 7 Oct 2003 08:41:20 -0700 (PDT) (envelope-from ben@timing.com) Received: from piglet.timing.com (oink@piglet.timing.com [206.168.13.178]) by Daffy.timing.com (8.12.8p2/8.12.8) with ESMTP id h97FfI3R007432; Tue, 7 Oct 2003 09:41:18 -0600 (MDT) (envelope-from ben@timing.com) Received: from piglet.timing.com (oink@localhost.timing.com [127.0.0.1]) by piglet.timing.com (8.12.6p3/8.12.6) with ESMTP id h97FfII9034088; Tue, 7 Oct 2003 09:41:18 -0600 (MDT) (envelope-from ben@piglet.timing.com) Received: (from ben@localhost) by piglet.timing.com (8.12.6p3/8.12.6/Submit) id h97FfHNF034085; Tue, 7 Oct 2003 09:41:17 -0600 (MDT) From: Ben Mesander MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16258.56989.685473.900678@piglet.timing.com> Date: Tue, 7 Oct 2003 09:41:17 -0600 To: "Poul-Henning Kamp" In-Reply-To: <32324.1065508157@critter.freebsd.dk> References: <200310061753.28562.sam@errno.com> <32324.1065508157@critter.freebsd.dk> X-Mailer: VM 7.00 under Emacs 21.2.95.2 cc: Sam Leffler 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 15:41:21 -0000 Poul-Henning Kamp writes: > 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. How about a flag for open(2), such as O_DIRECT, which would indicate if the fd in question is such a device, and you did not sufficiently align, etc. your buffers, then you get an error when you attempt the I/O operation. If you did not specify this flag when opening the device, then do the bounce buffer dance for the I/O operation, and lose efficiency. --Ben