From owner-freebsd-arch@FreeBSD.ORG Tue Mar 22 17:31:18 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0AFC1065677 for ; Tue, 22 Mar 2011 17:31:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id 6E5E18FC22 for ; Tue, 22 Mar 2011 17:31:18 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 4A21A25D386D for ; Tue, 22 Mar 2011 17:30:45 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 9C585159B625 for ; Tue, 22 Mar 2011 17:30:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id MKElwrV1zWXT for ; Tue, 22 Mar 2011 17:30:43 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 84AD1159B61A for ; Tue, 22 Mar 2011 17:30:43 +0000 (UTC) Date: Tue, 22 Mar 2011 17:30:42 +0000 (UTC) From: "Bjoern A. Zeeb" To: arch@freebsd.org Message-ID: X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Cc: Subject: kernel memory checks on boot vs. boot time X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2011 17:31:18 -0000 Hi, as part of the i386/pc98/amd64 boot process we are doing some basic memory testing, mapping pages and running a couple of pattern write/read tests on the first bytes (see getmemsize() implmentations). Depending on the features enabled and boot -v or not you may notice it as "nothing happens" booting from loader, after any of these possible lines: GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb SMAP type=... but before the Copyright message. With the growing number of memory this can lead to a significant fraction of kernel startup time on amd64 (~40s delays observed with 96G of RAM). Looping over the pages, but not mapping them and not running the pattern tests reduces this significantly (to single digit numbers of seconds). As a first step I'd like to discuss how worth the actual memory tests are these days, to figure out a sensible default. Not wanting to remove them but maybe make more use of them in the future (as we do not report any problems we find currently) I'd suggest to introduce a tunable to disable/enable them, say hw.run_memtest with the following values: 0 do not map the page and do not run the pattern tests 1 do run the pattern test on the beginning of the page (current default). and maybe add 2 run the pattern tests on the entire pages? I would further suggest to add a printf independently of boot -v there, so that the user who would wait, will know what's (not) going on. Something along the lines of: "Testing physical address space (%s)." 0 "skipping extra pattern tests" 1 "pattern tests on beginning of each page" 2 "pattern tests on entire pages" If this is something that makes sense, I'd suggest to factor things out to sys/x86 and would provide a patch for further discussion and improvements (like error reporting, etc). Comments? Suggestions? Bjoern -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family.