Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Mar 2008 14:22:06 +0300
From:      Alexander Motin <mav@FreeBSD.org>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        freebsd-hackers@freebsd.org, FreeBSD Net <freebsd-net@freebsd.org>
Subject:   Re: Multiple netgraph threads
Message-ID:  <47EF77DE.6040200@FreeBSD.org>
In-Reply-To: <20080330112846.Y5921@fledge.watson.org>
References:  <47EF4F18.502@FreeBSD.org> <20080330112846.Y5921@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Robert Watson wrote:
 > FYI, you might be interested in some similar work I've been doing
 > in the rwatson_netisr branch in Perforce, which:
 > Adds per-CPU netisr threads

Thanks. Netgraph from the beginning uses concept of direct function 
calls, when level of parallelism limited by data source. In that point 
multiple netisr threads will give benefits.

> My initial leaning would be that we would like to avoid adding too many 
> more threads that will do per-packet work, as that leads to excessive 
> context switching.

Netgraph uses queueing only as last resort, when direct call is not 
possible due to locking or stack limitations. For example, while working 
with kernel sockets (*upcall)() I have got many issues which make 
impossible to freely use received data without queueing as upcall() 
caller holds some locks leading to unpredicted LORs in socket/TCP/UDP code.
In case of such forced queueing, node becomes an independent data source 
which can be pinned to and processed by whatever specialized thread or 
netisr, when it will be able to do it more effectively.

-- 
Alexander Motin



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