From owner-freebsd-ia64 Tue Feb 25 16: 9:31 2003 Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB20E37B401 for ; Tue, 25 Feb 2003 16:09:29 -0800 (PST) Received: from caduceus.sc.intel.com (fmr04.intel.com [143.183.121.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3499643FB1 for ; Tue, 25 Feb 2003 16:09:29 -0800 (PST) (envelope-from adsharma@unix-os.sc.intel.com) Received: from talaria.sc.intel.com (talaria.sc.intel.com [10.3.253.5]) by caduceus.sc.intel.com (8.11.6/8.11.6/d: outer.mc,v 1.51 2002/09/23 20:43:23 dmccart Exp $) with ESMTP id h1Q08RR17562; Wed, 26 Feb 2003 00:08:27 GMT Received: from unix-os.sc.intel.com (unix-os.sc.intel.com [143.183.96.244]) by talaria.sc.intel.com (8.11.6/8.11.6/d: inner.mc,v 1.28 2003/01/13 19:44:39 dmccart Exp $) with ESMTP id h1Q05Di11209; Wed, 26 Feb 2003 00:05:13 GMT Received: from unix-os.sc.intel.com.intel.com (adsharma-mobl3.sc.intel.com [143.183.130.56]) by unix-os.sc.intel.com (8.11.6/8.11.2) with ESMTP id h1Q09Rr30243; Tue, 25 Feb 2003 16:09:27 -0800 To: Marcel Moolenaar Cc: freebsd-ia64@FreeBSD.ORG Subject: Re: Slow loading of the kernel from efifs ? References: <200302251946.h1PJktr26424@unix-os.sc.intel.com> <20030225213120.GA49775@ns1.xcllnt.net> From: Arun Sharma Date: 25 Feb 2003 16:09:25 -0800 In-Reply-To: <20030225213120.GA49775@ns1.xcllnt.net> Message-ID: Lines: 42 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Marcel Moolenaar writes: > There may be some low-hanging fruit or even some genuine bugs that > may improve this without much work, but I haven't looked at it. Low hanging fruits first. The attached patch reduced the time required to load the kernel from about 65s to 3s on the Tiger4. -Arun --- sys/boot/efi/libefi/efifs.c- Tue Feb 25 22:57:45 2003 +++ sys/boot/efi/libefi/efifs.c Tue Feb 25 22:58:53 2003 @@ -112,6 +112,8 @@ return 0; } +#define EFI_BLOCK_SIZE (1024 * 1024) + static int efifs_read(struct open_file *f, void *buf, size_t size, size_t *resid) { @@ -123,8 +125,8 @@ bufp = buf; while (size > 0) { sz = size; - if (sz > 8192) - sz = 8192; + if (sz > EFI_BLOCK_SIZE) + sz = EFI_BLOCK_SIZE; status = file->Read(file, &sz, bufp); twiddle(); if (EFI_ERROR(status)) @@ -150,8 +152,8 @@ bufp = buf; while (size > 0) { sz = size; - if (sz > 8192) - sz = 8192; + if (sz > EFI_BLOCK_SIZE) + sz = EFI_BLOCK_SIZE; status = file->Write(file, &sz, bufp); twiddle(); if (EFI_ERROR(status)) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message