<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-openbsd/sys/uvm, branch master</title>
<subtitle>WireGuard implementation for the OpenBSD kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-openbsd/atom/sys/uvm?h=master</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-openbsd/atom/sys/uvm?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/'/>
<updated>2021-03-31T08:53:39Z</updated>
<entry>
<title>Introduce UAO_USES_SWHASH() and use tabs instead of spaces in #defines.</title>
<updated>2021-03-31T08:53:39Z</updated>
<author>
<name>mpi</name>
<email>mpi@openbsd.org</email>
</author>
<published>2021-03-31T08:53:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=39c73ac77e4aa3b464eba41d5bf747e695f91b02'/>
<id>urn:sha1:39c73ac77e4aa3b464eba41d5bf747e695f91b02</id>
<content type='text'>
No functionnal change, reduce the difference with NetBSD.

ok jmatthew@
</content>
</entry>
<entry>
<title>Remove parenthesis around return value to reduce the diff with NetBSD.</title>
<updated>2021-03-26T13:40:05Z</updated>
<author>
<name>mpi</name>
<email>mpi@openbsd.org</email>
</author>
<published>2021-03-26T13:40:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=b9df1565ef82604eba98afb01045f088eb20cf68'/>
<id>urn:sha1:b9df1565ef82604eba98afb01045f088eb20cf68</id>
<content type='text'>
No functional change.

ok mlarkin@
</content>
</entry>
<entry>
<title>Sync some comments in order to reduce the difference with NetBSD.</title>
<updated>2021-03-20T10:24:21Z</updated>
<author>
<name>mpi</name>
<email>mpi@openbsd.org</email>
</author>
<published>2021-03-20T10:24:21Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=52887a3857412054fd51c1af58c9c8fe944e10f7'/>
<id>urn:sha1:52887a3857412054fd51c1af58c9c8fe944e10f7</id>
<content type='text'>
No functionnal change.

ok kettenis@
</content>
</entry>
<entry>
<title>spelling</title>
<updated>2021-03-12T14:15:49Z</updated>
<author>
<name>jsg</name>
<email>jsg@openbsd.org</email>
</author>
<published>2021-03-12T14:15:49Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=4af3577ff281f32bc2b40d899fa25046271de1d3'/>
<id>urn:sha1:4af3577ff281f32bc2b40d899fa25046271de1d3</id>
<content type='text'>
ok mpi@
</content>
</entry>
<entry>
<title>ansi</title>
<updated>2021-03-05T05:30:44Z</updated>
<author>
<name>jsg</name>
<email>jsg@openbsd.org</email>
</author>
<published>2021-03-05T05:30:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=fbaef5a95e6253a38e8c205cadf0514f8c268842'/>
<id>urn:sha1:fbaef5a95e6253a38e8c205cadf0514f8c268842</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Modify `uvmexp.swpgonly' atomically, required for uvm_fault() w/o KERNEL_LOCK()</title>
<updated>2021-03-04T09:00:03Z</updated>
<author>
<name>mpi</name>
<email>mpi@openbsd.org</email>
</author>
<published>2021-03-04T09:00:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=c4a864ba38a189859dcf0af4cf9fb01aabd6a92c'/>
<id>urn:sha1:c4a864ba38a189859dcf0af4cf9fb01aabd6a92c</id>
<content type='text'>
ok kettenis@
</content>
</entry>
<entry>
<title>Bring back previous fix for UVM vnode deadlock.</title>
<updated>2021-03-04T08:38:48Z</updated>
<author>
<name>mpi</name>
<email>mpi@openbsd.org</email>
</author>
<published>2021-03-04T08:38:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=00e7696ef29d639c47992c239d3900a5b4cbb811'/>
<id>urn:sha1:00e7696ef29d639c47992c239d3900a5b4cbb811</id>
<content type='text'>
tb@ reports that refaulting when there's contention on the vnode makes
firefox start very slowly on his machine.  To revisit when the fault
handler will be unlocked.

ok anton@

Original commit message:

Fix a deadlock between uvn_io() and uvn_flush(). While faulting on a
page backed by a vnode, uvn_io() will end up being called in order to
populate newly allocated pages using I/O on the backing vnode. Before
performing the I/O, newly allocated pages are flagged as busy by
uvn_get(), that is before uvn_io() tries to lock the vnode. Such pages
could then end up being flushed by uvn_flush() which already has
acquired the vnode lock. Since such pages are flagged as busy,
uvn_flush() will wait for them to be flagged as not busy. This will
never happens as uvn_io() cannot make progress until the vnode lock is
released.

Instead, grab the vnode lock before allocating and flagging pages as
busy in uvn_get(). This does extend the scope in uvn_get() in which the
vnode is locked but resolves the deadlock.

ok mpi@

Reported-by: syzbot+e63407b35dff08dbee02@syzkaller.appspotmail.com
</content>
</entry>
<entry>
<title>Fix the deadlock between uvn_io() and uvn_flush() by restarting the fault.</title>
<updated>2021-03-02T10:12:37Z</updated>
<author>
<name>mpi</name>
<email>mpi@openbsd.org</email>
</author>
<published>2021-03-02T10:12:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=3426345d211be9d90bb8991ff6daa953ea3b752a'/>
<id>urn:sha1:3426345d211be9d90bb8991ff6daa953ea3b752a</id>
<content type='text'>
Do not allow a faulting thread to sleep on a contended vnode lock to prevent
lock ordering issues with upcoming per-uobj lock.

ok anton@

Reported-by: syzbot+e63407b35dff08dbee02@syzkaller.appspotmail.com
</content>
</entry>
<entry>
<title>Revert the fix for the deadlock between uvn_io() and uvn_flush().</title>
<updated>2021-03-02T10:09:20Z</updated>
<author>
<name>mpi</name>
<email>mpi@openbsd.org</email>
</author>
<published>2021-03-02T10:09:20Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=4deeff89dc578f0b4221cd4a79a8e3693afe5c5b'/>
<id>urn:sha1:4deeff89dc578f0b4221cd4a79a8e3693afe5c5b</id>
<content type='text'>
This fix (ab)use the vnode lock to serialize access to some fields of
the corresponding pages associated with UVM vnode object and this will
create new deadlocks with the introduction of a per-uobj lock.

ok anton@
</content>
</entry>
<entry>
<title>If an anon is associated with a page, acquire its lock before any modification.</title>
<updated>2021-03-01T09:13:33Z</updated>
<author>
<name>mpi</name>
<email>mpi@openbsd.org</email>
</author>
<published>2021-03-01T09:13:33Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=1c92e3af03b7e2f4288e77e83c65213588485773'/>
<id>urn:sha1:1c92e3af03b7e2f4288e77e83c65213588485773</id>
<content type='text'>
This change should have been part of the previous anon-locking diff and is
necessary to run the top part of uvm_fault() unlocked.

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