From owner-freebsd-current@freebsd.org Sun Aug 25 16:55:38 2019 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65EB1E37E6 for ; Sun, 25 Aug 2019 16:55:38 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Gh8n13fmz485V for ; Sun, 25 Aug 2019 16:55:36 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd43.google.com with SMTP id l7so31720185ioj.6 for ; Sun, 25 Aug 2019 09:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vhinh3ClYbjdN9daHRMvJqwa+SeV0HCIcta6IcpyUb8=; b=ttawaH+mtyVJBbHCrF5SrXQA/ca7bYZYiVlvKtykPUuz3riXhqpmbA+K2OB9HujmxC RiEAJN92+mEsDTDyiqhj9Okm1+gjnzl6fXPW32czZBEfT+mNKHke0HMFeVVCgME4uRPQ kpEXQggCzEnnmOCcJ2HN+jOMkbbnyD4h5HAqK2xiR6kVdav2gxqn4R8OhS+DUTGLm0Ra 6sHNFWqjoOv35Vaw8ClJwvXuebuIJIiV5dgSxT80aAUUjxNdi7dCtPU+Thr9oG9eQgmN 6x+PlMSw9OTA/ocfzgS6tZ64AHOlZFPNPHYkXCT+dL3HtPkRpO46xYQ/X7qHVDWgChmz 2ICg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=vhinh3ClYbjdN9daHRMvJqwa+SeV0HCIcta6IcpyUb8=; b=sXpg1k1u5MBHkQd7SuYyVm3MP9C7mZaPL8UMgCmeGQCeJ7f5Cr8Sk8nE/ykIPBIeQr Vvz+EnZ3/gPMdW4TWlvEEyA3UH1WbHgFLBOAWGuXa3JNDt59iEWmGW6vM1btVieKkmRT Vio+UR+MpcX59lcEZoVkOrug4NmbGcwdT6/TIgEgkfTpvzQclHvts0S694hZE6yCl8ny 9VXBvJFgFXQds79JWK7ftMXtEaocVDFEtUWvI4cIjEIMc7SGOYAR/4GIX2hZaw0GnHF8 a2p8wtv+M70j6XC9KCWuI+Qll6dUn6biM1jf/lToZkOAUQoUPLXE8MHBeUqKRT5OL4NW Kdiw== X-Gm-Message-State: APjAAAVlSYkApVqsn4KX3L3b/aqN4Pjytz1HdHTRZhT9g7IFNbTA32Kt yQPL/S085kBqfECNMYJofOQ= X-Google-Smtp-Source: APXvYqzcL2XWjQAliKf7Q5o0c3J6nqMOgr7hhixp7/k0dZL8RJFfMUdMC/AYG6Ete8n8CtAfOwBHAg== X-Received: by 2002:a02:cc8f:: with SMTP id s15mr14573791jap.53.1566752135571; Sun, 25 Aug 2019 09:55:35 -0700 (PDT) Received: from raichu (toroon0560w-lp140-03-184-148-66-213.dsl.bell.ca. [184.148.66.213]) by smtp.gmail.com with ESMTPSA id m20sm7122448ioh.4.2019.08.25.09.55.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2019 09:55:34 -0700 (PDT) Sender: Mark Johnston Date: Sun, 25 Aug 2019 12:55:32 -0400 From: Mark Johnston To: Rebecca Cran Cc: Konstantin Belousov , FreeBSD Current Subject: Re: Panic on boot with r351461 (AMD ThreadRipper 2990WX) Message-ID: <20190825165532.GB33382@raichu> References: <6e5687b2-ab3f-a570-37ab-72c8a9776167@bsdio.com> <20190824203305.GF71821@kib.kiev.ua> <20190824230801.GK71821@kib.kiev.ua> <20190825062407.GL71821@kib.kiev.ua> <9e94aea8-7d63-0f9e-2f1e-c1492e9dc455@bsdio.com> <20190825143034.GO71821@kib.kiev.ua> <21865c12-9cb4-6560-1075-7cea5f83b30a@bsdio.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <21865c12-9cb4-6560-1075-7cea5f83b30a@bsdio.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 46Gh8n13fmz485V X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=ttawaH+m; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::d43 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[213.66.148.184.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-0.62)[ip: (2.17), ipnet: 2607:f8b0::/32(-2.87), asn: 15169(-2.33), country: US(-0.05)]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.4.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_CC(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 16:55:38 -0000 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 @@ -292,6 +292,8 @@ 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 @@ -234,8 +234,6 @@ 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 @@ -454,12 +454,18 @@ 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; }