From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LgIMd-0000VP-1A for mharc-grub-devel@gnu.org; Sun, 08 Mar 2009 08:44:19 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LgIMa-0000UN-Mk for grub-devel@gnu.org; Sun, 08 Mar 2009 08:44:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LgIMY-0000Sz-Js for grub-devel@gnu.org; Sun, 08 Mar 2009 08:44:15 -0400 Received: from [199.232.76.173] (port=60271 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LgIMY-0000Ss-E3 for grub-devel@gnu.org; Sun, 08 Mar 2009 08:44:14 -0400 Received: from aybabtu.com ([69.60.117.155]:33811) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LgIMX-0007MP-M1 for grub-devel@gnu.org; Sun, 08 Mar 2009 08:44:14 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1LgIEW-0004Jd-Tp for grub-devel@gnu.org; Sun, 08 Mar 2009 13:35:59 +0100 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1LgIMJ-0007U4-JC for grub-devel@gnu.org; Sun, 08 Mar 2009 13:43:59 +0100 Date: Sun, 8 Mar 2009 13:43:59 +0100 From: Robert Millan To: The development of GRUB 2 Message-ID: <20090308124359.GA28707@thorin> References: <49B2FB1A.9040208@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49B2FB1A.9040208@gmail.com> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] dynamic cache allocation X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2009 12:44:17 -0000 On Sat, Mar 07, 2009 at 11:54:18PM +0100, phcoder wrote: > + grub_disk_cache_table = (struct grub_disk_cache *) > + grub_malloc (grub_disk_cache_num * sizeof (struct grub_disk_cache)); > [...] > + By default use up to one quarter of memory available for allocation */ > +#define GRUB_DISK_CACHE_DIVIDE 16536 I might be missing something, but I think this implies our cache will stop working if the memory map doesn't include a contigous block that is as big as one quarter of total memory. I think we should be more conservative and define an upper bound for how big our cache is supposed to be in a normal use case. In most cases, we'll have as much memory available as we need for this purpose, and it's only a few situations (i.e. machines with very low memory) that might be a problem. Thoughts? -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."