Date: Tue, 21 May 2013 10:38:56 -0400 From: John Baldwin <jhb@freebsd.org> To: freebsd-arch@freebsd.org Cc: Orit Moskovich <oritm@mellanox.com> Subject: Re: compatibility layer - workqueues Message-ID: <201305211038.56191.jhb@freebsd.org> In-Reply-To: <981733489AB3BD4DB24B48340F53E0A55B0D0938@MTLDAG01.mtl.com> References: <981733489AB3BD4DB24B48340F53E0A55B0D0938@MTLDAG01.mtl.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday, May 21, 2013 12:56:20 am Orit Moskovich wrote: > Hi, > > I'm working on understanding the difference between Linux and FreeBSD interrupt handling. > I looked at the compatibility layer and noticed this: > > > * Linux workqueues are implemented using FreeBSD taskqueues (under sys/ofed/include/linux/workqueue.h) > > * In linux, the function schedule_work() puts a job in the kernel global workqueue 'events'. This workqueue consists of worker threads - one per processor > > * The compatibility layer wraps this function to a macro, that implements the functionality using taskqueue_enqueue() and set it to work on taskqueue_thread, that executes its tasks in the context of a kernel thread > > * BUT, taskqueue_thread is initialized in: > > o sys/kern/subr_taskqueue.c line 536: > TASKQUEUE_DEFINE_THREAD(thread); > > o which is defined in sys/taskqueue.h line 133 > and run taskqueue_start_threads() with only 1 thread, and not MAXCPU > > > > I'll appreciate your help understanding this issue, Do you need your events queued to multiple threads? If so, do you require that the event execute on the same CPU that it was scheduled on? (Kind of like a DPC in WDM) If you don't require these things, I think the global taskqueue will still satisfy your need even if it only has one thread. It would not be difficult to create a new taskqueue that used threads pinned to cores for the Linux workqueue compat layer, but I'm not sure you actually need that. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305211038.56191.jhb>