freebsd-nq/share/man
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
..
man1 pkgbase: move man pages from runtime-manual to runtime 2019-07-19 15:12:20 +00:00
man3 bitstring(3): Add bitstring traversal macros. 2021-08-16 23:24:05 +03:00
man3lua flua: Add a libjail module 2020-10-24 17:08:59 +00:00
man4 rtsx: Call taskqueue sooner, adjust DELAY(9) calls, add an inversion heuristic 2021-09-09 14:26:17 -04:00
man5 Add support for jail.conf.d 2021-09-10 00:30:04 -05:00
man6 pkgbase: move man pages from runtime-manual to runtime 2019-07-19 15:12:20 +00:00
man7 build.7: Describe the default value for LOCAL_MODULES 2021-08-10 21:18:34 -04:00
man8 man: Install more man pages unconditionally 2021-08-06 18:34:07 +02:00
man9 bitset(9): Introduce BIT_FOREACH_ISSET and BIT_FOREACH_ISCLR 2021-09-21 12:07:39 -04:00
Makefile flua: Add a libjail module 2020-10-24 17:08:59 +00:00