Re: [patch 02/20] make the inode i_mmap_lock a reader/writer lock

From: KOSAKI Motohiro
Date: Tue Dec 18 2007 - 23:09:57 EST


Hi

> > rmap: try_to_unmap_file() required new cond_resched_rwlock().
> > To reduce code duplication, I recast cond_resched_lock() as a
> > [static inline] wrapper around reworked cond_sched_lock() =>
> > __cond_resched_lock(void *lock, int type).
> > New cond_resched_rwlock() implemented as another wrapper.
>
> Reader/writer locks really suck in terms of fairness and starvation,
> especially when the read-side is common and frequent. (also, single
> threaded performance of the read-side is worse).

Agreed.

rwlock got bad performance some case. (especially on many cpu machine)

if many cpu grab read-lock on and off on many cpu system.
then at least 1 cpu always grab read lock and the cpu of waiting write-lock
never get lock.

threrefore, rwlock often make performance weakness of stress.


I want know testcase for this patch and run it.
Do you have it?


/kosaki


--
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/