Re: Improving the kernel/i386 timecounter performance (GSoC proposal)

From: Jason Evans <jasone_at_FreeBSD.org>
Date: Fri, 27 Mar 2009 17:25:52 -0700
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
Received on Fri Mar 27 2009 - 23:45:27 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:45 UTC