From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 15 01:59:34 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 B348D3D0 for ; Sat, 15 Feb 2014 01:59:34 +0000 (UTC) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com [209.85.215.44]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2E9831B9D for ; Sat, 15 Feb 2014 01:59:33 +0000 (UTC) Received: by mail-la0-f44.google.com with SMTP id hr13so9943202lab.31 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=MXI4mdafdrPA46+wKC/SvnsRJP1sX3WF5aK6BX/eccXBQ3J4I7xgppxsczfwDFcq9l d+fvFG4+728C7kgp9/rMafYUqs4YwuIwG0OL3phDMKK+VVWsrnjEHgTnPEQ06XL/JtnJ 4FTZ4Kig8aNvZ17czSSqgSVB30o8O4XzsEar18bmc6CZELizaya7OfjotbUVdL9idmPk hQ3w+GXWdvNbwkD50oy/ucbD8Mw6uOXJDNZwWqZf5hZXL0rs4Kys4XN5/YYM/Fzc9sIV oKZVIXSoXbwLt4VKELaxQF3GgZmTRxjAD+FZzbzoLN4DERUhGNRFz75Xc7BLlxb5E85G S7lg== X-Gm-Message-State: ALoCoQnTE0qIPVD1GLUqCDpMV7rFYr2tBOw4utwhIB4cV/DkWZ/E5xAtvCwJqGcZmBjYCOf47dc7 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-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: Sat, 15 Feb 2014 01:59:34 -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/