From owner-freebsd-current@FreeBSD.ORG Wed Sep 29 20:41:50 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22CDB106566C; Wed, 29 Sep 2010 20:41:50 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 3CD168FC08; Wed, 29 Sep 2010 20:41:48 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA04478; Wed, 29 Sep 2010 23:41:47 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1P13TH-0004QK-GZ; Wed, 29 Sep 2010 23:41:47 +0300 Message-ID: <4CA3A48A.5070300@freebsd.org> Date: Wed, 29 Sep 2010 23:41:46 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100918 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: freebsd-current@freebsd.org References: <4CA0DA49.2090006@freebsd.org> In-Reply-To: <4CA0DA49.2090006@freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Alan Cox Subject: Re: minidump size on amd64 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 29 Sep 2010 20:41:50 -0000 on 27/09/2010 20:54 Andriy Gapon said the following: > > It seems that minidump on amd64 is always dumping at least about 1GB of data > regardless of actual memory size and usage and thus can be even larger than > regular dump. > > Specifically, I suspect the following code: > for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + NKPT * NBPDR, > kernel_vm_end); va += NBPDR) { > i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1); > /* > * We always write a page, even if it is zero. Each > * page written corresponds to 2MB of space > */ > ptesize += PAGE_SIZE; > > It seems that difference between KERNBASE and VM_MIN_KERNEL_ADDRESS is already > ~500G. Which means 500G divided by 2M equals 250K iterations/pages. Which is 1GB > of data. > > Looks like this came from amd64 KVA expansion. > And it seems a little bit wasteful? So perhaps we need to add another level of indirection? I.e. first dump contiguous array of "pseudo-pde" entries that would point to chunks of "pseudo-pte" entries, so that "pseudo-pte" entries could be sparse. This is instead of dumping 1GB of contiguous "pseudo-ptes" as we do now. A bit of work, though. -- Andriy Gapon