mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-18 10:21:01 +03:00
d9acd930b5
Add the ability to dispatch a delayed task to a taskq. The desired behavior is for the task to be queued but not executed by a worker thread until the expiration time is reached. To achieve this two new functions were added. * taskq_dispatch_delay() - This function behaves exactly like taskq_dispatch() however it takes a third 'expire_time' argument. The caller should pass the desired time the task should be executed as an absolute value in jiffies. The task is guarenteed not to run before this time, it may run slightly latter if all the worker threads are busy. * taskq_cancel_id() - Given a task id attempt to cancel the task before it gets executed. This is primarily useful for canceling delay tasks but can be used for canceling any previously dispatched task. There are three possible return values. 0 - The task was found and canceled before it was executed. ENOENT - The task was not found, either it was already run or an invalid task id was supplied by the caller. EBUSY - The task is currently executing any may not be canceled. This function will block until the task has been completed. * taskq_wait_all() - The taskq_wait_id() function was renamed taskq_wait_all() to more clearly reflect its actual behavior. It is only curreny used by the splat taskq regression tests. * taskq_wait_id() - Historically, the only difference between this function and taskq_wait() was that you passed the task id. In both functions you would block until ALL lower task ids which executed. This was semantically correct but could be very slow particularly if there were delay tasks submitted. To better accomidate the delay tasks this function was reimplemnted. It will now only block until the passed task id has been completed. This is actually a fairly low risk change for a few reasons. * Only new ZFS callers will make use of the new interfaces and very little common code was changed to support the new functions. * The existing taskq_wait() implementation was not changed just slightly refactored. * The newly optimized taskq_wait_id() implementation was never used by ZFS we can't accidentally introduce a new bug there. NOTE: This functionality does not exist in the Illumos taskqs. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> |
||
---|---|---|
.. | ||
fm | ||
fs | ||
sysevent | ||
acl_impl.h | ||
acl.h | ||
atomic.h | ||
attr.h | ||
bitmap.h | ||
bootconf.h | ||
bootprops.h | ||
buf.h | ||
byteorder.h | ||
callb.h | ||
cmn_err.h | ||
compress.h | ||
condvar.h | ||
conf.h | ||
console.h | ||
cpupart.h | ||
cpuvar.h | ||
crc32.h | ||
cred.h | ||
ctype.h | ||
ddi.h | ||
debug.h | ||
dirent.h | ||
disp.h | ||
dkio.h | ||
dklabel.h | ||
dnlc.h | ||
dumphdr.h | ||
efi_partition.h | ||
errno.h | ||
extdirent.h | ||
fcntl.h | ||
file.h | ||
idmap.h | ||
int_limits.h | ||
int_types.h | ||
inttypes.h | ||
isa_defs.h | ||
kidmap.h | ||
kmem.h | ||
kobj.h | ||
kstat.h | ||
list.h | ||
mkdev.h | ||
mntent.h | ||
modctl.h | ||
mode.h | ||
mount.h | ||
mutex.h | ||
note.h | ||
open.h | ||
param.h | ||
pathname.h | ||
policy.h | ||
pool.h | ||
priv_impl.h | ||
proc.h | ||
processor.h | ||
pset.h | ||
random.h | ||
refstr.h | ||
resource.h | ||
rwlock.h | ||
sdt.h | ||
sid.h | ||
signal.h | ||
stat.h | ||
stropts.h | ||
sunddi.h | ||
sunldi.h | ||
sysdc.h | ||
sysevent.h | ||
sysmacros.h | ||
systeminfo.h | ||
systm.h | ||
t_lock.h | ||
taskq.h | ||
thread.h | ||
time.h | ||
timer.h | ||
tsd.h | ||
types32.h | ||
types.h | ||
u8_textprep.h | ||
uio.h | ||
unistd.h | ||
utsname.h | ||
va_list.h | ||
varargs.h | ||
vfs_opreg.h | ||
vfs.h | ||
vmsystm.h | ||
vnode.h | ||
zmod.h | ||
zone.h |