
dlang wrote:my guess is that the futex calls and the occasional memory locking calls that I see are eating more cpu than the select saved (the time for the calls as shown by strace is higher than the select), and the fact that it's blocked waiting for the locks to be available is driving down the throughput.

/* rgerhards, 2008-09-30: I reversed the order of cond_signal und mutex_unlock
* as of the pthreads recommendation on predictable scheduling behaviour. I don't see
* any problems caused by this, but I add this comment in case some will be seen
* in the next time.
*/
pthread_cond_signal(&pThis->notFull);
d_pthread_mutex_unlock(pThis->mut);
pthread_setcancelstate(iCancelStateSave, NULL);
d_pthread_mutex_unlock(pThis->mut);
pthread_cond_signal(&pThis->notFull);

but one of the features of a futex is that if the lock is not contended all of the locking can be done in userspace. it's only when the lock has contention that system calls into the kernel are needed. so even without you adding any new calls something that increases contention will increase the number of futex calls that I see.rgerhards wrote:Thanks, this is what I was looking for. That gives me an impression where we actually are.dlang wrote:my guess is that the futex calls and the occasional memory locking calls that I see are eating more cpu than the select saved (the time for the calls as shown by strace is higher than the select), and the fact that it's blocked waiting for the locks to be available is driving down the throughput.
I agree that there must be a locking issue, but I don't think that what you say here is the reason. The point is that I just removed some (select()) calls, but did not add any futex calls. So the number of futex calls is the same and the absolute number is linear to the number of messages received.
I am taking the day off tomorrow, so I won't be able to do a lot of testing (go ahead and e-mail me with what you want done, just in case I get a chance to do some though)As I said, there were some changes which could affect locking and I'll dig out those that I think may cause the issue. This probably happened while we were not 100% aligned in our testing.
I'll also review code again with the new knowledge. I yesterday identified an area where I can save malloc/free calls, but I was hesitant to do this without getting some results from you. I expect the effect to be minor, but that doesn't hurt. I'll also run a check on the actual mutex operations done (from the pthreads level, not the strace level).
dlang wrote:but one of the features of a futex is that if the lock is not contended all of the locking can be done in userspace. it's only when the lock has contention that system calls into the kernel are needed. so even without you adding any new calls something that increases contention will increase the number of futex calls that I see.




dlang wrote:I just found one problem, apparently with my configuration writing with logger doesn't work properly
I'll re-do the tests with remote logging and see what happens.

rgerhards wrote:dlang wrote:I just found one problem, apparently with my configuration writing with logger doesn't work properly
I'll re-do the tests with remote logging and see what happens.
Do you mean depending on the config things go wrong? If so, I would be most interested in the "wrong" config (as this should not lead to a segfault).
Users browsing this forum: No registered users and 0 guests