Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 Nov 2010 02:02:07 -0600
From:      Alan Cox <alc@rice.edu>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        Alan Cox <alc@freebsd.org>, freebsd-current@freebsd.org
Subject:   Re: minidump size on amd64
Message-ID:  <4CD8FFFF.3070106@rice.edu>
In-Reply-To: <4CD1D4AA.3060309@freebsd.org>
References:  <4CA0DA49.2090006@freebsd.org> <4CA3A48A.5070300@freebsd.org> <4CA3BD1E.5070807@rice.edu> <4CA5911E.3000101@freebsd.org> <4CAE0060.7050607@freebsd.org> <4CAECC4D.90707@rice.edu> <4CD1AA45.7000504@freebsd.org> <4CD1AD80.2090903@rice.edu> <4CD1D4AA.3060309@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Andriy Gapon wrote:
> So, here is the next version of the patch:
> http://people.freebsd.org/~avg/amd64-minidump.4.diff
>
> Changes since the last version:
> 1. libkvm - try to support both the new and the previous formats/versions of
> amd64 minidump.  I am not entirely sure about style in which I handled handling
> of version 1 minidump.  Identifier names like pmapsize (for "page map size") and
> page_map could also be improved, perhaps.
> 2. kernel - implemented dumping of 1GB pages via "fake" 512 x 2MB pages per
> Alan's suggestion.
>
> The change is only compile tested so far.  Not sure if it's possible to test
> handling 1GB pages yet :-)
>
> As always, reviews, testing and suggestions are very welcome.
>   


The kernel portion of the patch looks correct.  If I were to make one 
stylistic suggestion, it would be to make the control flow of the outer 
and inner loops as similar as possible, that is,

    for (...
       if ((pdp[i] & PG_V) == 0) {
          ...
          continue;
       }
       if ((pdp[i] & PG_PS) != 0) {
          ...
          continue;
       }
       for (...
          if ((pd[j] & PG_V) == 0)
             continue;
          if ((pd[j] & PG_PS) != 0) {
             ...
             continue;
          }
          for (...
             if ((pt[x] & PG_V) == 0)
                continue;
             ...

I think this would make the code a little easier to follow.

Alan




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