From owner-freebsd-current@FreeBSD.ORG Wed Feb 19 22:09:11 2014 Return-Path: Delivered-To: freebsd-current@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 BAAE7BC3; Wed, 19 Feb 2014 22:09:11 +0000 (UTC) Received: from mail-ee0-x236.google.com (mail-ee0-x236.google.com [IPv6:2a00:1450:4013:c00::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 016EE1960; Wed, 19 Feb 2014 22:09:10 +0000 (UTC) Received: by mail-ee0-f54.google.com with SMTP id e53so528383eek.27 for ; Wed, 19 Feb 2014 14:09:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=VuqIlI8+Gqs2IbN7BUiL11bTjatcrP2K8ne1jPqP2ok=; b=mZOSlh7QeZknQcNQQpBuzI5jYEnqrE+szjAtyVUHexZp3dGM40Wrk5U8CsWqz6s6Eg haW9QrRGFXPRzAPyAme8MDmhNTK7RTuzpA0RJOMbDY+RuQrYMnU1gm+bYMwdLtTflEKv 419/7GIW8dSiNpO8lUYJ7WVZBUTGH9x6rpHN0eUysHcOc7FYbxZ0SX+tAZGGC9kQ0pzc irIJsLBcTnGqfMYC2bUotyxaceELQQsR7HY84KyaaRbXUUMDVGhSBvHAgat6rcjoCK/h Dnn/H0Zaa6X68JHMGhrtrZkBKX2jHc1F9uO+hZFjq5ptNZwTuULIKLicMD8euL+c1qUZ +xtg== X-Received: by 10.14.176.66 with SMTP id a42mr4533470eem.101.1392847748155; Wed, 19 Feb 2014 14:09:08 -0800 (PST) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id 43sm3949365eeh.13.2014.02.19.14.09.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Feb 2014 14:09:07 -0800 (PST) Sender: Alexander Motin Message-ID: <53052B80.3010505@FreeBSD.org> Date: Thu, 20 Feb 2014 00:09:04 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Slawa Olhovchenkov Subject: Re: [rfc] bind per-cpu timeout threads to each CPU References: <530508B7.7060102@FreeBSD.org> <53050D24.3020505@FreeBSD.org> <53051C71.3050705@FreeBSD.org> <20140219214428.GA53864@zxy.spb.ru> In-Reply-To: <20140219214428.GA53864@zxy.spb.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , freebsd-current , Jeffrey Faden , "freebsd-arch@freebsd.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 22:09:11 -0000 On 19.02.2014 23:44, Slawa Olhovchenkov wrote: > 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? I am not sure what this formula means, but yes, per-CPU callout locks can much more likely be congested. They are only per-CPU, not per-flow. -- Alexander Motin