Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Dec 2005 13:08:51 -0800
From:      Jason Evans <jasone@canonware.com>
To:        David Xu <davidxu@freebsd.org>
Cc:        current@freebsd.org
Subject:   Re: New libc malloc patch
Message-ID:  <D1B3ED90-7936-41AA-93D3-AAC7E1615CDA@canonware.com>
In-Reply-To: <4391569A.7080808@freebsd.org>
References:  <B6653214-2181-4342-854D-323979D23EE8@canonware.com>	<Pine.LNX.4.53.0511291121360.27754@regurgitate.ugcs.caltech.edu> <0B746373-8C29-4ADF-9218-311AE08F3834@canonware.com> <4391569A.7080808@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Dec 3, 2005, at 12:26 AM, David Xu wrote:
> I have a question about mutex used in the patch, you are using
> a spin loop, isn't it suboptimal ? and a thread library like  
> libpthread
> supports static priority scheduling, this mutex does not work, it
> will causes a dead lock, if a lower priority thread locked the mutex,
> and preempted by a higher priority thread, and the higher priority
> thread also calls malloc, it will spin there to wait lower
> priority thread to complete, but that will never happen.

David,

You are correct that this is a problem.  Thank you for pointing it  
out.  There's a new patch that uses the spinlocks that are provided  
by the threads libraries.  Please let me know if this looks okay.

Also, this patch removes/modifies the code that was causing build  
failures on amd64, so it's worth giving another try.  Hopefully, it  
will compile now...

http://www.canonware.com/~jasone/jemalloc/jemalloc_20051203a.diff

Thanks,
Jason



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D1B3ED90-7936-41AA-93D3-AAC7E1615CDA>