From nobody Fri Aug 04 01:22:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RH7HN2BDhzZY0S; Fri, 4 Aug 2023 01:22:24 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail2.karels.net (mail2.karels.net [3.19.118.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "freebsd", Issuer "freebsd" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RH7HM5sdCz4Y5W; Fri, 4 Aug 2023 01:22:23 +0000 (UTC) (envelope-from mike@karels.net) Authentication-Results: mx1.freebsd.org; none Received: from mail2.karels.net (localhost [IPv6:0:0:0:0:0:0:0:1]) by mail2.karels.net (8.17.1/8.17.1) with ESMTP id 3741MHRE043363; Thu, 3 Aug 2023 20:22:17 -0500 (CDT) (envelope-from mike@karels.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=karels.net; s=mail2; t=1691112137; bh=G2VFzlyhA5RkJWqjfrVzBsePpcWblym1RzwPgIoL9qk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=N31kAsirYxGIpZgLJFQkKlDPYsXuRyaklq9Jlg5z7gRY7pXuoeQpxJeViMoOp3NnR UYko+beBLI0+h04QBQh0h7a0ld5315wWzSgR+s49sriGCAMosAPzEQ6FKKc1eVa4gk f5PJ0tA2Re5Yw0RspDbYvp2xqNmsMFGUHJUtr5jc++/ttmJ8pvSlaSEsbN4bWUUcy1 VMbJAFpAR1zzDcXG/Kpob+JMjcc3g4J73nNJY0jCWhg6QmQKb4kAon2ZieYuHIhDfp mPlZ+lEvb2rqPMrkLuRNejJ/LJA80FMlnlqv3JTQgwUUoqblG1ZEHSSgx+dAd4t4fU f1EvAbK4flqMw== Received: from [10.0.2.130] ([73.62.165.147]) by mail2.karels.net with ESMTPSA id LgK4EslSzGRhqQAAs/W3XQ (envelope-from ); Thu, 03 Aug 2023 20:22:17 -0500 From: Mike Karels To: Doug Moore Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: c9b06fa52776 - main - vm_phys_enqueue_contig: handle npages==0 Date: Thu, 03 Aug 2023 20:22:16 -0500 X-Mailer: MailMate (1.14r5964) Message-ID: <870960EF-BC8B-4FD4-A428-BFC789DB39B1@karels.net> In-Reply-To: <202308031421.373ELqS8022332@gitrepo.freebsd.org> References: <202308031421.373ELqS8022332@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4RH7HM5sdCz4Y5W X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.16.0.0/14, country:US] On 3 Aug 2023, at 9:21, Doug Moore wrote: > The branch main has been updated by dougm: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dc9b06fa52776fbf555b9397a= 8d28a54c957108ec > > commit c9b06fa52776fbf555b9397a8d28a54c957108ec > Author: Doug Moore > AuthorDate: 2023-08-03 14:19:48 +0000 > Commit: Doug Moore > CommitDate: 2023-08-03 14:19:48 +0000 > > vm_phys_enqueue_contig: handle npages=3D=3D0 > > By letting vm_phys_enqueue_contig handle the case when npages =3D=3D= 0, > the callers can stop checking it, and the compiler can stop > zero-checking with every call to ffs(). Letting vm_phys_enqueue_con= tig > call vm_phys_enqueue_contig for part of its work also saves a few > bytes. > > The amd64 object code shrinks by 128 bytes. > > Reviewed by: kib (previous version) > Tested by: pho > Differential Revision: https://reviews.freebsd.org/D41154 My machine panics like this during startup with this change in place agai= n: real memory =3D 68717379584 (65534 MB) panic: vm_phys_enq_range: page 0xfffffe006cdc8108 and npages 0 are misali= gned cpuid =3D 0 time =3D 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff831= 77ac0 vpanic() at vpanic+0x132/frame 0xffffffff83177bf0 panic() at panic+0x43/frame 0xffffffff83177c50 vm_phys_enq_range() at vm_phys_enq_range+0x12d/frame 0xffffffff83177c60 vm_phys_alloc_contig() at vm_phys_alloc_contig+0x557/frame 0xffffffff8317= 7cf0 vm_page_find_contig_domain() at vm_page_find_contig_domain+0xbe/frame 0xf= fffffff83177d60 vm_page_alloc_contig_domain() at vm_page_alloc_contig_domain+0x135/frame = 0xffffffff83177df0 kmem_alloc_contig_pages() at kmem_alloc_contig_pages+0x92/frame 0xfffffff= f83177e80 kmem_alloc_attr_domainset() at kmem_alloc_attr_domainset+0x20d/frame 0xff= ffffff83177f40 vm_ksubmap_init() at vm_ksubmap_init+0x65/frame 0xffffffff83177f80 cpu_startup() at cpu_startup+0x20b/frame 0xffffffff83177fa0 mi_startup() at mi_startup+0x1f1/frame 0xffffffff83177ff0 btext() at btext+0x23 KDB: enter: panic [ thread pid 0 tid 0 ] Stopped at kdb_enter+0x32: movq $0,0xe29533(%rip) db> If I comment out the assert, it boots and runs. Mike