freebsd-dev/share
Doug Moore b16f993ec2 rb_tree: augmentation shortcut
RB-tree augmentation maintains data in each node of the tree that
represents the product of some associative operator applied to all the
nodes of the subtree rooted at that node. If a node in the tree
changes, augmentation data for the node is updated for that node and
all nodes on the path from that node to the tree root. However,
sometimes, augmenting a node changes no data in that node,
particularly if the associated operation is something involving 'max'
or 'min'. If augmentation changes nothing in a node, then the work of
walking to the tree root from that point is pointless, because
augmentation will change nothing in those nodes either. This change
makes it possible to avoid that wasted work.

Define RB_AUGMENT_CHECK as a macro much like RB_AUGMENT, but which
returns a value 'true' when augmentation changes the augmentation data
of a node, and false otherwise. Change code that unconditionally walks
and augments to the top of tree to code that stops once an
augmentation has no effect. In the case of rebalancing the tree after
insertion or deletion, where previously a node rotated into the path
was inevitably augmented on the march to the tree root, now check to
see if it needs augmentation because the march to the tree root
stopped before reaching it.

Change the augmentation function in iommu_gas.c so that it returns
true/false to indicate whether the augmentation had any effect.

Reviewed by:	alc, kib
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D36509
2022-09-20 23:21:14 -05:00
..
colldef locales: fix installation of some collation files 2022-04-05 09:19:31 +02:00
colldef_unicode locales: Update to CLDR 41.0 and Unicode 14.0 2022-04-21 14:16:40 +02:00
ctypedef locales: Update to CLDR 41.0 and Unicode 14.0 2022-04-21 14:16:40 +02:00
dict Add "heard" to the dictionary 2022-08-09 12:03:24 -04:00
doc usd: Fix two typos 2022-04-02 15:16:02 +02:00
dtrace dtrace: fix ipfw_rule_info_t translator 2021-09-02 16:35:01 +03:00
examples ipf-howto: Remove a double word 2022-09-10 12:56:48 +02:00
i18n Remove mkcsmapper_static and mkesdb_static from build-tools 2021-08-02 14:33:25 +01:00
keys pkgbase: Add a FreeBSD-pkg-bootstrap package 2021-12-21 10:17:48 +01:00
man rb_tree: augmentation shortcut 2022-09-20 23:21:14 -05:00
misc Add dsl to the src committers and bz as my mentor 2022-08-22 15:59:21 +02:00
mk mk: Remove a double word in a comment 2022-09-10 12:57:55 +02:00
monetdef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
monetdef_unicode locales: Update to CLDR 41.0 and Unicode 14.0 2022-04-21 14:16:40 +02:00
msgdef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
msgdef_unicode locales: Update to CLDR 41.0 and Unicode 14.0 2022-04-21 14:16:40 +02:00
numericdef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
numericdef_unicode locales: Update to CLDR 41.0 and Unicode 14.0 2022-04-21 14:16:40 +02:00
security
sendmail
skel sh(1): fix home/del key on mobaxterm env 2021-10-20 14:00:20 +02:00
snmp pkgbase: Put the mibs and defs in the bnsmp package 2021-06-19 17:50:03 +02:00
syscons Correct typos: s/mit Aksenten/mit Akzenten 2022-09-14 11:53:44 +02:00
tabset
termcap Fix mergemaster(8) breakage in the 6ad780caa. 2022-09-13 13:36:22 -07:00
tests
timedef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
vt Correct typos: s/mit Aksenten/mit Akzenten 2022-09-14 11:53:44 +02:00
zoneinfo Remove quotes around Makefile .error/.warn/.info strings 2022-01-22 14:03:07 -05:00
Makefile locales: now that C.UTF-8 is the default locale, always install it 2021-07-23 16:58:20 +02:00
Makefile.inc