[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ITS#3950

> Howard Chu wrote:

> Oops. The only reason my BDB library was making so many yield calls was
> because I had configured it to use assembler test-and-set mutexes.
> Rebuilding with posix-mutexes gets rid of that. (Of course that still
> requires the threads library to support interprocess mutexes, which as I
> recall are only available for Linux in NPTL/Linux 2.6.) Running test008
> with fnccheck showed ~420000 yield calls, mostly coming from the BDB
> library. After rebuilding BDB, that dropped to ~28000 calls, mainly
> split between bdb_search (8800) and ldap_int_thread_pool_wrapper
> (18000). The majority of yield calls in back-bdb are unnecessary and
> I've removed them in HEAD. That leaves the 18000 in
> ldap_int_thread_pool_wrapper to investigate. (The number is actually
> 18147, pretty constant from run to run which implies it is equal to the
> total number of operations processed, i.e., one yield per request.
> Probably worth removing if we can.)

I see there are quite a few calls to ldap_pvt_thread_yield() in slapd's
code; one is in syncprov.c, two in connection.c, five in daemon.c and a
bit in back-{ldap,meta}/bind.c; just one in back-{ldap,meta}/search.c.

The ones I know about (because I worked a those pieces of code; talking
about the proxy backends) are there essentially as a workaround to force
scheduling of a waiting thread when releasing and reaquiring a mutex. 
Should they be removed as well?


Ing. Pierangelo Masarati
Responsabile Open Solution
OpenLDAP Core Team

SysNet s.n.c.
Via Dossi, 8 - 27100 Pavia - ITALIA
Office:   +39.02.23998309          
Mobile:   +39.333.4963172
Email:    pierangelo.masarati@sys-net.it