From owner-freebsd-arch@FreeBSD.ORG Sat Feb 15 01:59:28 2014 Return-Path: Delivered-To: freebsd-arch@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 6FD493B3 for ; Sat, 15 Feb 2014 01:59:28 +0000 (UTC) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com [209.85.215.46]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E18521B9C for ; Sat, 15 Feb 2014 01:59:27 +0000 (UTC) Received: by mail-la0-f46.google.com with SMTP id b8so9732664lan.5 for ; Fri, 14 Feb 2014 17:59:25 -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=crcNec/eWEFO9B2ZEEMjiB9e7w9iwi4nq9pGBSlNO8A=; b=LeW4yudpXeUHH15cVeIhYLcY6m6g6mEKWtZkszfOJdQMTHA+V9Q0DB8T0Nn8+nN8nn QywwyDarENCrwhXTOKfbAWz7C06AfLHj5cp+q5Xii/iLtzaZnukVpA9GRNqI07cbx2i7 aMWObQQIQ94nDgvogouaMk9TrzMzViIwnxrF1q77n1khhF93qRNDYfm4UcJ0UE1laMps gGqvady029YEWjV673XWMOT1RBwUUy6BNeyn0PlbxGF028hILMEWe5+CPrqsmQb9S44C I5LvKkH1FQaFF/TfkVXU77uNegCeP1GBeRvHRAeOGNplXaUpF+/0HjSWuyXjopxBuUjt Cj9Q== X-Gm-Message-State: ALoCoQmM/o0YcZom6wMmYzrGs23si4UcKqC/hrDxmNxm7G6ZvelF0pODf8N3S+9pWixnSBqa4FPn X-Received: by 10.112.236.3 with SMTP id uq3mr7325815lbc.14.1392429565787; Fri, 14 Feb 2014 17:59:25 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id gi5sm7913379lbc.4.2014.02.14.17.59.24 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Feb 2014 17:59:25 -0800 (PST) Message-ID: <52FEC9FC.20707@freebsd.org> Date: Sat, 15 Feb 2014 05:59:24 +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: Andriy Gapon , John Baldwin Subject: Re: can the scheduler decide to schedule an interrupted but runnable thread on another CPU core? What are the implications for code? References: <201402141318.44743.jhb@freebsd.org> <52FE5FBF.3090104@freebsd.org> <201402141410.29325.jhb@freebsd.org> <52FE93E6.6030705@freebsd.org> <52FE9A5E.5050300@freebsd.org> <52FEADC9.2040608@FreeBSD.org> In-Reply-To: <52FEADC9.2040608@FreeBSD.org> X-Enigmail-Version: 1.7a1pre Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: "freebsd-hackers@freebsd.org" , "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: Sat, 15 Feb 2014 01:59:28 -0000 On 15.02.2014 3:59, Andriy Gapon wrote: >> This is code example from cpuminer port, in case you are interested, it is very simple: >> >> static inline void affine_to_cpu(int id, int cpu) >> { >> cpuset_t set; >> CPU_ZERO(&set); >> CPU_SET(cpu, &set); >> cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_CPUSET, -1, sizeof(cpuset_t), &set); > > I think that CPU_WHICH_TID should have been used here. > You are right, thanx! -- http://ache.vniz.net/