mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
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
This commit is contained in:
@@ -30,9 +30,9 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/queue.h>
|
||||
#include <sys/taskqueue.h>
|
||||
#include <sys/thread.h>
|
||||
#include <sys/ck.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -48,16 +48,16 @@ typedef uintptr_t taskqid_t;
|
||||
typedef void (task_func_t)(void *);
|
||||
|
||||
typedef struct taskq_ent {
|
||||
struct task tqent_task;
|
||||
struct timeout_task tqent_timeout_task;
|
||||
union {
|
||||
struct task tqent_task;
|
||||
struct timeout_task tqent_timeout_task;
|
||||
};
|
||||
task_func_t *tqent_func;
|
||||
void *tqent_arg;
|
||||
taskqid_t tqent_id;
|
||||
CK_LIST_ENTRY(taskq_ent) tqent_hash;
|
||||
uint8_t tqent_type;
|
||||
uint8_t tqent_registered;
|
||||
uint8_t tqent_cancelled;
|
||||
volatile uint32_t tqent_rc;
|
||||
taskqid_t tqent_id;
|
||||
LIST_ENTRY(taskq_ent) tqent_hash;
|
||||
uint_t tqent_type;
|
||||
volatile uint_t tqent_rc;
|
||||
} taskq_ent_t;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user