bind9/bin/dnssec
Ondřej Surý 6ffda5920e
Add the reader-writer synchronization with modified C-RW-WP
This changes the internal isc_rwlock implementation to:

  Irina Calciu, Dave Dice, Yossi Lev, Victor Luchangco, Virendra
  J. Marathe, and Nir Shavit.  2013.  NUMA-aware reader-writer locks.
  SIGPLAN Not. 48, 8 (August 2013), 157–166.
  DOI:https://doi.org/10.1145/2517327.24425

(The full article available from:
  http://mcg.cs.tau.ac.il/papers/ppopp2013-rwlocks.pdf)

The implementation is based on the The Writer-Preference Lock (C-RW-WP)
variant (see the 3.4 section of the paper for the rationale).

The implemented algorithm has been modified for simplicity and for usage
patterns in rbtdb.c.

The changes compared to the original algorithm:

  * We haven't implemented the cohort locks because that would require a
    knowledge of NUMA nodes, instead a simple atomic_bool is used as
    synchronization point for writer lock.

  * The per-thread reader counters are not being used - this would
    require the internal thread id (isc_tid_v) to be always initialized,
    even in the utilities; the change has a slight performance penalty,
    so we might revisit this change in the future.  However, this change
    also saves a lot of memory, because cache-line aligned counters were
    used, so on 32-core machine, the rwlock would be 4096+ bytes big.

  * The readers use a writer_barrier that will raise after a while when
    readers lock can't be acquired to prevent readers starvation.

  * Separate ingress and egress readers counters queues to reduce both
    inter and intra-thread contention.
2023-02-15 09:30:04 +01:00
..
.gitignore [master] dnssec-cds 2017-10-05 01:04:18 -07:00
dnssec-cds.c dnssec-checkds: cleanup memory on error paths 2023-02-09 08:35:27 +11:00
dnssec-cds.rst Add internal hyperlinks to See Also section of manual pages 2022-03-14 10:46:36 +01:00
dnssec-dsfromkey.c Use the semantic patch to do the unsigned -> unsigned int change 2022-09-19 15:56:02 +02:00
dnssec-dsfromkey.rst Add internal hyperlinks to See Also section of manual pages 2022-03-14 10:46:36 +01:00
dnssec-importkey.c Replace ISC_NORETURN with C11's noreturn 2022-03-25 08:33:43 +01:00
dnssec-importkey.rst Teach dnssec-settime to read unset times that it writes 2022-05-17 16:28:40 +02:00
dnssec-keyfromlabel.c Update sources to Clang 15 formatting 2022-11-29 08:54:34 +01:00
dnssec-keyfromlabel.rst Clarify dnssec-keyfromlabel -a in man page 2022-06-09 15:00:08 +02:00
dnssec-keygen.c Update sources to Clang 15 formatting 2022-11-29 08:54:34 +01:00
dnssec-keygen.rst Update NSEC3 guidance to match draft-ietf-dnsop-nsec3-guidance-10 2022-06-15 17:53:33 +02:00
dnssec-revoke.c Update sources to Clang 15 formatting 2022-11-29 08:54:34 +01:00
dnssec-revoke.rst Add internal hyperlinks to See Also section of manual pages 2022-03-14 10:46:36 +01:00
dnssec-settime.c Update sources to Clang 15 formatting 2022-11-29 08:54:34 +01:00
dnssec-settime.rst Teach dnssec-settime to read unset times that it writes 2022-05-17 16:28:40 +02:00
dnssec-signzone.c Add the reader-writer synchronization with modified C-RW-WP 2023-02-15 09:30:04 +01:00
dnssec-signzone.rst Update NSEC3 guidance to match draft-ietf-dnsop-nsec3-guidance-10 2022-06-15 17:53:33 +02:00
dnssec-verify.c Update netmgr, tasks, and applications to use isc_loopmgr 2022-08-26 09:09:24 +02:00
dnssec-verify.rst Add internal hyperlinks to See Also section of manual pages 2022-03-14 10:46:36 +01:00
dnssectool.c Update sources to Clang 15 formatting 2022-11-29 08:54:34 +01:00
dnssectool.h Replace ISC_NORETURN with C11's noreturn 2022-03-25 08:33:43 +01:00
Makefile.am Move the include Makefile.tests to the bottom of Makefile.am(s) 2021-06-24 15:33:52 +02:00