From owner-svn-src-stable@FreeBSD.ORG Mon Apr 12 21:12:03 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74DA7106566C; Mon, 12 Apr 2010 21:12:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 634AA8FC08; Mon, 12 Apr 2010 21:12:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3CLC39Y041796; Mon, 12 Apr 2010 21:12:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3CLC30K041793; Mon, 12 Apr 2010 21:12:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201004122112.o3CLC30K041793@svn.freebsd.org> From: Andriy Gapon Date: Mon, 12 Apr 2010 21:12:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206508 - stable/8/lib/libc/db/hash X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 21:12:03 -0000 Author: avg Date: Mon Apr 12 21:12:03 2010 New Revision: 206508 URL: http://svn.freebsd.org/changeset/base/206508 Log: MFC r206178: ibc/db/hash: cap auto-tuned block size Modified: stable/8/lib/libc/db/hash/hash.c stable/8/lib/libc/db/hash/hash.h Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/db/hash/hash.c ============================================================================== --- stable/8/lib/libc/db/hash/hash.c Mon Apr 12 21:09:13 2010 (r206507) +++ stable/8/lib/libc/db/hash/hash.c Mon Apr 12 21:12:03 2010 (r206508) @@ -293,6 +293,8 @@ init_hash(HTAB *hashp, const char *file, if (stat(file, &statbuf)) return (NULL); hashp->BSIZE = statbuf.st_blksize; + if (hashp->BSIZE > MAX_BSIZE) + hashp->BSIZE = MAX_BSIZE; hashp->BSHIFT = __log2(hashp->BSIZE); } Modified: stable/8/lib/libc/db/hash/hash.h ============================================================================== --- stable/8/lib/libc/db/hash/hash.h Mon Apr 12 21:09:13 2010 (r206507) +++ stable/8/lib/libc/db/hash/hash.h Mon Apr 12 21:12:03 2010 (r206508) @@ -118,7 +118,7 @@ typedef struct htab { /* Memory reside /* * Constants */ -#define MAX_BSIZE 65536 /* 2^16 */ +#define MAX_BSIZE 32768 /* 2^15 but should be 65536 */ #define MIN_BUFFERS 6 #define MINHDRSIZE 512 #define DEF_BUFSIZE 65536 /* 64 K */