lkml.org 
[lkml]   [2008]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH =-v3 07/21] fanotify: fastpath to ignore certain in core inodes
From
Date
 On Wed, 2008-11-12 at 11:11 -0500, Eric Paris wrote:
> +#ifdef CONFIG_FANOTIFY
> + struct list_head fastpath_entries; /* fanotify fastpath entries protected by group */
> + rwlock_t fastpath_rwlock; /* protect the fastpath entries list */
> +#endif

Are you really sure those rwlocks actually gain you performance?

rwlocks are really bad, the critical section must be short because its
non-preemptable, but both the lock and unlock are atomic ops that can
(and usually will) bounce cachelines. So you often get into the
situation where your performance is limited by the cacheline bouncing.

There's also a starvation case in there, where the cacheline is so hot
on one package/node that another package/node doesn't get it.

Regular spinlocks are usually faster in those cases (and on those archs
that have ticket locks avoid the starvation case too).

And for those cases where the read side is long enough to not be
dominated by the cacheline bouncing, RCU is usually the best way out.



\
 
 \ /
  Last update: 2008-11-12 23:43    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site