Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Sep 2018 17:51:46 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338755 - head/sys/vm
Message-ID:  <201809181751.w8IHpkUV062428@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Sep 18 17:51:45 2018
New Revision: 338755
URL: https://svnweb.freebsd.org/changeset/base/338755

Log:
  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

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==============================================================================
--- head/sys/vm/uma_core.c	Tue Sep 18 16:57:04 2018	(r338754)
+++ head/sys/vm/uma_core.c	Tue Sep 18 17:51:45 2018	(r338755)
@@ -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. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809181751.w8IHpkUV062428>