From owner-freebsd-hackers Fri Apr 18 13:00:19 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id NAA29469 for hackers-outgoing; Fri, 18 Apr 1997 13:00:19 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id NAA29456 for ; Fri, 18 Apr 1997 13:00:14 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id MAA02638; Fri, 18 Apr 1997 12:57:51 -0700 From: Terry Lambert Message-Id: <199704181957.MAA02638@phaeton.artisoft.com> Subject: Re: video capture driver interface to file system? To: luigi@labinfo.iet.unipi.it (Luigi Rizzo) Date: Fri, 18 Apr 1997 12:57:51 -0700 (MST) Cc: dufault@hda.com, hasty@rah.star-gate.com, terry@lambert.org, freebsd-hackers@freebsd.org In-Reply-To: <199704181021.MAA08439@labinfo.iet.unipi.it> from "Luigi Rizzo" at Apr 18, 97 12:21:16 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > Pre-allocate the file; pre-allocate the blocks of a file; pre-set > > up some control info for a transfer, mmap a set of blocks for the > > video card driver to dump data into; have the driver chain to the > > next block and interrupt you on each transfer, dump the video frames > > to the pre-allocated store. > > and probably, in addition to preallocation, make sure that your write() > calls are aligned to the FS/device blocksize otherwise (probably) each > write will be preceeded by a hidden read to take care of fragmentation ? Actually, the block mapping overhead is higher if you aren't on a page multiple boundry and not a page size; that appears to be the fastest path in the VM code. Otherwise you end up manipulating multiple mappings for each operation. Follow /sys/kern/vfs_bio.c, specifically down through vfs_busy_pages() into the bowels of the VM system for details. I think in some very specific-use circumstances, the best bet would be a 4k FS block size. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.