This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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 v7 2/2] Mutex: Replace trylock by read only while spinning


Hi, Carlos
>> Do you need to do a whole system performance measurement?
> 
> I thought the data posted here is good enough to demonstrate the effectiveness of this patch.
> But if you insist, I will try to do something to figure it out.
> 

To measure a whole system performance:

We run *two* processes with locking at the same time. Each process has multiple threads, and
each thread do the following:
a) lock
b) delay 1000ns in the critical section
c) unlock
d) delay 6000ns in the non-critical section
in a loop for 5 seconds, and measure the total iterations for each process.

Each test run 4 times with stable testing result.

Test result:
threads           base(CAS)                     head(test and CAS)          
28                 1681975			 1813090(+7.8%)

56		   1801954			 1890549(+4.9%)

========================cut==========================================
I also run a *single* process and post the test result as below (each test run 4 times with 
stable testing result):
threads           base(CAS)                    head(test and CAS)
28		   2262848                       2274362 (+0.5%)

56		   1949439                       1994526 (+2.3%)

This is what I got in my test, this change is not a big optimization, but should have some 
limited performance improvement. Additionally, the workload I run here is not so Macro 
(Some Micro benchmarks make the size of critical section and non-critical section extremely
 small), so I believe this change is helpful with some practical workload.



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