From owner-freebsd-stable@FreeBSD.ORG Tue Dec 6 03:02:11 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 553D71065673 for ; Tue, 6 Dec 2011 03:02:11 +0000 (UTC) (envelope-from alan.l.cox@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id DC64D8FC15 for ; Tue, 6 Dec 2011 03:02:10 +0000 (UTC) Received: by eaai12 with SMTP id i12so6570232eaa.13 for ; Mon, 05 Dec 2011 19:02:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=IqjrSbyHaNeTl21hpi+rjt+CjVNe81CMkj/H8EK2tGU=; b=MocF8sajHlPNhgBkZ7VpenezCls4hwUX20BR/ngRwNm+V9SJ1+dNoqQ0aPf7SA2n3M i7BW/OXJX/6lq9ImU+PVEuZegXgYwDfFpvzljd83YoupvKARzUiOJIQvoB98Xx685TL9 b+JM5drcZGh75EOZ1fBCNfg/+a7Rva/xDEr6M= MIME-Version: 1.0 Received: by 10.213.21.148 with SMTP id j20mr1769697ebb.87.1323140529650; Mon, 05 Dec 2011 19:02:09 -0800 (PST) Received: by 10.204.117.148 with HTTP; Mon, 5 Dec 2011 19:02:09 -0800 (PST) In-Reply-To: References: Date: Mon, 5 Dec 2011 21:02:09 -0600 Message-ID: From: Alan Cox To: Arnaud Lacombe Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-stable Subject: Re: PAE broken on 7-STABLE X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: alc@freebsd.org List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2011 03:02:11 -0000 On Mon, Dec 5, 2011 at 4:15 PM, Arnaud Lacombe wrote: > Hi, > > A FreeBSD 7-STABLE miserably crashes on the following: > > Fatal trap 12: page fault while in kernel mode > cpuid = 0; apic id = 00 > fault virtual address = 0xbfef0000 > fault code = supervisor read, page not present > instruction pointer = 0x20:0xc05fd1c2 > stack pointer = 0x28:0xc0af6c7c > frame pointer = 0x28:0xc0af6cc0 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, def32 1, gran 1 > processor eflags = interrupt enabled, resume, IOPL = 0 > current process = 0 () > trap number = 12 > panic: page fault > cpuid = 0 > KDB: stack > backtrace: > db_trace_self_wrapper(c0662728,0,c062b78b,c0af6b28,0,...) at > db_trace_self_wrapper+0x26panic(c062b78b,c06639cc,c06c1de4,1,1,...) at > panic+0x106trap_fatal(c0c74388,c065b897,c064d922,10,c0c74000,...) at > trap_fatal+0x270 > trap_pfault(c06d4e40,c0c74380,c0af6c40,3,c06c1bc0,...) at trap_pfault+0x2aa > trap(c0af6c3c) at trap+0x36ecalltrap() at calltrap+0x6 > --- trap 0xc, eip = 0xc05fd1c2, esp = 0xc0af6c7c, ebp = 0xc0af6cc0 --- > pmap_map(c0af6d68,3f6ba000,6,3fef8000,6,...) at pmap_map+0x72 > vm_page_startup(c0d3e000,a,c0af6d88,c03f8f26,0,...) at > vm_page_startup+0x35a > vm_mem_init(0,af0000,af0020,af0000,0,...) at vm_mem_init+0x18 > mi_startup() at mi_startup+0x56begin() at begin+0x2c > > on a machine with 24GB of RAM, while PAE is meant to support up to 64GB. > > - Arnaud > > ps: this is just a report, I'm not really expecting anything, any > longer, from the FreebSD "community". > > At this early stage in the boot process, the page table pages for the kernel address space must be statically allocated. When PAE was still actively used, it was unusual to find machines that had more than about 16GB of RAM. So, the static allocation of page table pages was set accordingly. For larger machines, it is necessary to increase NKPT. The following comment appears in i386/include/pmap.h: /* Initial number of kernel page tables. */ #ifndef NKPT #ifdef PAE /* 152 page tables needed to map 16G (76B "struct vm_page", 2M page tables). */ #define NKPT 240 #else /* 18 page tables needed to map 4G (72B "struct vm_page", 4M page tables). */ #define NKPT 30 #endif #endif That said, a machine with 24GB of RAM is likely not going to be usable for many workloads unless you also increase the size of the kernel virtual address space (and thereby reduce the size of the user virtual address space). Regards, Alan