From owner-cvs-all@FreeBSD.ORG Fri Mar 28 18:42:04 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A0A237B401; Fri, 28 Mar 2003 18:42:04 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADBAB43FA3; Fri, 28 Mar 2003 18:42:02 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id NAA13225; Sat, 29 Mar 2003 13:41:26 +1100 Date: Sat, 29 Mar 2003 13:41:25 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Peter Wemm In-Reply-To: <20030329002321.BE6752A8C1@canning.wemm.org> Message-ID: <20030329133505.J9370@gamplex.bde.org> References: <20030329002321.BE6752A8C1@canning.wemm.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: David Malone cc: src-committers@FreeBSD.org cc: Nate Lawson cc: cvs-src@FreeBSD.org cc: Mike Silbersack cc: cvs-all@FreeBSD.org cc: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= Subject: Re: Checksum/copy X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2003 02:42:06 -0000 On Fri, 28 Mar 2003, Peter Wemm wrote: > Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= wrote: > > David Malone writes: > > > On Thu, Mar 27, 2003 at 09:57:35AM +0100, des@ofug.org wrote: > > > > Might it be a good idea to have separate b{copy,zero} implementations > > > > for special purposes like pmap_{copy,zero}_page? > > > We do have a i686_pagezero already, which seems to be used in > > > pmap_zero_page - I guess it may not be well tuned to modern processors, > > > as it is almost 5 years old. > > > > i686_pagezero uses 'rep stosl' after an initial 'rep scasl' to check > > if the page was already zero (which is a pessimization unless we zero > > a lot of pages that are already zeroed). SSE can do far better than > > that. > > i686_pagezero was written with SMP in mind. The cache state ends up in > a more favourable condition when sharing with other cpus. Hmm. The SMP advantage seems to be mainly a poor man's avoidance of clobbering caches. By writing only to cache lines that are are not all zero, we avoid busting all on-CPU caches except the ones on the CPU doing the zeroing. This makes the main bug in i686_pagezero() even sillier. We actually write zeros to everything after the first nonzero word, so we only get the cache benefit for cache lines up to the first not-all-zero one. Bruce