Hi John,
On Thu, Dec 13, 2001 at 12:56:10PM -0800, john stultz wrote:
> Recently, I've been working w/ semi-numa-aware locks, and in doing so,
> I've written an implementation of MCS locks. Its probably no surprise to
> locking old-timers, but I've been very impressed w/ its performance, so
> I figured I'd kick this implementation out for comments.
Sometime back, I implemented mcs spin and reader writer locks on x86 linux
for my school project. I did some user space tests on the locks and
the locks worked fine. But, when i did some kernel stress testing on a 4way,
the tests did not complete in reasonable time. I guess there might have
been a deadlock. I haven't put enough time into it to find out if there was
a problem with my implementation.
Out of curiosity, I put ur implementation through the same test
The test goes like this,
I create smp_num_cpus-1 threads, use a barrier mechanism and start running
the test routine on each thread in parallel.
The test routine goes something like this:
#define TOT_LOCK_ACS 200000000
static void test_mcslock(int num)
{
int i;
mcsnode_t node;
unsigned int flags;
local_irq_save(flags);
cycb3[num] = get_cycles();
for (i=0; i< TOT_LOCK_ACS; i++) {
mcs_lock(&mcslock, &node);
mb();
mcs_unlock(&mcslock, &node);
}
cyca3[num] = get_cycles();
local_irq_restore(flags);
}
The test completed, but took way too long. Just thought I'd let u know.
I have egcs-2.91.66 on the test machine - a 4 way pIII Xeon at 700MHz.
I can put out the reader writer lock implementation, if anybody is interested.
Thanks,
Kiran
--
Ravikiran G Thirumalai <kiran@...>
Linux Technology Center, IBM Software Labs,
Bangalore.
|