On Thu, Jun 08, 2006 at 12:00:31PM -0700, Andrew ge wrote:
> Hi,
> 
> I am now developping an appliaction that frequently allocate big buckets of 
> memory with multiple threads. I used the libumem.so and it works pretty well 
> under solaris 10. However, under solaris 9, it has problem similar with the 
> normal malloc, that is, from stackframe I pasted below, I can see the threads 
> are wait for the lock:
> ----- (stack frame for one 
> thread)------------------------------------------------
> ff1558f4 lwp_park (0, 0, 0)
> ff15166c mutex_lock_queue (ff168b44, 0, ff39c7c0, ff168000, 0, 0) + 104
> ff15206c slow_lock (ff39c7c0, ff0f0200, 10, ff394000, 20e008, 1e7ff0) + 58
> ff37b5cc vmem_alloc (ff39c790, 2000, 1, 0, 0, 2000) + fc 
> ff37b0c0 vmem_xalloc (0, 2000, ff394000, 0, 2044a8, 2) + 554
> ff37b6cc vmem_alloc (204478, 2000, 1, 198f7f, 0, 0) + 1fc
> ff375af0 umem_slab_create (2000, 0, 8fc54, 0, fef7bb30, 1b73fc) + 5c 
> ff375ed0 umem_slab_alloc (215188, 0, 0, ff394000, 0, 0) + 90
> ff376e48 umem_cache_alloc (0, 0, 0, 0, 0, 0) + ec
> ff3772a4 umem_alloc (1394, 0, 0, 0, 0, 0) + 44
> ff37354c malloc (138c, 1, 10, 3831da98, 20e008, 1e7ff0) + 2c
> ff373610 calloc (138c, 1, 2288, 105cc4, b112c, 2000) + 58
> ----------------------------------------------

This may just be that the Solaris 9 thread library isn't as efficient as
the Solaris 10 thread library.  Do you ever free any of these buffers?

The patch for:

6304072 libumem seems to use more heap than it needs

(which should be released fairly soon) should help this somewhat, as it
adds a few more caches to the mix.

> Also, use prstat -mL, I found the value of DFL and LCK is much bigger than 
> which at solaris 10:
>    PID USERNAME USR SYS TRP TFL DFL LCK SLP LAT VCX ICX SCL SIG PROCESS/LWPID
> Prstat -mL at solaris 9:
>   2989 xxx       16  21 0.0 0.0  37  23 0.2 2.2  1K 606  6K   0 app/3
>   2989 xxx       16  20 0.0 0.0  36  25 0.2 3.2  1K 559  6K   0 app/2
>   2989 xxx       15  21 0.0 0.0  37  23 0.2 3.4  1K 611  6K   0 app/4
>   2989 xxx       16  20 0.0 0.0  33  28 0.2 2.7  1K 553  6K   0 app/5
> Prstat -mL at solaris 10:
>  14428 xxx       35 9.1 0.1 0.0 0.6 1.4  51 3.4  1K  1K 25K   0 app/4
>  14428 xxx       33 8.8 0.2 0.0 0.3 1.4  53 3.4  1K  1K 23K   0 app/2
>  14428 xxx       32 8.5 0.2 0.0 0.4 1.3  53 4.5  1K  1K 23K   0 app/5
>  14428 xxx       32 8.3 0.1 0.0 0.4 1.5  53 4.1  1K  1K 23K   0 app/3
> 
> The two machine has the same configruation, exception the version
> of solaris. Could anyone give me some clue for that? Need I do some
> configuration for libumem.so under solaris 9?

Unfortunately, I'm not sure there's an available configuration variable which
would help.

Cheers,
- jonathan

-- 
Jonathan Adams, Solaris Kernel Development
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to