lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 12 Nov 2008 23:38:44 +0100
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	Eric Paris <eparis@...hat.com>
Cc:	linux-kernel@...r.kernel.org, malware-list@...ts.printk.net,
	viro@...iv.linux.org.uk, alan@...rguk.ukuu.org.uk,
	arjan@...radead.org, greg@...ah.com, tytso@....edu,
	akpm@...ux-foundation.org
Subject: Re: [PATCH =-v3 07/21] fanotify: fastpath to ignore certain in
	core inodes

 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.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