svn commit: r206508 - stable/8/lib/libc/db/hash
Andriy Gapon
avg at FreeBSD.org
Mon Apr 12 21:12:03 UTC 2010
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 */
More information about the svn-src-stable-8
mailing list