<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-openbsd/sys/arch/alpha/include/mutex.h, branch jd/queueboosts</title>
<subtitle>WireGuard implementation for the OpenBSD kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-openbsd/atom/sys/arch/alpha/include/mutex.h?h=jd%2Fqueueboosts</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-openbsd/atom/sys/arch/alpha/include/mutex.h?h=jd%2Fqueueboosts'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/'/>
<updated>2018-01-25T15:06:29Z</updated>
<entry>
<title>Move common mutex implementations to a MI place.</title>
<updated>2018-01-25T15:06:29Z</updated>
<author>
<name>mpi</name>
<email>mpi@openbsd.org</email>
</author>
<published>2018-01-25T15:06:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=710c2d98ef6b48aed52cf1712826535b248055bf'/>
<id>urn:sha1:710c2d98ef6b48aed52cf1712826535b248055bf</id>
<content type='text'>
Archs not yet converted can to the jump by defining __USE_MI_MUTEX.

ok visa@
</content>
</entry>
<entry>
<title>Define and use IPL_MPFLOOR in our common mutex implementation.</title>
<updated>2018-01-13T15:18:11Z</updated>
<author>
<name>mpi</name>
<email>mpi@openbsd.org</email>
</author>
<published>2018-01-13T15:18:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=4965d1a4536ae31f44fece9aedf52ba3da2c14fb'/>
<id>urn:sha1:4965d1a4536ae31f44fece9aedf52ba3da2c14fb</id>
<content type='text'>
ok kettenis@, visa@
</content>
</entry>
<entry>
<title>Unify &lt;machine/mutex.h&gt; a bit further.</title>
<updated>2018-01-04T11:03:48Z</updated>
<author>
<name>mpi</name>
<email>mpi@openbsd.org</email>
</author>
<published>2018-01-04T11:03:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=4c6d9147fe2ff541db95dc25133e4e496d9a3e8a'/>
<id>urn:sha1:4c6d9147fe2ff541db95dc25133e4e496d9a3e8a</id>
<content type='text'>
Remove `mtx_lock' from i386, add volatile before `mtx_owner' where it
was missing.

Inputs from kettenis@, ok visa@
</content>
</entry>
<entry>
<title>Hook up mutex(9) to witness(4).</title>
<updated>2017-04-20T13:57:29Z</updated>
<author>
<name>visa</name>
<email>visa@openbsd.org</email>
</author>
<published>2017-04-20T13:57:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=c4925651028d655edda3c8b85b8d1b4a0cda6fb9'/>
<id>urn:sha1:c4925651028d655edda3c8b85b8d1b4a0cda6fb9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>while trying to reproduce lockups on mp alpha i hit an</title>
<updated>2015-04-17T12:38:54Z</updated>
<author>
<name>dlg</name>
<email>dlg@openbsd.org</email>
</author>
<published>2015-04-17T12:38:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=2d14ba29e46207fdcc52c0a8fb6573bfd9fa81c6'/>
<id>urn:sha1:2d14ba29e46207fdcc52c0a8fb6573bfd9fa81c6</id>
<content type='text'>
MUTEX_ASSERT_UNLOCKED, but it turns out alpha mutexes arent very
friendly to diagnostics on smp systems.

alpha mutexes contained an mtx_lock member. when 0 the mutex was
unlocked, and when 1 it was locked. the MUTEX_ASSERT_UNLOCKED checked
if mtx_lock was 1 to see if the current cpu owned the mutex, but
in an mp system another cpu may have set mtx_lock to 1, which causes
the assert to fire.

this changes alpha mutexes so they record which cpu owns the lock
rather than just if the lock is held or not. the diagnostics compare
the owner to the current cpus curcpu() address so they can actually
tell if the current cpu holds the lock instead of whether any cpu
holds the lock.

instead of using custom asm to implement a cas this uses atomic_cas_ptr,
which on alpha uses gcc cas code. miod says he has far more confidence
in the gcc cas than the code that was there before.

while im here i also shuffled the code. on MULTIPROCESSOR systems
instead of duplicating code between mtx_enter and mtx_enter_try,
mtx_enter simply loops on mtx_enter_try until it succeeds.

this also provides an alternative implementation of mutexes on
!MULTIPROCESSOR systems that avoids interlocking opcodes. mutexes
wont contend on UP boxes, theyre basically wrappers around spls.
we can just do the splraise, stash the owner as a guard value for
DIAGNOSTIC and return. similarly, mtx_enter_try on UP will never
fail, so we can just call mtx_enter and return 1.

ok miod@
</content>
</entry>
<entry>
<title>To prevent lock ordering problems with the kernel lock, we need to make sure</title>
<updated>2014-03-18T21:09:28Z</updated>
<author>
<name>kettenis</name>
<email>kettenis@openbsd.org</email>
</author>
<published>2014-03-18T21:09:28Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=bb51cfd138ffdff4d1254927781bac190a9da13f'/>
<id>urn:sha1:bb51cfd138ffdff4d1254927781bac190a9da13f</id>
<content type='text'>
we block all interrupts that can grab the kernel lock.  The simplest way to
achieve this is to make sure mutexes always raise the ipl to the highest
level that has interrupts that grab the kernel lock.  This will allow us
to have "mpsafe" interrupt handlers at lower priority levels.

No change for non-MULTIPROCESSOR kernels.

ok miod@
</content>
</entry>
<entry>
<title>In MUTEX_ASSERT_LOCKED, check we are the mutex owner if MULTIPROCESSOR.</title>
<updated>2014-01-28T22:04:07Z</updated>
<author>
<name>miod</name>
<email>miod@openbsd.org</email>
</author>
<published>2014-01-28T22:04:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=bafb89d1af8ebb43c03093e19c0a6f3ce5d6070c'/>
<id>urn:sha1:bafb89d1af8ebb43c03093e19c0a6f3ce5d6070c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Work in progress work towards SMP, heavily based upon NetBSD. The MP kernel</title>
<updated>2014-01-26T17:40:09Z</updated>
<author>
<name>miod</name>
<email>miod@openbsd.org</email>
</author>
<published>2014-01-26T17:40:09Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=21c23d01e5ede77407e8bb39e92ce0cee988c51a'/>
<id>urn:sha1:21c23d01e5ede77407e8bb39e92ce0cee988c51a</id>
<content type='text'>
will boot multiuser, but will deadlock under load, and I can't find my
mistake yet.
</content>
</entry>
<entry>
<title>Normalize sentinel. Use _MACHINE_*_H_ and _&lt;ARCH&gt;_*_H_ properly and consitently.</title>
<updated>2011-03-23T16:54:33Z</updated>
<author>
<name>pirofti</name>
<email>pirofti@openbsd.org</email>
</author>
<published>2011-03-23T16:54:33Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=2fa72412907ae78c4787a4a8f888c5f0486e225c'/>
<id>urn:sha1:2fa72412907ae78c4787a4a8f888c5f0486e225c</id>
<content type='text'>
Discussed and okay drahn@. Okay deraadt@.
</content>
</entry>
<entry>
<title>Alpha needs (will need) MUTEX_OLDIPL as well.</title>
<updated>2007-05-10T18:08:13Z</updated>
<author>
<name>art</name>
<email>art@openbsd.org</email>
</author>
<published>2007-05-10T18:08:13Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=81e4d8e6bdf7e19262d4134ec2c649d4b84c0ec2'/>
<id>urn:sha1:81e4d8e6bdf7e19262d4134ec2c649d4b84c0ec2</id>
<content type='text'>
</content>
</entry>
</feed>
