FreeBSD: Improve taskq wrapper
commit380c25f6402d099310f1cf6f6d1e17e65531f958
authorAlexander Motin <mav@FreeBSD.org>
Fri, 13 Oct 2023 17:41:11 +0000 (13 13:41 -0400)
committerGitHub <noreply@github.com>
Fri, 13 Oct 2023 17:41:11 +0000 (13 10:41 -0700)
tree3dd8439dd55ee055be5ef5395d085c987779b3a2
parent8a740701283495e59944839bb2607f80907d950e
FreeBSD: Improve taskq wrapper

- Group tqent_task and tqent_timeout_task into a union.  They are
never used same time. This shrinks taskq_ent_t from 192 to 160 bytes.
 - Remove tqent_registered.  Use tqent_id != 0 instead.
 - Remove tqent_cancelled.  Use taskqueue pending counter instead.
 - Change tqent_type into uint_t.  We don't need to pack it any more.
 - Change tqent_rc into uint_t, matching refcount(9).
 - Take shared locks in taskq_lookup().
 - Call proper taskqueue_drain_timeout() for TIMEOUT_TASK in
taskq_cancel_id() and taskq_wait_id().
 - Switch from CK_LIST to regular LIST.

Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Mateusz Guzik <mjguzik@gmail.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15356
include/os/freebsd/spl/sys/taskq.h
module/os/freebsd/spl/spl_taskq.c