summaryrefslogtreecommitdiffstats
path: root/sys/dev/pv/xen.c
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2017-07-14 20:08:46 +0000
committermikeb <mikeb@openbsd.org>2017-07-14 20:08:46 +0000
commit65ba8a2143c17bc11daea7ce12cf1e049ce82682 (patch)
treef8443cfcb3b9278e14322f082c095099c7764ec3 /sys/dev/pv/xen.c
parentSilence the interrupt source until the interrupt task has done its job (diff)
downloadwireguard-openbsd-65ba8a2143c17bc11daea7ce12cf1e049ce82682.tar.xz
wireguard-openbsd-65ba8a2143c17bc11daea7ce12cf1e049ce82682.zip
Reduce the number of CAS loops from ludicrous to ridiculous
Now that the source of the delay with releasing grant table entries has been identified and fixed the number of attempts to CAS entry flags can be substantially reduced and while it's decreased by a factor of 100000, it should go down at least a 100 more in the future.
Diffstat (limited to 'sys/dev/pv/xen.c')
-rw-r--r--sys/dev/pv/xen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pv/xen.c b/sys/dev/pv/xen.c
index d66293f14a4..815ec383a85 100644
--- a/sys/dev/pv/xen.c
+++ b/sys/dev/pv/xen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xen.c,v 1.83 2017/07/14 19:09:52 mikeb Exp $ */
+/* $OpenBSD: xen.c,v 1.84 2017/07/14 20:08:46 mikeb Exp $ */
/*
* Copyright (c) 2015, 2016, 2017 Mike Belopuhov
@@ -1213,7 +1213,7 @@ xen_grant_table_remove(struct xen_softc *sc, grant_ref_t ref)
(ge->ge_table[ref].domid << 16);
loop = 0;
while (atomic_cas_uint(ptr, flags, GTF_invalid) != flags) {
- if (loop++ > 100000000) {
+ if (loop++ > 1000) {
printf("%s: grant table reference %u is held "
"by domain %d\n", sc->sc_dev.dv_xname, ref +
ge->ge_start, ge->ge_table[ref].domid);