From owner-freebsd-current@FreeBSD.ORG Thu Oct 7 17:16:19 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 C5277106564A; Thu, 7 Oct 2010 17:16:19 +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 D9D408FC0A; Thu, 7 Oct 2010 17:16:18 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA17980; Thu, 07 Oct 2010 20:16:17 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4CAE0060.7050607@freebsd.org> Date: Thu, 07 Oct 2010 20:16:16 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100920 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: freebsd-current@freebsd.org References: <4CA0DA49.2090006@freebsd.org> <4CA3A48A.5070300@freebsd.org> <4CA3BD1E.5070807@rice.edu> <4CA5911E.3000101@freebsd.org> In-Reply-To: <4CA5911E.3000101@freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Alan Cox , Garrett Cooper , 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: Thu, 07 Oct 2010 17:16:19 -0000 on 01/10/2010 10:43 Andriy Gapon said the following: > The idea. We dump contiguously only pages with PDEs (which means both valid and > invalid PDEs), valid pages with PTEs are dumped the same way as data physical > pages (i.e. via dump_add_page, etc); no fake PTEs for 2MB pages. > PDE area of the dump takes about 20MB as opposed to 1GB for PTE area (the math > is obvious, but just in case). > > libkva is changed to treat former PTE area as PDE area and is also taught to > understand PG_PS in PDE. > There is now an overhead of having to first read a PTE page in V-to-P-to-offset > lookup for !PG_PS case. Perhaps we could cache all PTEs in memory and have a > lookup table for them, but I didn't bother with this possibly premature > optimization at this time. > > There is an unrelated change in minidumpsys - "bitmap_frozen". > I had to do it despite having a patch in my local tree to stop other CPUs on > panic->dump. Code in dump path (peripheral disk driver, CAM, SIM driver, > something else?) seems to do some memory allocations and change dump bitmap, > which leads to a mismatch between dump size and dump bitmap; and also > potentially to inconsistencies in the bitmap itself. So I decided that it's a > good idea to freeze the bitmap once we decided what pages we want to dump. > > Some variables and structure fields with 'pte' in them should probably be > renamed to have 'pde' instead. Here's an updated patch: http://people.freebsd.org/~avg/amd64-minidump.3.diff I went ahead and changed 'pte' to 'pde' in various names. Also, I ditched somewhat questionable "bitmap_frozen" approach and instead opted for restarting a dump on a size mismatch. This was suggested by kib@. Garret Cooper has pointed out some problems with bitmap_frozen approach. I think that actual problem was a scenario where a dump is done, then the system is allowed to continue and then another dump is done. An exotic case perhaps? :-) One probably desirable feature that is missing is backward compatibility in libkvm. If that is a showstopper, then I'll have to work on preserving it. As usual, I will appreciate any feedback - reviews, testing, etc. Thanks! -- Andriy Gapon