PATCH: increase heap size for (gpt)zfsboot

Matt Reimer mattjreimer at gmail.com
Tue Dec 8 23:06:25 UTC 2009


On Tue, Dec 8, 2009 at 5:13 AM, John Baldwin <jhb at freebsd.org> wrote:
> On Monday 07 December 2009 7:01:03 pm Matt Reimer wrote:
>> Enlarge the heap size for gptzfsboot and zfsboot. This is necessary so
>> the ZFS code has enough memory to handle decompression and error
>> recovery.
>>
>> Before this patch the heap grew from the end of the (gpt)zfsboot code
>> and static data up to 640KB, possibly overrunning the stack. Now the
>> heap is located at 16MB-64MB.
>>
>> Note that this requires machines with at least 64MB RAM, but this is
>> not likely to be a problem on any machine running ZFS.
>>
>> Sponsored by: VPOP Technologies, Inc.
>>
>> Matt Reimer
>
> Unfortunately the 16M - 64M range may not all be useable RAM.  It may contain
> ACPI tables, etc.  A robust approach would involve walking the SMAP, etc.  I
> just committed some changes to sys/boot/i386/loader/biosmem.c that make it
> smarter about choosing a heap region.  I suggest adopting that algorithm for
> figuring out a safe heap range.  zfsboot and gptzfsboot should have enough
> free space to take the bios_getmem() function.  You can increase the minimum
> heap size beyond 3M if desired (though 3M is the minimum the loader will
> guarantee currently, and if ZFS needs more than that it likely needs to be
> changed in both places).

Thanks John. I dropped the bios_getmem() into zfsboot.c and it works
for me. How's the attached patch look to you?

Matt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: more-mem.patch
Type: application/octet-stream
Size: 5069 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20091208/b2fa5595/more-mem.obj


More information about the freebsd-fs mailing list