]> granicus.if.org Git - spl/commit
Replace tq_work_list and tq_threads in taskq_t
authorPrakash Surya <surya1@llnl.gov>
Tue, 6 Dec 2011 01:32:48 +0000 (17:32 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 14 Dec 2011 00:10:50 +0000 (16:10 -0800)
commit2c02b71b1411176905228666abf7a50a2e5f85dc
treeab3447278eb83d088865aca551ee6756c3635621
parent046a70c93b2951bd4c705fb09592d2555a8858f0
Replace tq_work_list and tq_threads in taskq_t

To lay the ground work for introducing the taskq_dispatch_prealloc()
interface, the tq_work_list and tq_threads fields had to be replaced
with new alternatives in the taskq_t structure.

The tq_threads field was replaced with tq_thread_list. Rather than
storing the pointers to the taskq's kernel threads in an array, they are
now stored as a list. In addition to laying the ground work for the
taskq_dispatch_prealloc() interface, this change could also enable taskq
threads to be dynamically created and destroyed as threads can now be
added and removed to this list relatively easily.

The tq_work_list field was replaced with tq_active_list. Instead of
keeping a list of taskq_ent_t's which are currently being serviced, a
list of taskq_threads currently servicing a taskq_ent_t is kept. This
frees up the taskq_ent_t's tqent_list field when it is being serviced
(i.e. now when a taskq_ent_t is being serviced, it's tqent_list field
will be empty).

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #65
include/sys/taskq.h
module/spl/spl-taskq.c