Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 May 2013 08:06:24 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Orit Moskovich <oritm@mellanox.com>
Cc:        "freebsd-drivers@freebsd.org" <freebsd-drivers@freebsd.org>
Subject:   Re: taskqueues
Message-ID:  <201305300806.24399.jhb@freebsd.org>
In-Reply-To: <981733489AB3BD4DB24B48340F53E0A55B0D63D3@MTLDAG01.mtl.com>
References:  <981733489AB3BD4DB24B48340F53E0A55B0D5206@MTLDAG01.mtl.com> <201305291156.29230.jhb@freebsd.org> <981733489AB3BD4DB24B48340F53E0A55B0D63D3@MTLDAG01.mtl.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, May 30, 2013 1:12:31 am Orit Moskovich wrote:
> From the SMPng Design Document, I read that interrupt threads run at real-time kernel priority.

The priority ranges have changed since I wrote that (and what I wrote wasn't
really accurate).  There isn't really a real-time kernel priority range.  The
ithread priorities are the most important, followed by user real-time
priorities, in-kernel sleep priorities, user time-sharing priorities, and
finally user idle priorities.

> So wouldn't it be better to define a taskqueue using TASKQUEUE_FAST_DEFINE, but instead of ' taskqueue_start_threads(&taskqueue_foo, 1, PI_NET, "foo 
taskq"); ', use 
> swi_add(NULL, "...", taskqueue_swi_run, NULL, PI_NET,
>                      INTR_MPSAFE, &taskqueue_ih))

Well, swi_add() doesn't take a direct priority, it takes a SWI_xxx constant
that it passes to PI_SWI to generate a priority (so you'd need a gross hack
of using a negative number to get a resulting priority of PI_NET).

However, the threads created (whether by swi_add() or
taskqueue_start_threads()) would be treated exactly the same by the scheduler.
There is nothing special about ithreads except that they are assigned to a
dedicated priority range by default.  Any other thread can use those
priorities (and they do for during priority lending), but most other threads
in the kernel do not use ithread priorities by convention unless they are
doing ithread-type work.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305300806.24399.jhb>