<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-openbsd/sys/kern/sys_generic.c, branch jd/queueboosts</title>
<subtitle>WireGuard implementation for the OpenBSD kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-openbsd/atom/sys/kern/sys_generic.c?h=jd%2Fqueueboosts</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-openbsd/atom/sys/kern/sys_generic.c?h=jd%2Fqueueboosts'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/'/>
<updated>2020-03-20T04:11:05Z</updated>
<entry>
<title>poll(2), ppoll(2), pselect(2), select(2): tsleep(9) -&gt; tsleep_nsec(9)</title>
<updated>2020-03-20T04:11:05Z</updated>
<author>
<name>cheloha</name>
<email>cheloha@openbsd.org</email>
</author>
<published>2020-03-20T04:11:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=2e0a843148d4bb05177fa689bb58d713508abc8c'/>
<id>urn:sha1:2e0a843148d4bb05177fa689bb58d713508abc8c</id>
<content type='text'>
With input from visa@.

ok visa@
</content>
</entry>
<entry>
<title>Push the KERNEL_LOCK() insidge pgsigio() and selwakeup().</title>
<updated>2020-02-14T14:32:44Z</updated>
<author>
<name>mpi</name>
<email>mpi@openbsd.org</email>
</author>
<published>2020-02-14T14:32:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=112e0b7cd8c0810f5e6ec8c11d147cff217a606d'/>
<id>urn:sha1:112e0b7cd8c0810f5e6ec8c11d147cff217a606d</id>
<content type='text'>
The 3 subsystems: signal, poll/select and kqueue can now be addressed
separatly.

Note that bpf(4) and audio(4) currently delay the wakeups to a separate
context in order to respect the KERNEL_LOCK() requirement.  Sockets (UDP,
TCP) and pipes spin to grab the lock for the sames reasons.

