X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id ECE523A424A for ; Mon, 25 Oct 2004 23:48:43 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 12603-04 for ; Mon, 25 Oct 2004 22:48:32 +0000 (GMT) Received: from is.rice.edu (is.rice.edu [128.42.42.24]) by svr1.postgresql.org (Postfix) with ESMTP id E4A493A4230 for ; Mon, 25 Oct 2004 23:48:34 +0100 (BST) Received: from localhost (localhost [127.0.0.1]) by localhost.is.rice.edu (Postfix) with ESMTP id E04AC4191D; Mon, 25 Oct 2004 17:48:33 -0500 (CDT) Received: from is.rice.edu ([127.0.0.1]) by localhost (it.is.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 28089-10; Mon, 25 Oct 2004 17:48:30 -0500 (CDT) Received: by is.rice.edu (Postfix, from userid 18612) id 87D0C418C9; Mon, 25 Oct 2004 17:48:30 -0500 (CDT) Date: Mon, 25 Oct 2004 17:48:30 -0500 From: Kenneth Marshall To: Tom Lane Cc: Greg Stark , pgsql-hackers@postgresql.org Subject: Re: [PATCHES] ARC Memory Usage analysis Message-ID: <20041025224830.GQ12041@it.is.rice.edu> References: <1098471059.20926.49.camel@localhost.localdomain> <41796115.2020501@Yahoo.com> <20041022200955.GC4382@it.is.rice.edu> <417D1D01.3090401@Yahoo.com> <20651.1098720192@sss.pgh.pa.us> <87mzyavhxc.fsf@stark.xeocode.com> <87hdoiv62b.fsf@stark.xeocode.com> <790.1098741205@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <790.1098741205@sss.pgh.pa.us> User-Agent: Mutt/1.4.2i X-Virus-Scanned: by amavis-20030314-p2 at is.rice.edu X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/942 X-Sequence-Number: 60445 On Mon, Oct 25, 2004 at 05:53:25PM -0400, Tom Lane wrote: > Greg Stark writes: > > So I would suggest using something like 100us as the threshold for > > determining whether a buffer fetch came from cache. > > I see no reason to hardwire such a number. On any hardware, the > distribution is going to be double-humped, and it will be pretty easy to > determine a cutoff after minimal accumulation of data. The real question > is whether we can afford a pair of gettimeofday() calls per read(). > This isn't a big issue if the read actually results in I/O, but if it > doesn't, the percentage overhead could be significant. > How invasive would reading the "CPU counter" be, if it is available? A read operation should avoid flushing a cache line and we can throw out the obvious outliers since we only need an estimate and not the actual value. --Ken