Date: Tue, 17 Jun 2014 00:18:25 -0700 From: Andrey Zonov <zont@FreeBSD.org> To: freebsd-arch@FreeBSD.org Subject: PoC: passive serialization Message-ID: <539FEBC1.5030501@FreeBSD.org>
next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9C79jEh6Nhnolpe5kdFQIWCAcqc6O1Pl4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, I'd like to introduce my implementation of passive serialization [1] (RCU-like algorithm) which based on expired patent #4809168 [2]. This algorithm allows one to access data structures in non-blocking lock-less manner, but it is not just read-write lock alternative it is something different. It is like delayed garbage collector or if you know what RCU is, passive serialization basically the same (RCU based on that). Unlike NetBSD's implementation [3] my version is light-weight, with no additional locks. One atomic operation per context switch is the only overhead. To demonstrate how it works I converted process limits to use that mechanism [4]. There is also simple test [5] if you interested in measurements. Just configure which type of lock do you want to use (mutex/rwlock/rmlock/psz), duration (LOOPS) and load (LENGTH) and run `make -s run' to get numbers. Any questions, comments or suggestions are welcome. [1] http://people.freebsd.org/~zont/patches/psz/0001-Implement-passive-serial= ization.patch [2] http://www.google.com/patents/US4809168 [3] http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/subr_pserialize.c?rev=3D= 1.7&content-type=3Dtext/x-cvsweb-markup [4] http://people.freebsd.org/~zont/patches/psz/0002-Lock-less-limits.pat= ch [5] http://people.freebsd.org/~zont/patches/psz/lock_test/ --=20 Andrey Zonov --9C79jEh6Nhnolpe5kdFQIWCAcqc6O1Pl4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJTn+vEAAoJEBWLemxX/CvTD/0IAKF+iXe7dVrEyYiWDQD+P6Iu Fsa/W+eTVuql2/pQlSteIAgL0lR19uKi7OmUjneQU2jCARtm+KQSh9Kwvj1cx7Hq ULZWX1144Ihl5IrEhclcN9r4WlOLKxviG30c7PCgmysMwHhJahAul/5FpRehZ727 ip+Pd8cEdCDuW4szuyKtRWMBQ3wrCjsXdvWjxYF24VXyajhLUthLewfn2IcW4/LF 1n643CjAtmV6Pu+WCHlNP0LinfF0IqJnHtvzpml6Bs6Ah9P0K+Q/3PMmH1lQbqgI RF2yUwgL0v/22TBosZXG1UsyBM0pbXIu90ace59U/Y2gIA5Z7T7i02Fvr28Q8CI= =0XOP -----END PGP SIGNATURE----- --9C79jEh6Nhnolpe5kdFQIWCAcqc6O1Pl4--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?539FEBC1.5030501>