ok anton@, visa@
</content>
</entry>
<entry>
<title>Make writes to the f_flag field of `struct file' MP-safe using atomic</title>
<updated>2020-02-01T08:57:27Z</updated>
<author>
<name>anton</name>
<email>anton@openbsd.org</email>
</author>
<published>2020-02-01T08:57:27Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=1672369d9e9dbbbf8a2805c3bf77cdcdea101f66'/>
<id>urn:sha1:1672369d9e9dbbbf8a2805c3bf77cdcdea101f66</id>
<content type='text'>
operations. Since the type of f_flag must change in order to use the
atomic(9) API, reorder the struct in order to avoid padding; as pointed
out by tedu@.

ok mpi@ visa@
</content>
</entry>
<entry>
<title>Introduce wakeup_proc() a function to un-SSTOP/SSLEEP a thread.</title>
<updated>2020-01-16T16:35:03Z</updated>
<author>
<name>mpi</name>
<email>mpi@openbsd.org</email>
</author>
<published>2020-01-16T16:35:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=9566af8920ce0c73af22f6155f3428b247ad2cc0'/>
<id>urn:sha1:9566af8920ce0c73af22f6155f3428b247ad2cc0</id>
<content type='text'>
This moves most of the SCHED_LOCK() related to protecting the sleepqueue
and its states to kern/kern_sync.c

Name suggestion from jsg@, ok kettenis@, visa@
</content>
</entry>
<entry>
<title>Unify handling of ioctls FIOSETOWN/SIOCSPGRP/TIOCSPGRP and</title>
<updated>2020-01-08T16:27:40Z</updated>
<author>
<name>visa</name>
<email>visa@openbsd.org</email>
</author>
<published>2020-01-08T16:27:40Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=36b1b8b4dfaf3411193c17c2462937014292f2df'/>
<id>urn:sha1:36b1b8b4dfaf3411193c17c2462937014292f2df</id>
<content type='text'>
FIOGETOWN/SIOCGPGRP/TIOCGPGRP. Do this by determining the meaning of
the ID parameter inside the sigio code. Also add cases for FIOSETOWN
and FIOGETOWN where there have been TIOCSPGRP and TIOCGPGRP before.
These changes allow removing the ID translation from sys_fcntl() and
sys_ioctl().

Idea from NetBSD

OK mpi@, claudio@
</content>
</entry>
<entry>
<title>poll(2), ppoll(2), select(2), pselect(2): always set P_SELECT before tsleep</title>
<updated>2019-10-03T18:47:19Z</updated>
<author>
<name>cheloha</name>
<email>cheloha@openbsd.org</email>
</author>
<published>2019-10-03T18:47:19Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=ade044871aeb7873c05f673982d81204f7bf8fe3'/>
<id>urn:sha1:ade044871aeb7873c05f673982d81204f7bf8fe3</id>
<content type='text'>
When I introduced the tsleep loops in r1.23 I screwed it up and introduced
a bug: on EWOULDBLOCK we loop but fail to reset P_SELECT, so the thread
will continue to sleep but miss all relevant descriptor activity after
INT_MAX ticks have elapsed.

Spotted by mpi@ back in July.

ok mpi@
</content>
</entry>
<entry>
<title>push the KERNEL_LOCK deeper on read(2) and write(2)</title>
<updated>2019-06-22T06:48:25Z</updated>
<author>
<name>semarie</name>
<email>semarie@openbsd.org</email>
</author>
<published>2019-06-22T06:48:25Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=86391f5b5115a6d519715ab2f01b810532dfbdab'/>
<id>urn:sha1:86391f5b5115a6d519715ab2f01b810532dfbdab</id>
<content type='text'>
unlocks read(2) and write(2) syscalls families, and push the KERNEL_LOCK
deeper in the code path. KERNEL_LOCK is managed per file type in fileops
handlers (fo_read, fo_write, and fo_close). read(2) and write(2) on
socket are KERNEL_LOCK-free.

initial work from mpi@ and ians@

ok mpi@ kettenis@ visa@ ians@
</content>
</entry>
<entry>
<title>Make resource limit access MP-safe. So far, the copy-on-write sharing</title>
<updated>2019-06-21T09:39:48Z</updated>
<author>
<name>visa</name>
<email>visa@openbsd.org</email>
</author>
<published>2019-06-21T09:39:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=edc99bcd885f4004d6cffdbe82f15aa2eb27ee9c'/>
<id>urn:sha1:edc99bcd885f4004d6cffdbe82f15aa2eb27ee9c</id>
<content type='text'>
of resource limit structs has been done between processes. By applying
copy-on-write also between threads, threads can read rlimits in
a nearly lock-free manner.

Inspired by code in DragonFly BSD and FreeBSD.

OK mpi@, agreement from jmatthew@ and anton@
</content>
</entry>
<entry>
<title>select(2), pselect(2), poll(2), ppoll(2): Support full timeout range.</title>
<updated>2019-01-21T23:41:26Z</updated>
<author>
<name>cheloha</name>
<email>cheloha@openbsd.org</email>
</author>
<published>2019-01-21T23:41:26Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=82dc0b3f15d8667b425ec92394bac57c356052cb'/>
<id>urn:sha1:82dc0b3f15d8667b425ec92394bac57c356052cb</id>
<content type='text'>
Remove the arbitrary and undocumented 24hr limits for timeouts from these
interfaces.  To do so, loop tsleep(9) to chip away at timeouts larger than
what tsleep(9) can handle in one call.

Use timerisvalid(3)/timespecisvalid() for input validation instead of
itimerfix()/timespecfix() to avoid the 100 million second upper bounds
those functions introduce.

POSIX requires support for timeouts of at least 31 days for select(2) and
pselect(2), so these changes make our implementation more compliant.

Other improvements here include better variable names for the time stuff
and more consolidated timeout logic with less backwards goto jumping, all
of which made dopselect() and doppoll() a bear to read.

Naming improvements prompted by tedu@ in a prior patch for nanosleep(2).
With input from deraadt@.  Validation bug spotted by matthew@ in an earlier
version.

ok visa@
</content>
</entry>
<entry>
<title>Reorder checks in the read/write(2) family of syscalls to prepare making</title>
<updated>2018-08-20T16:00:22Z</updated>
<author>
<name>mpi</name>
<email>mpi@openbsd.org</email>
</author>
<published>2018-08-20T16:00:22Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=2bd648c0c791046970147cb6db731832ad511740'/>
<id>urn:sha1:2bd648c0c791046970147cb6db731832ad511740</id>
<content type='text'>
file operations mp-safe.

This change makes it clear that `f_offset' is only accessed in vn_read()
and vn_write(), which will help taking it out of the KERNEL_LOCK().

This refactoring uncovered a race in vn_read() which is now documented
and will be addressed in a later diff.

ok visa@
</content>
</entry>
</feed>
