Re: Performance regression from switching lock to rw-sem for anon-vmatree

From: Alex Shi
Date: Mon Jun 17 2013 - 19:19:10 EST


On 06/18/2013 02:45 AM, Tim Chen wrote:
>>> + if (unlikely(sem->count < RWSEM_WAITING_BIAS)) {
>>> > > + cpu_relax();
>>> > > + continue;
>>> > > + }
> The above two if statements could be cleaned up as a single check:
>
> if (unlikely(sem->count < RWSEM_WAITING_BIAS))
> return sem;
>
> This one statement is sufficient to check that we don't have a writer
> stolen the lock before we attempt to acquire the read lock by modifying
> sem->count.
>
>

Thanks. I will send out the patchset base your suggestion.


--
Thanks
Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/