From patchwork Fri Nov 21 03:46:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 41275 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CF9E525AEA for ; Fri, 21 Nov 2014 03:47:29 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id l18sf2448487wgh.10 for ; Thu, 20 Nov 2014 19:47:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=Ztqq0zCotIzKens/3IEyICseg86bq0GxpH7vT8bZtug=; b=eQ4lRmJCVV8QbhtJMC9C5gfz0LkxLCoMAgTSfjrosW+LX08lXz7A7sLxTFosiSZHM8 qL2Z8xGSUAYTc8GLNufm+GS8qXO4fNOY9uO+yjZbPJwp8gJ72Ijwgu/HYZwLtzrYQMbF IMqwPXthKd4YJREwuito6jW6m8/18iutzHM3opKRawWrVw2cbaDLi1SffpsRAgjQGPx/ mRGOMPrOb2/SXdTDMGidpr53G8VAVdPokHrsF3PKPenDUxqA/2Mpjoss7KhZJJUWXTks NSxbpuTDIP7RCtsi5Ibtp6r3TP09yedTlnMlpw9IUZD8yu/fJKfWdQpOrXaDhZphok82 Fc1w== X-Gm-Message-State: ALoCoQmSVMe/d4ipCGgwGherXhuZcuAmKomMM9SmXznSamE11TsMwOrxXuxebwTMcZ6At+4amj1n X-Received: by 10.181.13.147 with SMTP id ey19mr8562507wid.2.1416541649117; Thu, 20 Nov 2014 19:47:29 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.169 with SMTP id c9ls124363laa.104.gmail; Thu, 20 Nov 2014 19:47:28 -0800 (PST) X-Received: by 10.112.167.130 with SMTP id zo2mr1761125lbb.4.1416541648433; Thu, 20 Nov 2014 19:47:28 -0800 (PST) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id p10si3666945lap.125.2014.11.20.19.47.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Nov 2014 19:47:28 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by mail-la0-f52.google.com with SMTP id q1so3490434lam.25 for ; Thu, 20 Nov 2014 19:47:28 -0800 (PST) X-Received: by 10.112.52.37 with SMTP id q5mr1714711lbo.32.1416541647889; Thu, 20 Nov 2014 19:47:27 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp10517lbc; Thu, 20 Nov 2014 19:47:27 -0800 (PST) X-Received: by 10.66.157.161 with SMTP id wn1mr3113111pab.40.1416541646282; Thu, 20 Nov 2014 19:47:26 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9si6203083pdp.52.2014.11.20.19.47.25 for ; Thu, 20 Nov 2014 19:47:26 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757742AbaKUDrY (ORCPT + 26 others); Thu, 20 Nov 2014 22:47:24 -0500 Received: from szxga01-in.huawei.com ([119.145.14.64]:55663 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751368AbaKUDrW (ORCPT ); Thu, 20 Nov 2014 22:47:22 -0500 Received: from 172.24.2.119 (EHLO szxeml407-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CET75558; Fri, 21 Nov 2014 11:46:56 +0800 (CST) Received: from [127.0.0.1] (10.177.27.142) by szxeml407-hub.china.huawei.com (10.82.67.94) with Microsoft SMTP Server id 14.3.158.1; Fri, 21 Nov 2014 11:46:44 +0800 Message-ID: <546EB5A2.5050604@huawei.com> Date: Fri, 21 Nov 2014 11:46:42 +0800 From: leizhen User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Andrew Morton , Geert Uytterhoeven , Josh Triplett , Peter Zijlstra , Paul Gortmaker , "Paul E. McKenney" , Linus Torvalds , linux-kernel CC: Zefan Li , Xinwei Hu , Zhen Lei Subject: Fwd: [PATCH 1/1] init:add boot option "initramfs_packnum" References: <1415670134-8016-1-git-send-email-thunder.leizhen@huawei.com> In-Reply-To: <1415670134-8016-1-git-send-email-thunder.leizhen@huawei.com> X-Forwarded-Message-Id: <1415670134-8016-1-git-send-email-thunder.leizhen@huawei.com> X-Originating-IP: [10.177.27.142] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: thunder.leizhen@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Hi erverbody! What about your opinion? I run "scripts/get_maintainer.pl -f init/", but it displays no maintainer. So this time, I added all people the result listed and added famous Linus Torvalds. This patch is useful and no harmful. -------- Original Message -------- Subject: [PATCH 1/1] init:add boot option "initramfs_packnum" Date: Tue, 11 Nov 2014 09:42:14 +0800 From: Zhen Lei To: Andrew Morton , Yinghai Lu , Mark Rustad , linux-kernel CC: Zefan Li , Xinwei Hu , Zhen Lei During the development phase, we usually enlarge initrd-end to reserve more memory than the initfs zip exactly occupied. Then we can easily add or delete files in zip package, without generate fdt again and again. But unfortunately, if too many zeros followed initfs zip, it will take a long time to break the loop. while (!message && len) { ... ... if (!*buf) { buf++; ... ... continue; } So, use the boot option "initramfs_packnum" to specify how many zip packages in each initrd area. When the specified number of packages decompressed in one area, immediately terminate the loop. Have no impact on current use by default. Signed-off-by: Zhen Lei --- init/initramfs.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) -- 1.8.0 . -- 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/ diff --git a/init/initramfs.c b/init/initramfs.c index ad1bd77..356764f 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -446,12 +446,24 @@ static unsigned long my_inptr; /* index of next byte to be processed in inbuf */ #include +/* zero and negative means packages number is unlimited */ +static int initramfs_packnum __initdata; + +static __init int setup_initramfs_packnum(char *str) +{ + get_option(&str, &initramfs_packnum); + + return 0; +} +early_param("initramfs_packnum", setup_initramfs_packnum); + static char * __init unpack_to_rootfs(char *buf, unsigned long len) { long written; decompress_fn decompress; const char *compress_name; static __initdata char msg_buf[64]; + int packnum = initramfs_packnum; header_buf = kmalloc(110, GFP_KERNEL); symlink_buf = kmalloc(PATH_MAX + N_ALIGN(PATH_MAX) + 1, GFP_KERNEL); @@ -500,6 +512,9 @@ static char * __init unpack_to_rootfs(char *buf, unsigned long len) this_header = saved_offset + my_inptr; buf += my_inptr; len -= my_inptr; + + if (!(--packnum)) + break; } dir_utime(); kfree(name_buf);