From owner-freebsd-alpha Wed Sep 4 6:43:23 2002 Delivered-To: freebsd-alpha@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F077B37B400; Wed, 4 Sep 2002 06:43:19 -0700 (PDT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id D0E0443E75; Wed, 4 Sep 2002 06:43:15 -0700 (PDT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id JAA10322; Wed, 4 Sep 2002 09:43:15 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.6/8.9.1) id g84DgiY56510; Wed, 4 Sep 2002 09:42:44 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15734.3540.941843.110159@grasshopper.cs.duke.edu> Date: Wed, 4 Sep 2002 09:42:44 -0400 (EDT) To: John Baldwin Cc: alpha@FreeBSD.ORG, peter@FreeBSD.ORG Subject: Re: FYI: Buffer cache fix gave major speedup In-Reply-To: References: X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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