diff options
author | Eric Wong <normalperson@yhbt.net> | 2012-02-11 07:28:45 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2012-02-11 07:30:55 +0000 |
commit | aba0194feafb3765ee86cfb40e5d7c7607c8aa42 (patch) | |
tree | 8f0cab39a7a5524bdbb7aa39b742c1fa7e1c683b | |
parent | c103886fadfc54360093964d658b44403cf2df9b (diff) | |
download | cmogstored-aba0194feafb3765ee86cfb40e5d7c7607c8aa42.tar.gz |
BUFSIZ is only 1024 on FreeBSD, this is too small to be optimal for large I/O operations.
-rw-r--r-- | alloc.c | 4 | ||||
-rw-r--r-- | thrpool.c | 2 |
2 files changed, 3 insertions, 3 deletions
@@ -7,13 +7,13 @@ static size_t l1_cache_line_size = L1_CACHE_LINE_MAX; static pthread_key_t mog_rbuf_key; /* for small socket/pipe reads (headers) */ static pthread_key_t mog_fsbuf_key; /* large for filesystem I/O */ -static size_t FSBUF_SIZE = BUFSIZ; /* trust stdio, BUFSIZ=8192 on glibc */ +static size_t FSBUF_SIZE = 8192; #define MOG_MASK(align) (~((size_t)align - 1)) #define MOG_ALIGN(align,val) (((val) + (size_t)align - 1) & MOG_MASK(align)) /* - * Just in case the system page size is larger than BUFSIZ, + * Just in case the system page size is larger than 8192, * crank up FSBUF_SIZE to match since mmap() will internally * round up the allocation anyways */ @@ -9,7 +9,7 @@ * We also use syslog() and *printf() functions which take a lot of * stack under glibc, so we'll add BUFSIZ (8192 on glibc) to that */ -#define MOG_THR_STACK_SIZE ((16 * 1024) + BUFSIZ) +#define MOG_THR_STACK_SIZE ((16 * 1024) + MAX(8192,BUFSIZ)) #if defined(PTHREAD_STACK_MIN) && (PTHREAD_STACK_MIN > MOG_THR_STACK_SIZE) # undef MOG_THR_STACK_SIZE |