From owner-freebsd-arch@FreeBSD.ORG Wed Feb 19 21:44:29 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D74B5287; Wed, 19 Feb 2014 21:44:29 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id 6395317C2; Wed, 19 Feb 2014 21:44:29 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1WGEwO-000ERU-3P; Thu, 20 Feb 2014 01:44:28 +0400 Date: Thu, 20 Feb 2014 01:44:28 +0400 From: Slawa Olhovchenkov To: Alexander Motin Subject: Re: [rfc] bind per-cpu timeout threads to each CPU Message-ID: <20140219214428.GA53864@zxy.spb.ru> References: <530508B7.7060102@FreeBSD.org> <53050D24.3020505@FreeBSD.org> <53051C71.3050705@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53051C71.3050705@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: Adrian Chadd , freebsd-current , Jeffrey Faden , "freebsd-arch@freebsd.org" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 21:44:29 -0000 On Wed, Feb 19, 2014 at 11:04:49PM +0200, Alexander Motin wrote: > On 19.02.2014 22:04, Adrian Chadd wrote: > > On 19 February 2014 11:59, Alexander Motin wrote: > > > >>> So if we're moving towards supporting (among others) a pcbgroup / RSS > >>> hash style work load distribution across CPUs to minimise > >>> per-connection lock contention, we really don't want the scheduler to > >>> decide it can schedule things on other CPUs under enough pressure. > >>> That'll just make things worse. > > > >> True, though it is also not obvious that putting second thread on CPU run > >> queue is better then executing it right now on another core. > > > > Well, it depends if you're trying to optimise for "run all runnable > > tasks as quickly as possible" or "run all runnable tasks in contexts > > that minimise lock contention." > > > > The former sounds great as long as there's no real lock contention > > going on. But as you add more chances for contention (something like > > "100,000 concurrent TCP flows") then you may end up having your TCP > > timer firing stuff interfere with more TXing or RXing on the same > > connection. > > 100K TCP flows probably means 100K locks. That means that chance of lock > collision on each of them is effectively zero. More realistic it could What about 100K/N_cpu*PPS timer's queue locks for remove/insert TCP timeouts callbacks?