Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Oct 2011 18:09:12 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-current@freebsd.org, Luigi Rizzo <rizzo@iet.unipi.it>
Subject:   Re: getting the cpuid for a userspace process ?
Message-ID:  <99483.1319566152@critter.freebsd.dk>
In-Reply-To: Your message of "Tue, 25 Oct 2011 13:42:45 -0400." <201110251342.45194.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In message <201110251342.45194.jhb@freebsd.org>, John Baldwin writes:
>On Tuesday, October 25, 2011 11:06:22 am Luigi Rizzo wrote:
>> as the subject says... is there any way to get the current
>> CPU id for a userspace process (of course,
>> valid only at the time the function is called as the
>> process might be arbitrarily moved while it runs)
>
>Not from userland, no.  On x86 you can use cpuid to fetch the APIC ID, but 
>that does not map 1:1 to FreeBSD cpu IDs.

How does JEmalloc do it ?


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99483.1319566152>