Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Sep 2002 09:42:44 -0400 (EDT)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        John Baldwin <jhb@FreeBSD.ORG>
Cc:        alpha@FreeBSD.ORG, peter@FreeBSD.ORG
Subject:   Re: FYI: Buffer cache fix gave major speedup
Message-ID:  <15734.3540.941843.110159@grasshopper.cs.duke.edu>
In-Reply-To: <XFMail.20020904090455.jhb@FreeBSD.org>
References:  <XFMail.20020904090455.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

John Baldwin writes:
 > On the DS20 I have here, Peter's fix to basically enable the buffer cache
 > gave me about a 38% performance increase for a buildworld -j 2 on current:
 > 
 > Before:
 > --------------------------------------
 > build started at 15:11:08 on 08/28/02
 > build finished at 18:43:05 on 08/28/02
 > --------------------------------------
 > Which is a total time of 3:31:57
 > 
 > After:
 > --------------------------------------
 > build started at 22:41:31 on 09/03/02
 > build finished at 00:51:46 on 09/04/02
 > --------------------------------------
 > Which is a total time of 2:10:15
 > 
 > If this bug exists in 4.x we should really fix it there as well.
 > 

Are you talking about btoc()?  I think stable is immune.  A simple
test shows the buffer cache is working just fine there.

The problem was that phk's version of btoc was truncating
things by using a 32-bit cast.  Eg, phk replaced this:

#define btoc(x)         (((x) + PAGE_MASK) >> PAGE_SHIFT)


With this:

#define btoc(x)	(((unsigned)(x)+PAGE_MASK)>>PAGE_SHIFT)
                   ^^^^^^^^^

Which Peter replaced with:

#define btoc(x)	     (((vm_offset_t)(x)+PAGE_MASK)>>PAGE_SHIFT)


So the difference between -stable and -current is now just the
(vm_offset_t) cast.  I don't _think_ that should make a difference.

But I'm afraid I don't understand how the cast caused such an
innocuous problem as disabling the buffer cache.  I'd have thought it
would have caused memory corruption.

Drew

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15734.3540.941843.110159>