From owner-freebsd-arch@FreeBSD.ORG Wed Feb 19 22:12:08 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 8FE0BDAA; Wed, 19 Feb 2014 22:12:08 +0000 (UTC) Received: from mail-ee0-x232.google.com (mail-ee0-x232.google.com [IPv6:2a00:1450:4013:c00::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A152219EC; Wed, 19 Feb 2014 22:12:07 +0000 (UTC) Received: by mail-ee0-f50.google.com with SMTP id d17so523292eek.23 for ; Wed, 19 Feb 2014 14:12:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=tJ+z0wA9vvFosxKZEE6CwN2Asoo2JwcjLXwXCo352hc=; b=Ll5upz2YQK0w6ppQivOM3NyoO3TdXY0t1IeH6AHY2F/4c/+dqqXfu7y0bS4qJVl3mz 8zE1ExM2nY7HPLJm58oZCYcsCij9QgFGjPE8Ynj8RK1u/aTJrKZlYbbCpyI4KlZLdT+c hgJiqzPGgyGC1FqTMfG+yhSjV8dOji+6wgl5+X+4nbq1V6DtxE4d+qQ2uhP4VykbPDXn vwKlfZIMV7Nqs/BtlY5WWNDhEEzO1c4IMcEBreBWLdOzIPcqm4TLT3CFZ7wkZNfGq7PR JM4NJLgmOlJ5A/tyITuDkYhxFQrKqD6hCP1eKIpypcAcAkNVBbgOLLdpYMPVRlA96Gmp 6tng== X-Received: by 10.14.109.71 with SMTP id r47mr42501690eeg.28.1392847925924; Wed, 19 Feb 2014 14:12:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.214.133 with HTTP; Wed, 19 Feb 2014 14:11:45 -0800 (PST) In-Reply-To: <53052B80.3010505@FreeBSD.org> References: <530508B7.7060102@FreeBSD.org> <53050D24.3020505@FreeBSD.org> <53051C71.3050705@FreeBSD.org> <20140219214428.GA53864@zxy.spb.ru> <53052B80.3010505@FreeBSD.org> From: Jeffrey Carl Faden Date: Wed, 19 Feb 2014 14:11:45 -0800 Message-ID: Subject: Re: [rfc] bind per-cpu timeout threads to each CPU To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: "freebsd-arch@freebsd.org" , Adrian Chadd , freebsd-current , Slawa Olhovchenkov 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 22:12:08 -0000 Hi guys! I was accidentally added to this thread, and would appreciate if you removed my email from any further correspondence. Thanks a bunch! Jeffrey On Wed, Feb 19, 2014 at 2:09 PM, Alexander Motin wrote: > 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 >