This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Unify pthread_spin_[try]lock implementations.


On 08/15/2012 10:39 AM, Maxim Kuvyrkov wrote:

+#define SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000
+#include_next <nptl/pthread_spin_lock.c>
I haven't followed this discussion closely,so if I'm bringing up an issue which you're already dealing with or have plans to deal with, my apologies.

I'm aware these constants can vary on a per-architecture basis; however, is any provision made for varying them within a particular architecture.

The reason I ask is once of Red Hat's partners raised an issue around adaptive mutexes where the upper bound for the spin count was less than a cache round trip on that partner's modern processors.

It seems to me that SPIN_LOCK_READS_BETWEEN_CMPXCHG may have the property that varying it at runtime based on the characteristics of the particular chip running the application might be worthwhile.

And, yes, there are some vague plans for Red Hat to write and submit code for the adaptive mutex issue :-)

jeff



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]