summaryrefslogtreecommitdiff
path: root/drivers/staging/dst/thread_pool.c
AgeCommit message (Collapse)Author
2009-04-03Staging: DST: extend thread pool exit conditions.Evgeniy Polyakov
Added thread pool exit condition into the thread_pool_del_worker(). If called in parallel another thread can steal Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03Staging: dst: thread pool.Evgeniy Polyakov
Kernel currently does not allow to queue work into some entity which will perform it in the process context and have simple way to extend number of worker and work with them not as separate objects, but with pool as a whole. So thread pool model was implemented in the DST. Thread pool abstraction allows to schedule a work to be performed on behalf of kernel thread. One does not operate with threads itself, instead user provides setup and cleanup callbacks for thread pool itself, and action and cleanup callbacks for each submitted work. Each worker has private data initialized at creation time and data, provided by user at scheduling time. When action is being performed, thread can not be used by other users, instead they will sleep until there is free thread to pick their work. Thread pool is used for crypto processing of incoming and outgoing IO requests to reduce the overall overhead. Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>