freebsd-dev/share
Mark Johnston dfd3bde577 bitset(9): Introduce BIT_FOREACH_ISSET and BIT_FOREACH_ISCLR
These allow one to non-destructively iterate over the set or clear bits
in a bitset.  The motivation is that we have several code fragments
which iterate over a CPU set like this:

while ((cpu = CPU_FFS(&cpus)) != 0) {
	cpu--;
	CPU_CLR(cpu, &cpus);
	<do something>;
}

This is slow since CPU_FFS begins the search at the beginning of the
bitset each time.  On amd64 and arm64, CPU sets have size 256, so there
are four limbs in the bitset and we do a lot of unnecessary scanning.

A second problem is that this is destructive, so code which needs to
preserve the original set has to make a copy.  In particular, we have
quite a few functions which take a cpuset_t parameter by value, meaning
that each call has to copy the 32 byte cpuset_t.

The new macros address both problems.

Reviewed by:	cem, kib
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32028
2021-09-21 12:07:39 -04:00
..
colldef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
colldef_unicode pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
ctypedef localedef: unbreak WITHOUT_LOCALES 2021-08-19 12:38:17 -05:00
dict
doc pkgbase: Install atf and kyua in the tests package 2021-01-04 16:20:47 +01:00
dtrace dtrace: fix ipfw_rule_info_t translator 2021-09-02 16:35:01 +03:00
examples ses: Correct spelling of "Temperature Sensor" 2021-09-02 14:38:06 -06:00
i18n Remove mkcsmapper_static and mkesdb_static from build-tools 2021-08-02 14:33:25 +01:00
keys pkgbase: Add the pkg trusted keys to the FreeBSD-utilities package 2019-09-05 19:17:17 +00:00
man bitset(9): Introduce BIT_FOREACH_ISSET and BIT_FOREACH_ISCLR 2021-09-21 12:07:39 -04:00
misc Add myself (diizzy) as ports committer 2021-08-11 09:58:17 +02:00
mk Disable -Woverflow errors for i386 for GCC 9. 2021-09-13 11:00:38 -07:00
monetdef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
monetdef_unicode pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
msgdef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
msgdef_unicode pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
numericdef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
numericdef_unicode pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
security
sendmail
skel
snmp pkgbase: Put the mibs and defs in the bnsmp package 2021-06-19 17:50:03 +02:00
syscons pkgbase: Create a syscons-data package 2021-09-07 10:21:40 +02:00
tabset
termcap termcap: add an entry for the foot terminal 2021-02-21 06:06:47 +01:00
tests
timedef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
vt pkgbase: Create a vt-data package 2021-09-07 10:21:09 +02:00
zoneinfo pkgbase: Put zoneinfo file in their own package 2021-01-04 16:18:36 +01: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