Date: Mon, 7 Dec 2009 16:01:03 -0800 From: Matt Reimer <mattjreimer@gmail.com> To: freebsd-fs <freebsd-fs@freebsd.org> Subject: PATCH: increase heap size for (gpt)zfsboot Message-ID: <f383264b0912071601p3bfab229rd1b282b80db2aff6@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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
[-- Attachment #2 --]
--- /sys/boot/i386/zfsboot/zfsboot.c.ORIG 2009-12-07 10:32:22.000000000 -0800
+++ /sys/boot/i386/zfsboot/zfsboot.c 2009-12-07 12:48:05.000000000 -0800
@@ -241,8 +241,8 @@
static char *heap_end;
if (!heap_next) {
- heap_next = (char *) dmadat + sizeof(*dmadat);
- heap_end = (char *) (640*1024);
+ heap_next = (char *) (16 * 1024 * 1024);
+ heap_end = (char *) (64 * 1024 * 1024);
}
char *p = heap_next;
--- /sys/boot/zfs/zfsimpl.c.ORIG 2009-11-21 07:02:35.000000000 -0800
+++ /sys/boot/zfs/zfsimpl.c 2009-12-07 12:54:44.000000000 -0800
@@ -51,7 +51,7 @@
static char *zap_scratch;
static char *zfs_temp_buf, *zfs_temp_end, *zfs_temp_ptr;
-#define TEMP_SIZE (1*SPA_MAXBLOCKSIZE)
+#define TEMP_SIZE (1024 * 1024)
static int zio_read(spa_t *spa, const blkptr_t *bp, void *buf);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f383264b0912071601p3bfab229rd1b282b80db2aff6>
