Improving the kernel/i386 timecounter performance (GSoC proposal)

Jason Evans jasone at FreeBSD.org
Fri Mar 27 17:45:28 PDT 2009


Robert Watson wrote:
> On Fri, 27 Mar 2009, Poul-Henning Kamp wrote:
>> In message <alpine.BSF.2.00.0903272303040.12518 at fledge.watson.org>, 
>> Robert Wats on writes:
>>
>>> In which case user application threads will need to know their CPU [...]
>>
>> Didn't jemalloc solve that problem once already ?
> 
> I think jemalloc implements thread-affinity for arenas rather than 
> CPU-affinity in the strict sense, but I may misread.

CPU affinity is of limited use to malloc unless it can safely pin 
threads to CPUs.  Unfortunately, malloc cannot muck with CPU affinity, 
since that's up to the application.  Therefore, as you say, jemalloc 
implements (dynamically balanced) arena affinity.

It might work okay in practice to use the current CPU ID to decide which 
arena to use, if the scheduler does not often migrate running processes. 
  I haven't explored that possibility though, since the infrastructure 
for cheaply querying the CPU ID doesn't currently (to my knowledge) exist.

Jason


More information about the freebsd-current mailing list