From owner-freebsd-drivers@FreeBSD.ORG Thu May 30 12:18:53 2013 Return-Path: Delivered-To: freebsd-drivers@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 B12847AA for ; Thu, 30 May 2013 12:18:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8ABAAA7D for ; Thu, 30 May 2013 12:18:53 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E8093B968; Thu, 30 May 2013 08:18:52 -0400 (EDT) From: John Baldwin To: Orit Moskovich Subject: Re: taskqueues Date: Thu, 30 May 2013 08:08:12 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <981733489AB3BD4DB24B48340F53E0A55B0D5206@MTLDAG01.mtl.com> <201305291156.29230.jhb@freebsd.org> <981733489AB3BD4DB24B48340F53E0A55B0D6417@MTLDAG01.mtl.com> In-Reply-To: <981733489AB3BD4DB24B48340F53E0A55B0D6417@MTLDAG01.mtl.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201305300808.12692.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 30 May 2013 08:18:53 -0400 (EDT) Cc: "freebsd-drivers@freebsd.org" X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 12:18:53 -0000 On Thursday, May 30, 2013 2:04:48 am Orit Moskovich wrote: > Also, is it possible to set affinity of a task in a taskqueue? From what I understood, each interrupt thread handling taskqueues and the ithread of the bus_setup_intr is a single thread, not one per cpu. Correct. > What possibilities I have if I need to defer work from a filter routine to multiple tasks, and schedule them to work on a specific core? Currently there is no pre-built API to give you per-CPU work queues. However, you could create a taskqueue for each CPU (and schedule an initial task that calls sched_bind() to bind the associated thread to a specific CPU) and then you could schedule a task for a specific CPU by scheduling it on the taskqueue for a specific CPU. -- John Baldwin