From owner-cvs-all Sat Jul 4 01:41:25 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA29151 for cvs-all-outgoing; Sat, 4 Jul 1998 01:41:25 -0700 (PDT) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.15.68.22]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA29107; Sat, 4 Jul 1998 01:41:17 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id SAA31111; Sat, 4 Jul 1998 18:41:17 +1000 Date: Sat, 4 Jul 1998 18:41:17 +1000 From: Bruce Evans Message-Id: <199807040841.SAA31111@godzilla.zeta.org.au> To: cvs-committers@FreeBSD.ORG, julian@FreeBSD.ORG Subject: Re: cvs commit: src/sys/dev/vn vn.c Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk > Modified files: > sys/dev/vn vn.c > Log: > Don't use a struct buf (malloc'd) without first initialising all the fields > to some known value! > (probable cause of soft updates exploding with vn devices) Buffers should never be malloced. There is no way of knowing how to initialize new fields like b_dep. geteblk() should always work, but might be a bit slow. vfs_cluster.c uses trypbuf(). This is not quite suitable for vn, since trypbuf() can fail. This is not quite suitable for clustering, since trypbuf can fail :-) (it's fairly easy (1) to use all pbufs doing a singly iozone when the ratio buf/nswbuf is large (2), and then clustering doesn't cluster). I don't like mixing bzero() with explicit initialization of all the necessary fields. vn previously attempted to initialize them all. The bzero() bogotifies all the explicit initializations to 0. (1) The dirty buffers watermarks don't work when there is lots of clustering. Dirty normal buffers are converted to non-dirty normal buffers and dirty pbufs, so processes like iozone aren't limited by the watermarks until clustering breaks down. (2) nswbuf is clamped to a fairly small value, while nbuf is clamped to a relatively large value. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message