[sheepdog] [PATCH v3 0/5] work: implement a dynamically changing thread pool

MORITA Kazutaka morita.kazutaka at gmail.com
Sun Mar 3 14:08:01 CET 2013


This removes a short thread feature, and adds a worker thread pool
again with support of dymanic pool size.  The reasons we need this
series are:

 - Currently, sheep calls a pthread_create for every I/O request, but
   the overhead is not so cheap especially when the underlying disk is
   fast (e.g. the disk has non-volatile cache).

 - Some operations (e.g. object cache pusher) consumes too many
   threads and causes a problem.  To control the maximum number of
   threads, a thread pool model is better for us.

Changes from v2:
 - fix a typo
 - explain why we need unlimit size of thread pool
 - explain why we need a protection period for shrinking thread pool

Changes from v1:
 - introduce a protection period for shrining work queue to avoid
   frequent creation/deletion of threads
 - rebase onto the latest master
 - some cleanups

MORITA Kazutaka (5):
  work: remove short thread
  logger: use LWP for worker idx
  work: remove unused codes
  work: grow the number of worker threads dynamically
  work: shrink the number of worker threads dynamically

 include/logger.h |    2 +-
 include/util.h   |    1 +
 lib/logger.c     |    5 +-
 lib/util.c       |    6 ++
 sheep/sheep.c    |   16 ++---
 sheep/work.c     |  192 ++++++++++++++++++++++++++++--------------------------
 sheep/work.h     |   13 ++--
 7 files changed, 125 insertions(+), 110 deletions(-)

-- 
1.7.9.5




More information about the sheepdog mailing list