1、调度优先级不同: threaded irq handler所在的进程(内核线程),调度类别是SCHED_FIFO,是实时内核线程。 workqueue所依赖的线程池创建的kworker线程调度类别是SCHED_NORMAL,是普通内核线程。 2、多核并发效率不同: workqueue机制是内核启动时会为每个CPU创建几个不同优先级的kworker(worker_thread)内核线程,用以集中处...
__smp_call_single_queue(cpu, &work->llnode); } else { __irq_work_queue_local(work); } @@ -131,6 +130,31 @@ bool irq_work_needs_cpu(void) return true; } void irq_work_single(void *arg) { struct irq_work *work = arg; int flags; /* * Clear the PENDING bit, after this...
In a work handler (of a work queue) I want to avoid the concurrentlyusage of a socket (because there can be more worker-threads on a SMPsystem)... My first idea was to use spin_lock_irqsave in the work handler: ... spin_lock_irqsave(&tx_d->lock, flags); sock_sendmsg(...);...