From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 14 18:26:16 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A20F03E0 for ; Fri, 14 Feb 2014 18:26:16 +0000 (UTC) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com [209.85.215.52]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A05317AA for ; Fri, 14 Feb 2014 18:26:15 +0000 (UTC) Received: by mail-la0-f52.google.com with SMTP id c6so9682444lan.11 for ; Fri, 14 Feb 2014 10:26:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=lxweHO6XgFZ880npI09YRyplbMA5yctEUxQ5ZIF0V+M=; b=adHrlMglcpjjxYrpcRIOFGhjVSIjFuz0H0B+QeLq0kd5drV0HNvmFZohf4ZZiZSiWX oz3L89g2/wfip6xExhBmAqJwTZcbD0JNuGs85PgawXEZl3tY3PVazhqw74QEEm8uXlzU gi8O9gWUCzedQDgHm788H8O6QoJhNEEF3dAC34h+EcIueBfe84iVk15Q3Q5Qd2wr+Ugv pnAO8v2W1VGzQbXXFRD7kxEBltsuLoA9Gm61zPu43DK53ejxJ5ckA93qKp7/SUcJJ4OE XUFB81T4KoaBqbQVD3PfL3J7JgBir1W/yra/7Zv8Grr0cdefmdLTDRm1EJnToI3zg8zo lYQw== X-Gm-Message-State: ALoCoQl5OJKtqwVsYRaw1id8KU5E+WWl2IfAEFPXlLLCuTqFkmx0AlGh+Vr7LwAI8WLbPk13lMNu X-Received: by 10.112.160.161 with SMTP id xl1mr10184lbb.71.1392402368412; Fri, 14 Feb 2014 10:26:08 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id cu8sm6711323lbb.12.2014.02.14.10.26.07 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Feb 2014 10:26:07 -0800 (PST) Message-ID: <52FE5FBF.3090104@freebsd.org> Date: Fri, 14 Feb 2014 22:26:07 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: John Baldwin , Adrian Chadd Subject: Re: can the scheduler decide to schedule an interrupted but runnable thread on another CPU core? What are the implications for code? References: <201402141139.49158.jhb@freebsd.org> <201402141318.44743.jhb@freebsd.org> In-Reply-To: <201402141318.44743.jhb@freebsd.org> X-Enigmail-Version: 1.7a1pre Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: "freebsd-hackers@freebsd.org" , Ryan Stone , "freebsd-arch@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Feb 2014 18:26:16 -0000 On 14.02.2014 22:18, John Baldwin wrote: > On Friday, February 14, 2014 12:55:03 pm Adrian Chadd wrote: >> On 14 February 2014 08:39, John Baldwin wrote: >>> On Friday, February 14, 2014 4:22:34 am Adrian Chadd wrote: >>>> Ok, so now I remember the other odd thing. >>>> >>>> I was seeing the sending context(s) jumping from one CPU to another >>>> during flowtable_insert_common(), around the locking bits. >>>> >>>> But I thread pinned all the sender user threads! >>>> >>>> So, why would the senders still be scheduled on other CPUs if I've >>>> pinned the userland threads? >>>> >>>> (and yes, I verified that the userland threads weren't moving around.) >>> >>> Can you clarify a bit? It's not clear how sender thraeds differ from >>> userland threads differ from sender user threads. (I.e. one reading >>> is that these are all the same thing and should thus all be pinned >>> (I assume you mean using cpuset to bind them to specific cores rather >>> than sched_pin)) >> >> Yup, I'm doing a manual, poor-mans RSS in lieu of merging in roberts stuff: >> >> * the userland threads are using the cpuset call to map a thread into >> a cpuset, yes >> * the NIC TX/RX ring routines in cxgbe are pinned to the same CPU as >> the userland threads > > If they are all cpuset to a single CPU, they should not migrate, though > I think sched_bind() can override that. However, that requires code to > explicitly call sched_bind() which should be rare. > Due to this bug, not fixed yet, the real picture is more complex: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/163585 -- http://ache.vniz.net/