<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-openbsd/lib/libc/gen/sysconf.c, branch jd/queueboosts</title>
<subtitle>WireGuard implementation for the OpenBSD kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-openbsd/atom/lib/libc/gen/sysconf.c?h=jd%2Fqueueboosts</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-openbsd/atom/lib/libc/gen/sysconf.c?h=jd%2Fqueueboosts'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/'/>
<updated>2018-07-12T01:23:38Z</updated>
<entry>
<title>Add hw.ncpuonline to count the number of online CPUs.</title>
<updated>2018-07-12T01:23:38Z</updated>
<author>
<name>cheloha</name>
<email>cheloha@openbsd.org</email>
</author>
<published>2018-07-12T01:23:38Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=c71ddef4e977e565d25356bbc54b3876cbf432d2'/>
<id>urn:sha1:c71ddef4e977e565d25356bbc54b3876cbf432d2</id>
<content type='text'>
The introduction of hw.smt means that logical CPUs can be disabled
after boot and prior to suspend/resume.  If hw.smt=0 (the default),
there needs to be a way to count the number of hardware threads
available on the system at any given time.

So, import HW_NCPUONLINE/hw.ncpuonline from NetBSD and document it.
hw.ncpu becomes equal to the number of CPUs given to sched_init_cpu()
during boot, while hw.ncpuonline is equal to the number of CPUs available
to the scheduler in the cpuset "sched_all_cpus". Set_SC_NPROCESSORS_ONLN
equal to this new sysctl and keep _SC_NPROCESSORS_CONF equal to hw.ncpu.

This is preferable to adding a new sysctl to count the number of
configured CPUs and keeping hw.ncpu equal to the number of online
CPUs because such a change would break software in the ecosystem
that relies on HW_NCPU/hw.ncpu to measure CPU usage and the like.
Such software in base includes top(1), systat(1), and snmpd(8),
and perhaps others.

We don't need additional locking to count the cardinality of a cpuset
in this case because the only interfaces that can modify said cardinality
are sysctl(2) and ioctl(2), both of which are under the KERNEL_LOCK.

Software using HW_NCPU/hw.ncpu to determine optimal parallism will need
to be updated to use HW_NCPUONLINE/hw.ncpuonline.  Until then, such software
may perform suboptimally.  However, most changes will be similar to the
change included here for libcxx's std::thread:hardware_concurrency():
using HW_NCPUONLINE in lieu of HW_NCPU should be sufficient for determining
optimal parallelism for most software if the change to _SC_NPROCESSORS_ONLN
is insufficient.

Prompted by deraadt. Discussed at length with kettenis, deraadt, and sthen.
Lots of patch tweaks from kettenis.

ok kettenis, "proceed" deraadt
</content>
</entry>
<entry>
<title>shm_open(), sysconf(), tcflow(), and tcsendbreak() are not permitted to be</title>
<updated>2017-09-10T18:20:00Z</updated>
<author>
<name>guenther</name>
<email>guenther@openbsd.org</email>
</author>
<published>2017-09-10T18:20:00Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=81064d433281cbb881394cc726b6ecbb9268d4ee'/>
<id>urn:sha1:81064d433281cbb881394cc726b6ecbb9268d4ee</id>
<content type='text'>
cancellation points in POSIX, so change them to invoke the non-cancellation
point versions of open(), close(), nanosleep(), and write()

ok deraadt@ millert@
</content>
</entry>
<entry>
<title>Rearrange C runtime bits: now that ld.so exports environ and __progname,</title>
<updated>2016-03-20T02:32:39Z</updated>
<author>
<name>guenther</name>
<email>guenther@openbsd.org</email>
</author>
<published>2016-03-20T02:32:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=5af055cd66b5450a4935ae30e5716331ca3b13d5'/>
<id>urn:sha1:5af055cd66b5450a4935ae30e5716331ca3b13d5</id>
<content type='text'>
move their definitions and initialization in static links to libc.a
Make crt0 always invoke a new func _csu_finish() in libc to process the auxv
and to either register the ld.so cleanup function (in dynamic links) or
initialize environ and __progname and do MC_DISABLE_KBIND (in static links).
In libc, get pagesize from auxv; cache that between getpagesize() and
sysconf(_SC_PAGESIZE)

