Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

workqueue_enqueue(9) [netbsd man page]

WORKQUEUE(9)						   BSD Kernel Developer's Manual					      WORKQUEUE(9)

NAME
workqueue -- simple do-it-in-thread-context framework SYNOPSIS
#include <sys/workqueue.h> int workqueue_create(struct workqueue **wqp, const char *name, void (*func)(struct work *, void *), void *arg, pri_t prio, int ipl, int flags); void workqueue_enqueue(struct workqueue *wq, struct work *wk, struct cpu_info *ci); void workqueue_destroy(struct workqueue *wq); DESCRIPTION
The workqueue utility routines are provided to defer work which is needed to be processed in a thread context. workqueue_create() creates a workqueue. It takes the following arguments: wqp Specify where to store the created workqueue. name The name of the workqueue. func The function to be called for each work. arg An argument to be passed as a second argument of func. prio The priority level for the worker threads. ipl The highest IPL at which this workqueue is used. flags The value of 0 indicates a standard create operation, however the following flags may be bitwise ORed together: WQ_MPSAFE Specifies that the workqueue is multiprocessor safe and does its own locking, otherwise the kernel lock will be held while work will be processed. WQ_PERCPU Specifies that the workqueue should have a separate queue for each CPU, thus the work could be enqueued on concrete CPUs. workqueue_enqueue() enqueues the work wk into the workqueue wq. If the WQ_PERCPU flag was set on workqueue creation, the ci argument may be used to specify the CPU on which the work should be enqueued. Also it may be NULL, then work will be enqueued on the current CPU. If WQ_PERCPU flag was not set, ci must be NULL. The enqueued work will be processed in a thread context. A work must not be enqueued again until the callback is called by the workqueue framework. workqueue_destroy() destroys a workqueue and frees associated resources. The caller should ensure that the workqueue has no work enqueued beforehand. RETURN VALUES
workqueue_create() returns 0 on success. Otherwise, it returns an errno(2). CODE REFERENCES
The workqueue subsystem is implemented within the file sys/kern/subr_workqueue.c. SEE ALSO
callout(9), condvar(9), kthread(9), softint(9) BSD
October 24, 2011 BSD

Check Out this Related Man Page

TAPSET::IRQ(3stap)														TAPSET::IRQ(3stap)

NAME
tapset::irq - Systemtap probes for IRQ, workqueue,etc DESCRIPTION
Probe points for probing irq handler execution, softirqs, workqueues,etc workqueue.create probes creation of a new workqueue Arguments: wq_thread task_struct of the workqueue thread. cpu cpu for which the worker thread is created. workqueue.insert probes queuing of work on a workqueue. Arguments: wq_thread task_struct of the workqueue thread. work work_struct* being executed. work_func pointer to handler func. workqueue.execute probes execution of deferred work. Arguments: wq_thread task_struct of the workqueue thread. work work_struct* being executed. work_func pointer to handler func. workqueue.destroy probes destruction of each worker thread of each cpu for a workqueue. Arguments: wq_thread task_struct of the workqueue thread. irq_handler.entry Fires prior to execution of interrupt handler. Arguments: irq irq number action struct irqaction* for this interrupt number handler interrupt handler function flags flags for this irq. flags_str A formatted string of flags. dev_name name of device dev_id cookie to identify device next_irqaction pointer to next irqaction for shared interrupts dir pointer to the /proc/irq/NN/name entry thread_fn interrupt handler function for threaded interrupts thread thread pointer for threaded interrupts thread_flags flags related to thread irq_handler.exit Fires post execution of interrupt handler. Arguments: irq irq number action struct irqaction* for this interrupt number ret return value from interrupt handler that just executed. handler interrupt handler function flags flags for this irq. flags_str A formatted string of flags. dev_name name of device dev_id cookie to identify device next_irqaction pointer to next irqaction for shared interrupts dir pointer to the /proc/irq/NN/name entry thread_fn interrupt handler function for threaded interrupts thread thread pointer for threaded interrupts thread_flags flags related to thread softirq.entry triggered just before executing handler for a pending softirq Arguments: h struct softirq* for current pending softirq. vec softirq_action vector action pointer to softirq handler just about to execute. softirq.exit triggered just after executing handler for a pending softirq Arguments: h struct softirq* for just executed softirq. vec softirq_action vector action pointer to softirq handler that just finished execution. SEE ALSO
stap(1), stapprobes(3stap) IBM
TAPSET::IRQ(3stap)
Man Page