Robert Watson wrote:
On Fri, 27 Mar 2009, Poul-Henning Kamp wrote:
In message <alpine.bsf.2.00.0903272303040.12...@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
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"