From owner-freebsd-arch@FreeBSD.ORG Tue May 21 14:47:29 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C9DEF6D9 for ; Tue, 21 May 2013 14:47:29 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) by mx1.freebsd.org (Postfix) with ESMTP id 66E2E7DC for ; Tue, 21 May 2013 14:47:29 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id y10so399501wgg.4 for ; Tue, 21 May 2013 07:47:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=JFJb2fHR8GvRgxBnRvDphySTIgqcnjOyZrTXCs7R6Lk=; b=IYFeymnchw55OcFAuK5em8m5yOfTl7Yei7TqdRJLMI3qTSYjk9ZokXA+Ynzy739pVB VKOUP/J0uFWE5j3H8x+BfD603rqoHPpgwzF4pTRtl3z+e2U17swmC8LUi9z6M4uUwKQi zPYqZ7hjctUdVFkdXn8r8LTdEZpUdg/ggI13JrT64ryWHr4eHciLxmXP2BaPmrrk3HJv nXs7rSmnsgUpl+JDxJ5jLSCj8Hx/uFTgMAFecSudoHfMg1CuBzola3ZFprP5etdikcu5 gimHflgXmBSJM1CkbfIrCKANqv6UWpLNW+qjpe1gZGNcId86iXahxqkfnug1lbOoGB6a hJgA== MIME-Version: 1.0 X-Received: by 10.180.72.195 with SMTP id f3mr24224877wiv.32.1369147648517; Tue, 21 May 2013 07:47:28 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.107.9 with HTTP; Tue, 21 May 2013 07:47:28 -0700 (PDT) In-Reply-To: <981733489AB3BD4DB24B48340F53E0A55B0D0938@MTLDAG01.mtl.com> References: <981733489AB3BD4DB24B48340F53E0A55B0D0938@MTLDAG01.mtl.com> Date: Tue, 21 May 2013 07:47:28 -0700 X-Google-Sender-Auth: sCerrGCm5ScVO-hDsqWUvn2oRds Message-ID: Subject: Re: compatibility layer - workqueues From: Adrian Chadd To: Orit Moskovich Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-arch@freebsd.org" 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 14:47:29 -0000 Is there some magic to do with spinlock versus spinlock_bh that we don't necessarily have with your lock/mutex operations? If any spinlocks grab bh locks in Linux then a bunch of work on other CPUs gets disabled. adrian On 20 May 2013 21:56, 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, > > > > Thanks, > > Orit Moskovich > > > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"