]> git.proxmox.com Git - mirror_spl.git/commit - module/spl/spl-taskq.c
Fix taskq dynamic spawning
authortuxoko <tuxoko@gmail.com>
Fri, 6 Nov 2015 23:00:55 +0000 (15:00 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 13 Nov 2015 23:02:55 +0000 (15:02 -0800)
commitf5f2b87df0362242b13b8183a2a8d88be63b0e73
tree4618a8a290f8961fe6998845fd10d0a63dc4efc0
parent3e7e6f34d0b39b210de68fd69a0c08c6d21227a5
Fix taskq dynamic spawning

Currently taskq_dispatch() will spawn new task with a condition that the caller
is also a member of the taskq. However, under this condition, it will still
cause deadlock where a task on tq1 is waiting another thread, who is trying to
dispatch a task on tq1. So this patch removes the check.

For example when you do:
zfs send pp/fs0@001 | zfs recv pp/fs0_copy

This will easily deadlock before this patch.

Also, move the seq_task check from taskq_thread_spawn() to taskq_thread()
because it's not used by the caller from taskq_dispatch().

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #496
module/spl/spl-taskq.c