From owner-freebsd-arch@FreeBSD.ORG Tue May 21 04:56:31 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 55C96AC8 for ; Tue, 21 May 2013 04:56:31 +0000 (UTC) (envelope-from oritm@mellanox.com) Received: from eu1sys200aog121.obsmtp.com (eu1sys200aog121.obsmtp.com [207.126.144.151]) by mx1.freebsd.org (Postfix) with ESMTP id 1EC48F33 for ; Tue, 21 May 2013 04:56:29 +0000 (UTC) Received: from MTLCAS01.mtl.com ([193.47.165.155]) (using TLSv1) by eu1sys200aob121.postini.com ([207.126.147.11]) with SMTP ID DSNKUZr+dmzSTBOsY1GP9BxY9dWv66xsJket@postini.com; Tue, 21 May 2013 04:56:30 UTC Received: from MTLDAG01.mtl.com ([10.0.8.75]) by MTLCAS01.mtl.com ([10.0.8.71]) with mapi id 14.03.0123.003; Tue, 21 May 2013 07:56:21 +0300 From: Orit Moskovich To: "freebsd-arch@freebsd.org" Subject: compatibility layer - workqueues Thread-Topic: compatibility layer - workqueues Thread-Index: Ac5VXKj03BQxK72QTQOa5FKJdihNUQ== Date: Tue, 21 May 2013 04:56:20 +0000 Message-ID: <981733489AB3BD4DB24B48340F53E0A55B0D0938@MTLDAG01.mtl.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.0.13.1] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 04:56:31 -0000 Hi, I'm working on understanding the difference between Linux and FreeBSD inter= rupt 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 g= lobal workqueue 'events'. This workqueue consists of worker threads - one p= er processor * The compatibility layer wraps this function to a macro, that impl= ements the functionality using taskqueue_enqueue() and set it to work on ta= skqueue_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, Thanks, Orit Moskovich