zfs/module/splat
Brian Behlendorf 3238e71763 splat taskq:cancel: Add test case
Add a test case for taskq_cancel_id() to verify it is working
properly.  Just like taskq:delay we start by dispatching 100
tasks.  However this time 1/3 of the tasks use taskq_dispatch()
and will be run immediately, and 2/3 use taskq_dispatch_delay().
The idea is to create a busy taskq with both active, pending,
and delayed tasks.

After all the items have been successfully dispatched the test
begins randomly canceling known task ids.  It will do this for
5 seconds randomly canceling a task id and then sleeping for a
few milliseconds.   The task being canceled may have already run,
still be on the pending list, or may be currently being executed
by a worker thread.  The idea is to ensure we catch any subtle
race conditions.

Once all the non-canceled tasks have completed we cross check
the number of tasks which ran with the number of tasks which
were successfully canceled.  Additionally, we verify that the
taskq_cancel_id() function never blocks longer than needed.
This time is bounded by the longest run time of the task which
was dispatched.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2012-12-12 09:56:49 -08:00
..
Makefile.in Add script for builtin module building. 2012-07-26 15:13:09 -07:00
splat-atomic.c splat atomic:64-bit: Create thread outside spin lock 2012-11-06 14:48:57 -08:00
splat-condvar.c Linux compat 3.7, kernel_thread() 2012-12-03 09:36:21 -08:00
splat-cred.c splat: Cleanup headers 2012-11-06 14:48:56 -08:00
splat-ctl.c splat: Fix log buffer locking 2012-11-06 14:48:56 -08:00
splat-generic.c splat: Cleanup headers 2012-11-06 14:48:56 -08:00
splat-internal.h splat: Fix log buffer locking 2012-11-06 14:48:56 -08:00
splat-kmem.c splat kmem:slab_overcommit: Disabled 2012-11-06 14:48:57 -08:00
splat-kobj.c splat: Cleanup headers 2012-11-06 14:48:56 -08:00
splat-linux.c splat linux:shrinker: Fix fail-safe 2012-12-12 09:04:29 -08:00
splat-list.c splat: Cleanup headers 2012-11-06 14:48:56 -08:00
splat-mutex.c splat: Cleanup headers 2012-11-06 14:48:56 -08:00
splat-random.c splat: Cleanup headers 2012-11-06 14:48:56 -08:00
splat-rwlock.c Linux compat 3.7, kernel_thread() 2012-12-03 09:36:21 -08:00
splat-taskq.c splat taskq:cancel: Add test case 2012-12-12 09:56:49 -08:00
splat-thread.c splat: Cleanup headers 2012-11-06 14:48:56 -08:00
splat-time.c splat: Cleanup headers 2012-11-06 14:48:56 -08:00
splat-vnode.c splat: Cleanup headers 2012-11-06 14:48:56 -08:00
splat-zlib.c splat: Cleanup headers 2012-11-06 14:48:56 -08:00