Create a dynamically sized pool of threads for doing very slow work items
authorDavid Howells <dhowells@redhat.com>
Fri, 3 Apr 2009 15:42:35 +0000 (16:42 +0100)
committerDavid Howells <dhowells@redhat.com>
Fri, 3 Apr 2009 15:42:35 +0000 (16:42 +0100)
commit07fe7cb7c7c179f473fd9c823348fd3eb5dad369
tree516c959de929a4c39870629e550b3307601fa73f
parent8fe74cf053de7ad2124a894996f84fa890a81093
Create a dynamically sized pool of threads for doing very slow work items

Create a dynamically sized pool of threads for doing very slow work items, such
as invoking mkdir() or rmdir() - things that may take a long time and may
sleep, holding mutexes/semaphores and hogging a thread, and are thus unsuitable
for workqueues.

The number of threads is always at least a settable minimum, but more are
started when there's more work to do, up to a limit.  Because of the nature of
the load, it's not suitable for a 1-thread-per-CPU type pool.  A system with
one CPU may well want several threads.

This is used by FS-Cache to do slow caching operations in the background, such
as looking up, creating or deleting cache objects.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
include/linux/slow-work.h [new file with mode: 0644]
init/Kconfig
kernel/Makefile
kernel/slow-work.c [new file with mode: 0644]