From owner-cvs-all Wed Jun 19 2:39:47 2002 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id C461E37B40D; Wed, 19 Jun 2002 02:39:41 -0700 (PDT) Received: (from dillon@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5J9dfc51512; Wed, 19 Jun 2002 02:39:41 -0700 (PDT) (envelope-from dillon) Message-Id: <200206190939.g5J9dfc51512@freefall.freebsd.org> From: Matt Dillon Date: Wed, 19 Jun 2002 02:39:41 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/ufs/ufs ufs_readwrite.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG dillon 2002/06/19 02:39:41 PDT Modified files: sys/ufs/ufs ufs_readwrite.c Log: In rev 1.72 a situation related to write/mmap was fixed which could result in a user process gaining visibility into the 'old' contents of a filesystem block. There were two cases: (1) when uiomove() fails (user process issues illegal write), and (2) when uiomove() overlaps a mmap() of the same file at the same offset (fault -> recursive buffer I/O reads contents of old block). Unfortunately 1.72 also had the unintended effect of forcing the filesystem to do a read-before-write in the case of a full-block-write (non append case), e.g. 'dd if=/dev/zero of=test.dat bs=1m count=256 conv=notrunc'. This destroys performance.. not only is a read forced for every write, but clustering breaks as well. The solution is to clear the buffer manually in the full-block case rather then asking BALLOC to do it (BALLOC issues the read-before-write). In the partial-block case we want BALLOC to do it because the read-before-write is necessary. This patch should greatly improve database and news-feed server performance. Found by: MKI MFC after: 3 days Revision Changes Path 1.90 +11 -7 src/sys/ufs/ufs/ufs_readwrite.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message