Re: Checksum/copy

From: Peter Wemm <peter_at_wemm.org>
Date: Fri, 28 Mar 2003 16:23:21 -0800
Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= wrote:
> David Malone <dwmalone_at_maths.tcd.ie> writes:
> > On Thu, Mar 27, 2003 at 09:57:35AM +0100, des_at_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.

Cheers,
-Peter
--
Peter Wemm - peter_at_wemm.org; peter_at_FreeBSD.org; peter_at_yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5
Received on Fri Mar 28 2003 - 16:23:22 UTC