ok mpi@ "good time" deraadt@
</content>
</entry>
<entry>
<title>Wrap &lt;unistd.h&gt; so that internal calls go direct and they're all weak symbols</title>
<updated>2015-09-12T14:56:50Z</updated>
<author>
<name>guenther</name>
<email>guenther@openbsd.org</email>
</author>
<published>2015-09-12T14:56:50Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=0e3c6306f9e8c62197134dcb9c6f7fdda47b72b8'/>
<id>urn:sha1:0e3c6306f9e8c62197134dcb9c6f7fdda47b72b8</id>
<content type='text'>
Delete unused 'fd' argument from internal function oldttyname()
</content>
</entry>
<entry>
<title>Replace HOST_NAME_MAX+1-1 with HOST_NAME_MAX.  OK deraad@</title>
<updated>2015-01-16T18:18:58Z</updated>
<author>
<name>millert</name>
<email>millert@openbsd.org</email>
</author>
<published>2015-01-16T18:18:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=8cdb393c787dfeee93fb2eb5729fddc1c22361d0'/>
<id>urn:sha1:8cdb393c787dfeee93fb2eb5729fddc1c22361d0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Move to the &lt;limits.h&gt; universe.</title>
<updated>2015-01-16T16:48:51Z</updated>
<author>
<name>deraadt</name>
<email>deraadt@openbsd.org</email>
</author>
<published>2015-01-16T16:48:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=aea60bee5e9bad0aab62f480f19c2fb34c068de4'/>
<id>urn:sha1:aea60bee5e9bad0aab62f480f19c2fb34c068de4</id>
<content type='text'>
review by millert, binary checking process with doug, concept with guenther
</content>
</entry>
<entry>
<title>decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.h</title>
<updated>2014-07-08T17:19:21Z</updated>
<author>
<name>deraadt</name>
<email>deraadt@openbsd.org</email>
</author>
<published>2014-07-08T17:19:21Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=e6c6495d62998a12dd778aed8d40dc250167a61c'/>
<id>urn:sha1:e6c6495d62998a12dd778aed8d40dc250167a61c</id>
<content type='text'>
don't need to be married.
ok guenther miod beck jsing kettenis
</content>
</entry>
<entry>
<title>Use VM_UVMEXP instead of VM_METER for memory usages and directly</title>
<updated>2014-04-08T14:04:11Z</updated>
<author>
<name>mpi</name>
<email>mpi@openbsd.org</email>
</author>
<published>2014-04-08T14:04:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=77fb67b890bb42a674ae239a251401b297a071a3'/>
<id>urn:sha1:77fb67b890bb42a674ae239a251401b297a071a3</id>
<content type='text'>
include &lt;sys/vmmeter.h&gt; where it is needed instead of relying on
it being included by &lt;uvm/uvm_extern.h&gt;.

miod@ likes it, ok guenther@
</content>
</entry>
<entry>
<title>sysconf(_SC_SEM_VALUE_MAX) should return SEM_VALUE_MAX, not some</title>
<updated>2013-03-24T20:04:35Z</updated>
<author>
<name>guenther</name>
<email>guenther@openbsd.org</email>
</author>
<published>2013-03-24T20:04:35Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=98d7aa0106cf1bce82753ba9bf26c0f33aba7443'/>
<id>urn:sha1:98d7aa0106cf1bce82753ba9bf26c0f33aba7443</id>
<content type='text'>
unrelated sysv sem limit.  Similarly, sysconf(_SC_SEM_NSEMS_MAX)
should return -1 instead of another sysv sem limit.
</content>
</entry>
<entry>
<title>Fix _SC_CHILD_MAX, _SC_OPEN_MAX, and _SC_STREAM_MAX to correctly</title>
<updated>2012-08-29T21:46:29Z</updated>
<author>
<name>matthew</name>
<email>matthew@openbsd.org</email>
</author>
<published>2012-08-29T21:46:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=2f26b2a1690acc52ccc299c4fb9fe4ddc175af03'/>
<id>urn:sha1:2f26b2a1690acc52ccc299c4fb9fe4ddc175af03</id>
<content type='text'>
handle rlim_cur set to RLIM_INFINITY or values greater than LONG_MAX,
as unlikely as those are to happen.  Further limit _SC_STREAM_MAX to
at most SHRT_MAX, because struct __sFILE uses a short int for storing
the file descriptor.

While here, also remove a dead label that Clang complains about.

From FreeBSD via Brad.
</content>
</entry>
</feed>
