Date: Wed, 9 Dec 2009 12:48:08 -0800 From: Matt Reimer <mattjreimer@gmail.com> To: John Baldwin <jhb@freebsd.org> Cc: freebsd-fs@freebsd.org Subject: Re: PATCH: increase heap size for (gpt)zfsboot Message-ID: <f383264b0912091248v4a944a08wbef0240a516da36d@mail.gmail.com> In-Reply-To: <200912091531.42421.jhb@freebsd.org> References: <f383264b0912071601p3bfab229rd1b282b80db2aff6@mail.gmail.com> <200912091015.15450.jhb@freebsd.org> <f383264b0912091000r714dff84pa55e70b64af7ff52@mail.gmail.com> <200912091531.42421.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Dec 9, 2009 at 12:31 PM, John Baldwin <jhb@freebsd.org> wrote: > On Wednesday 09 December 2009 1:00:47 pm Matt Reimer wrote: >> On Wed, Dec 9, 2009 at 7:15 AM, John Baldwin <jhb@freebsd.org> wrote: >> > On Tuesday 08 December 2009 6:06:14 pm Matt Reimer wrote: >> >> On Tue, Dec 8, 2009 at 5:13 AM, John Baldwin <jhb@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 necessar= y 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 c= ode >> >> >> and static data up to 640KB, possibly overrunning the stack. Now t= he >> >> >> 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. =A0It= may contain >> >> > ACPI tables, etc. =A0A robust approach would involve walking the SM= AP, etc. =A0I >> >> > just committed some changes to sys/boot/i386/loader/biosmem.c that = make it >> >> > smarter about choosing a heap region. =A0I suggest adopting that al= gorithm for >> >> > figuring out a safe heap range. =A0zfsboot and gptzfsboot should ha= ve enough >> >> > free space to take the bios_getmem() function. =A0You 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 need= s 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? >> > >> > I tweaked it slightly (memtop* aren't needed for gptboot, and memsize(= ) isn't >> > used anymore). =A0Can you test the updated version below? >> >> It works. But making bios_getmem() inline causes a compiler warning: >> >> /usr/src/sys/boot/i386/gptzfsboot/../zfsboot/zfsboot.c: In function 'mai= n': >> /usr/src/sys/boot/i386/gptzfsboot/../zfsboot/zfsboot.c:353: warning: >> inlining failed in call to 'bios_getmem': --param >> max-inline-insns-single limit reached >> /usr/src/sys/boot/i386/gptzfsboot/../zfsboot/zfsboot.c:620: warning: >> called from here > > Ok, the inline is probably not needed for zfsboot since it isn't quite as > space constrained. =A0I will commit it w/o the inline. Thanks for committing this John. Matt
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f383264b0912091248v4a944a08wbef0240a516da36d>