Index: squid/src/fs/aufs/store_dir_aufs.c diff -c squid/src/fs/aufs/store_dir_aufs.c:1.40.2.7 squid/src/fs/aufs/store_dir_aufs.c:1.40.2.8 *** squid/src/fs/aufs/store_dir_aufs.c:1.40.2.7 Wed Jan 8 20:38:38 2003 --- squid/src/fs/aufs/store_dir_aufs.c Wed Aug 6 08:16:26 2003 *************** *** 64,70 **** struct _store_rebuild_data counts; }; ! static int n_asyncufs_dirs = 0; static int *asyncufs_dir_index = NULL; MemPool *squidaio_state_pool = NULL; MemPool *aufs_qread_pool = NULL; --- 64,70 ---- struct _store_rebuild_data counts; }; ! int n_asyncufs_dirs = 0; static int *asyncufs_dir_index = NULL; MemPool *squidaio_state_pool = NULL; MemPool *aufs_qread_pool = NULL; Index: squid/src/fs/aufs/store_asyncufs.h diff -c squid/src/fs/aufs/store_asyncufs.h:1.9.2.1 squid/src/fs/aufs/store_asyncufs.h:1.9.2.2 *** squid/src/fs/aufs/store_asyncufs.h:1.9.2.1 Sat Nov 9 03:42:36 2002 --- squid/src/fs/aufs/store_asyncufs.h Wed Aug 6 08:16:26 2003 *************** *** 7,22 **** #ifndef __STORE_ASYNCUFS_H__ #define __STORE_ASYNCUFS_H__ ! #ifdef AUFS_IO_THREADS ! #define NUMTHREADS AUFS_IO_THREADS ! #else ! #define NUMTHREADS (Config.cacheSwap.n_configured*16) ! #endif /* Queue limit where swapouts are deferred (load calculation) */ ! #define MAGIC1 (NUMTHREADS*Config.cacheSwap.n_configured*5) /* Queue limit where swapins are deferred (open/create fails) */ ! #define MAGIC2 (NUMTHREADS*Config.cacheSwap.n_configured*20) /* Which operations to run async */ #define ASYNC_OPEN 1 --- 7,27 ---- #ifndef __STORE_ASYNCUFS_H__ #define __STORE_ASYNCUFS_H__ ! extern int n_asyncufs_dirs; ! extern int squidaio_nthreads; ! extern int squidaio_magic1; ! extern int squidaio_magic2; ! ! /* Base number of threads if not specified to configure. ! * Weighted by number of directories (see aiops.c) */ ! #define THREAD_FACTOR 16 /* Queue limit where swapouts are deferred (load calculation) */ ! #define MAGIC1_FACTOR 10 ! #define MAGIC1 squidaio_magic1 /* Queue limit where swapins are deferred (open/create fails) */ ! #define MAGIC2_FACTOR 20 ! #define MAGIC2 squidaio_magic2 /* Which operations to run async */ #define ASYNC_OPEN 1 Index: squid/src/fs/aufs/aiops.c diff -c squid/src/fs/aufs/aiops.c:1.12.2.7 squid/src/fs/aufs/aiops.c:1.12.2.8 *** squid/src/fs/aufs/aiops.c:1.12.2.7 Wed Jan 8 22:04:23 2003 --- squid/src/fs/aufs/aiops.c Wed Aug 6 08:16:26 2003 *************** *** 53,58 **** --- 53,66 ---- #define RIDICULOUS_LENGTH 4096 + #ifdef AUFS_IO_THREADS + int squidaio_nthreads = AUFS_IO_THREADS; + #else + int squidaio_nthreads = 0; + #endif + int squidaio_magic1 = 1; /* dummy initializer value */ + int squidaio_magic2 = 1; /* real value set in aiops.c */ + enum _squidaio_thread_status { _THREAD_STARTING = 0, _THREAD_WAITING, *************** *** 133,139 **** static squidaio_thread_t *threads = NULL; static int squidaio_initialised = 0; - #define AIO_LARGE_BUFS 16384 #define AIO_MEDIUM_BUFS AIO_LARGE_BUFS>> 1 #define AIO_SMALL_BUFS AIO_LARGE_BUFS>> 2 --- 141,146 ---- *************** *** 309,315 **** /* Create threads and get them to sit in their wait loop */ squidaio_thread_pool = memPoolCreate("aio_thread", sizeof(squidaio_thread_t)); ! for (i = 0; i < NUMTHREADS; i++) { threadp = memPoolAlloc(squidaio_thread_pool); threadp->status = _THREAD_STARTING; threadp->current_req = NULL; --- 316,333 ---- /* Create threads and get them to sit in their wait loop */ squidaio_thread_pool = memPoolCreate("aio_thread", sizeof(squidaio_thread_t)); ! if (squidaio_nthreads == 0) { ! int j = 16; ! for (i = 0; i < n_asyncufs_dirs; i++) { ! squidaio_nthreads += j; ! j = j * 2 / 3; ! if (j < 4) ! j = 4; ! } ! } ! squidaio_magic1 = squidaio_nthreads * MAGIC1_FACTOR; ! squidaio_magic2 = squidaio_nthreads * MAGIC2_FACTOR; ! for (i = 0; i < squidaio_nthreads; i++) { threadp = memPoolAlloc(squidaio_thread_pool); threadp->status = _THREAD_STARTING; threadp->current_req = NULL;

AltStyle によって変換されたページ (->オリジナル) /