Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Feb 2018 12:30:17 +0100
From:      Peter Holm <peter@holm.cc>
To:        Gleb Smirnoff <glebius@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r328916 - in head/sys: kern vm
Message-ID:  <20180206113017.GA25428@x2.osted.lan>
In-Reply-To: <201802060416.w164G0va096970@repo.freebsd.org>
References:  <201802060416.w164G0va096970@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Feb 06, 2018 at 04:16:00AM +0000, Gleb Smirnoff wrote:
> Author: glebius
> Date: Tue Feb  6 04:16:00 2018
> New Revision: 328916
> URL: https://svnweb.freebsd.org/changeset/base/328916
> 
> Log:
>   Followup on r302393 by cperciva, improving calculation of boot pages required
>   for UMA startup.
>   
>   o Introduce another stage of UMA startup, which is entered after
>     vm_page_startup() finishes. After this stage we don't yet enable buckets,
>     but we can ask VM for pages. Rename stages to meaningful names while here.
>     New list of stages: BOOT_COLD, BOOT_STRAPPED, BOOT_PAGEALLOC, BOOT_BUCKETS,
>     BOOT_RUNNING.
>     Enabling page alloc earlier allows us to dramatically reduce number of
>     boot pages required. What is more important number of zones becomes
>     consistent across different machines, as no MD allocations are done before
>     the BOOT_PAGEALLOC stage. Now only UMA internal zones actually need to use
>     startup_alloc(), however that may change, so vm_page_startup() provides
>     its need for early zones as argument.
>   o Introduce uma_startup_count() function, to avoid code duplication. The
>     functions calculates sizes of zones zone and kegs zone, and calculates how
>     many pages UMA will need to bootstrap.
>     It counts not only of zone structures, but also of kegs, slabs and hashes.
>   o Hide uma_startup_foo() declarations from public file.
>   o Provide several DIAGNOSTIC printfs on boot_pages usage.
>   o Bugfix: when calculating zone of zones size use (mp_maxid + 1) instead of
>     mp_ncpus. Use resulting number not only in the size argument to zone_ctor()
>     but also as args.size.
>   
>   Reviewed by:		imp, gallatin (earlier version)
>   Differential Revision:	https://reviews.freebsd.org/D14054
> 
> Modified:
>   head/sys/kern/kern_malloc.c
>   head/sys/vm/uma.h
>   head/sys/vm/uma_core.c
>   head/sys/vm/uma_int.h
>   head/sys/vm/vm_page.c
> 
> Modified: head/sys/kern/kern_malloc.c
> ==============================================================================
> --- head/sys/kern/kern_malloc.c	Tue Feb  6 02:13:44 2018	(r328915)

i386 also doesn't boot:

FreeBSD 12.0-CURRENT #1 r328924: Tue Feb  6 11:51:17 CET 2018
    pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386
FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0)
WARNING: WITNESS option enabled, expect reduced performance.
WARNING: DIAGNOSTIC option enabled, expect reduced performance.
Entering uma_startup with 4 boot pages configured
startup_alloc from "UMA Kegs", 3 boot pages left
startup_alloc from "UMA Zones", 2 boot pages left
startup_alloc from "UMA Hash", 1 boot pages left
Entering uma_startup1 with 0 boot pages left
kernel trap 12 with interrupts disabled


Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address   = 0x19c
fault code              = supervisor read, page not present
instruction pointer     = 0x20:0xc0cda3f8
stack pointer           = 0x28:0xc2022aac
frame pointer           = 0x28:0xc2022adc
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, def32 1, gran 1
processor eflags        = resume, IOPL = 0
current process         = 0 ()
[ thread pid 0 tid 0 ]
Stopped at      vmem_alloc+0x88:        cmpl    %esi,0x19c(%edi)
db> x/s version
version:        FreeBSD 12.0-CURRENT #1 r328924: Tue Feb  6 11:51:17 CET 2018\012    pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO\012
db> show registers
cs                0x20
ds                0x28
es                0x28
fs                 0x8
gs                0x28
ss                0x28
eax         0xc2022af8
ecx         0xc2022af8
edx         0xc23b5000
ebx             0x2002
esp         0xc2022aac
ebp         0xc2022adc
esi             0x1000
edi                  0
eip         0xc0cda3f8  vmem_alloc+0x88
efl            0x10002
vmem_alloc+0x88:        cmpl    %esi,0x19c(%edi)
db> bt
Tracing pid 0 tid 0 td 0xc1be3f40
vmem_alloc(0,1000,2102,c2022af8,450,...) at vmem_alloc+0x88/frame 0xc2022adc
kmem_malloc_domain(0,1000,102,450,c23b5000,...) at kmem_malloc_domain+0x44/frame 0xc2022b08
startup_alloc(c23b4000,1000,0,c2022b63,102,...) at startup_alloc+0xeb/frame 0xc2022b30
keg_alloc_slab(0,2,c169eb10,984,c169eb10,...) at keg_alloc_slab+0xf6/frame 0xc2022b78
keg_fetch_slab(ffffffff,2,c169eb10,9e6,c23b4000,...) at keg_fetch_slab+0x10e/frame 0xc2022bd0
zone_fetch_slab(c23b4000,0,ffffffff,2,ef0,...) at zone_fetch_slab+0x61/frame 0xc2022bf4
zone_import(c23b4000,c2022c50,1,ffffffff,2,...) at zone_import+0x3b/frame 0xc2022c2c
zone_alloc_item(ffffffff,2,c1655850,c2022c94,c165585f,...) at zone_alloc_item+0x3d/frame 0xc2022c60
uma_zcreate(c165585f,1c,0,0,0,...) at uma_zcreate+0xce/frame 0xc2022cbc
vmem_startup(c2157000,c0cc49fb,c12afc4b,c2022d0c,c2022d0c,...) at vmem_startup+0xb7/frame 0xc2022ce4
vm_mem_init(0,0,0,0,c18689c0,...) at vm_mem_init+0x24/frame 0xc2022d10
mi_startup() at mi_startup+0xf7/frame 0xc2022d38
begin() at begin+0x2f
db>

r328915 boots OK.

- Peter



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