Re: Panic on boot with r351461 (AMD ThreadRipper 2990WX)

From: Mark Johnston <markj_at_freebsd.org>
Date: Sun, 25 Aug 2019 12:55:32 -0400
On Sun, Aug 25, 2019 at 10:27:48AM -0600, Rebecca Cran wrote:
> On 2019-08-25 08:30, Konstantin Belousov wrote:
> >
> > So what happens, IMO, is that for memory-less domains ds_cnt is zero
> > because ds_mask is zero, which causes the exception on divide.  You
> > can try the following combined patch, but I really dislike the fact
> > that I cannot safely use DOMAINSET_FIXED (if my diagnosis is correct).
> 
> 
> With that patch applied, boot gets a lot further but eventually panics
> after probing pcm devices:
> 
> 
> panic: vm_domainset_iter_first: Unknown policy 0

Can you please try applying this patch as well?

diff --git a/sys/vm/uma.h b/sys/vm/uma.h
index be88c57a5c66..39749ac52e99 100644
--- a/sys/vm/uma.h
+++ b/sys/vm/uma.h
_at__at_ -292,6 +292,8 _at__at_ uma_zone_t uma_zcache_create(char *name, int size, uma_ctor ctor, uma_dtor dtor,
 #define UMA_ALIGN_CACHE	(0 - 1)			/* Cache line size align */
 #define	UMA_ALIGNOF(type) (_Alignof(type) - 1)	/* Alignment fit for 'type' */
 
+#define	UMA_ANYDOMAIN	-1	/* Special value for domain search. */
+
 /*
  * Destroys an empty uma zone.  If the zone is not empty uma complains loudly.
  *
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index 9d8752df7200..78eaa7b49f82 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
_at__at_ -234,8 +234,6 _at__at_ enum zfreeskip {
 	SKIP_FINI =	0x00020000,
 };
 
-#define	UMA_ANYDOMAIN	-1	/* Special value for domain search. */
-
 /* Prototypes.. */
 
 int	uma_startup_count(int);
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index ed26f9607a8f..4a7bbc9770e9 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
_at__at_ -454,12 +454,18 _at__at_ vm_thread_dispose(struct thread *td)
 static int
 kstack_import(void *arg, void **store, int cnt, int domain, int flags)
 {
+	struct domainset *ds;
 	vm_object_t ksobj;
 	int i;
 
+	if (domain == UMA_ANYDOMAIN)
+		ds = DOMAINSET_RR();
+	else
+		ds = DOMAINSET_PREF(domain);
+
 	for (i = 0; i < cnt; i++) {
-		store[i] = (void *)vm_thread_stack_create(
-		    DOMAINSET_PREF(domain), &ksobj, kstack_pages);
+		store[i] = (void *)vm_thread_stack_create(ds, &ksobj,
+		    kstack_pages);
 		if (store[i] == NULL)
 			break;
 	}
Received on Sun Aug 25 2019 - 14:55:38 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:21 UTC