From owner-freebsd-current@FreeBSD.ORG Thu Apr 4 17:22:18 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A3EFF882; Thu, 4 Apr 2013 17:22:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 80660235; Thu, 4 Apr 2013 17:22:18 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CC07CB980; Thu, 4 Apr 2013 13:22:16 -0400 (EDT) From: John Baldwin To: Andriy Gapon Subject: Re: gptzfsboot problem on HP P410i Smart Array Date: Thu, 4 Apr 2013 13:16:12 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201303191220.34088.jhb@freebsd.org> <515DA760.8000101@FreeBSD.org> In-Reply-To: <515DA760.8000101@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201304041316.12617.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 04 Apr 2013 13:22:16 -0400 (EDT) Cc: Bjorn Larsson , freebsd-current@freebsd.org, Sergey Dyatko X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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, 04 Apr 2013 17:22:18 -0000 On Thursday, April 04, 2013 12:16:32 pm Andriy Gapon wrote: > on 19/03/2013 18:20 John Baldwin said the following: > > Yes, we likely could start using that, we would just need to ensure it has some > > sort of minimum size. However, maybe it would always have that minimum size as you > > are only going to have additional ranges if you have more than 4GB of RAM anyway. > > I think though that there were some odd BIOSes that would place a hole at 15-16MB, > > and for those the memory region at 1MB is too small. A minimum size of 16MB might > > handle that case correctly while using the first extended region in the common > > case. > > How about something like this? > > Author: Andriy Gapon > Date: Wed Apr 3 11:48:34 2013 +0300 > > [test] zfsboot: bios_getmem prefer extmem over another random chunk of high memory > > If the extended memory region is sufficiently large. > > diff --git a/sys/boot/i386/zfsboot/zfsboot.c b/sys/boot/i386/zfsboot/zfsboot.c > index 82402b6..12ceeb0 100644 > --- a/sys/boot/i386/zfsboot/zfsboot.c > +++ b/sys/boot/i386/zfsboot/zfsboot.c > @@ -374,6 +374,16 @@ bios_getmem(void) > } > > /* > + * If extended memory is at least twice as large as the largest > + * region of higher memory, then carve the high heap out of > + * extended memory. > + */ > + if (bios_extmem > 2 * high_heap_size) { > + high_heap_base = 0x100000 + bios_extmem / 2; > + high_heap_size = bios_extmem / 2; > + } > + > + /* > * If we have extended memory and did not find a suitable heap > * region in the SMAP, use the last 3MB of 'extended' memory as a > * high heap candidate. > We should really use the same algorithm in boot2 and gptboot as well. I think though that in this case you can just use the last 3MB of heap rather than half of the extended memory as heap. -- John Baldwin