Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932320AbVKUPF0 (ORCPT ); Mon, 21 Nov 2005 10:05:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932319AbVKUPF0 (ORCPT ); Mon, 21 Nov 2005 10:05:26 -0500 Received: from dsl092-053-140.phl1.dsl.speakeasy.net ([66.92.53.140]:57488 "EHLO grelber.thyrsus.com") by vger.kernel.org with ESMTP id S932320AbVKUPFZ (ORCPT ); Mon, 21 Nov 2005 10:05:25 -0500 From: Rob Landley Organization: Boundaries Unlimited To: Marcelo Tosatti Subject: Re: [PATCH] skip initramfs check Date: Mon, 21 Nov 2005 09:04:46 -0600 User-Agent: KMail/1.8 Cc: akpm@osdl.org, linux-kernel@vger.kernel.org, Matt Mackall , Al Viro References: <20051117141432.GD9753@logos.cnet> <200511210130.55774.rob@landley.net> <20051121062350.GA24381@logos.cnet> In-Reply-To: <20051121062350.GA24381@logos.cnet> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511210904.46495.rob@landley.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1796 Lines: 41 On Monday 21 November 2005 00:23, Marcelo Tosatti wrote: > Hi Rob, > > Query: is the problem that a big initramfs image is being unpacked more > > than once, or is unpacking an empty initramfs image (134 bytes) causing a > > significant delay? > > The problem is a big non-initramfs RAMDISK image (used for root mountpoint > on this particular embedded platform), that is decompressed more than once: > > - during the initramfs check, which fails because it is not initramfs. > - during the real RAMDISK decompression to memory. > > > I'm fairly certain that back in 1990 I could unzip 134 bytes on my 33 mhz > > 386 running dos in a fraction of a second. What's the use case here? > > So the issue is not the empty initramfs image (which BTW could probably > be made unecessary?), but a 10Mb RAMDISK image being decompressed by a > 48Mhz PPC, which takes quite a few seconds. > > Need to rework the patch to use a __setup option as Andrew suggested. It sounds to me like is the initial check (which is just giving a thumbs up/thumbs down "is this an initramfs", correct?) only needs to decompress the first page or so of data to make this determination. A quick glance at the code seems to imply it's just checking the header and the first entry, so 4k should be plenty for that. Some variant of lib/zlib_inflate... Ouch, bit of a mess there. Hey Matt: you know this area. Is it feasible to do some kind of: deflate_init(whatever) deflate_next_x_bytes(source *, dest *, length) To grab a the first X bytes from the initramfs image? Rob - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/