aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2018-09-18 17:51:45 +0000
committerMark Johnston <markj@FreeBSD.org>2018-09-18 17:51:45 +0000
commit26fe2217bfbd6aa6ec67f5c57a2e7344bcf2fdff (patch)
tree091669dc29821f2709619bf4ee62b4f36c23ab75
parentdc39aae35ec4afaa6119b1645488ef3ac525bcf3 (diff)
downloadsrc-26fe2217bfbd6aa6ec67f5c57a2e7344bcf2fdff.tar.gz
src-26fe2217bfbd6aa6ec67f5c57a2e7344bcf2fdff.zip
Only update the domain cursor once in keg_fetch_slab().
We drop the keg lock when we go to actually allocate the slab, allowing other threads to advance the cursor. This can cause us to exit the round-robin loop before having attempted allocations from all domains, resulting in a hang during a subsequent blocking allocation attempt from a depleted domain. Reported and tested by: Jan Bramkamp <crest@bultmann.eu> Reviewed by: alc, cem Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17209
Notes
Notes: svn path=/head/; revision=338755
-rw-r--r--sys/vm/uma_core.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index 908349379763..937e78452021 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -2698,10 +2698,8 @@ again:
LIST_INSERT_HEAD(&dom->ud_part_slab, slab, us_link);
return (slab);
}
- if (rr) {
- keg->uk_cursor = (keg->uk_cursor + 1) % vm_ndomains;
- domain = keg->uk_cursor;
- }
+ if (rr)
+ domain = (domain + 1) % vm_ndomains;
} while (domain != start);
/* Retry domain scan with blocking. */