Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4210356imj; Tue, 12 Feb 2019 11:43:11 -0800 (PST) X-Google-Smtp-Source: AHgI3Iaur1tX9Gbh8bXCmZ+NkFC7GJas1kJEvoTpgTI2TOSON2fGyBCxNj2gvOSoJR4I6o8Zkkkt X-Received: by 2002:a62:2a4b:: with SMTP id q72mr5458870pfq.61.1550000591190; Tue, 12 Feb 2019 11:43:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550000591; cv=none; d=google.com; s=arc-20160816; b=KodvU2Qmc3r4+XIhaxz8RZK57m5NSvsYj86FvDe/6cXcGO7trhkICvUEzIJz6YYiEV Nk95VPoJgwFpWLfg0wLmvbVLpIUp5VBK8vSWRPZZW4jm82igH8lV8QqH3dO5RiJ9cJKC 8X3mZSG5OaI7Rk7kA//6JabCFuNvPacV2gASb3TAQ+4adUImbTvNUTUC0W8iKbWdZSYu mx4j1dGcrBe6xD6F/v1icOydzOduvuaEuRpavOQuMV3VFzJhPRNOvchkTlXD0mTO2p0/ bywZUaALbYwksJOaso6g5tpMffMJ2LaPByKCyYMo7YfQQaRm5OLDrOmRNVpLJjuBlSQr +InA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wU07qB9XQlS0d1djNaIi1on+8sJFmtyguN+9hQA20ao=; b=WkwO1aAhWvnEWZObvZZoBLnBmxK/MK5NCpgD7+p0LjpymKxgR4Jejf0jV84KtWCIYK WczqU0NwdbLE1Zr+ZLXO/jM7o9pxElfgHpn6doxUbeVXWHQLzp5K7ggzadPeA7WWeryB 5H67jCKaxsuBIrbT2y2ZRfERx8j4xqYHslpbuLYPcZxpx/caEbsyU1Wry8FxJf6Np4sX KAPBx5ct80w7y9460jg6qO6vm9qovxREjldw6+zHg31TP5DfRHAbE1hnjG5E9jGD5JNL v5GXeK7LSCL4VG3js5UexAjdUHjJn3imq+NE5yz5LPFGncNZjqFAzLzhoILpAa8ASpg0 aGMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="B/AammYD"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n80si3848716pfj.177.2019.02.12.11.42.54; Tue, 12 Feb 2019 11:43:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="B/AammYD"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732034AbfBLSpI (ORCPT + 99 others); Tue, 12 Feb 2019 13:45:08 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:51354 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727303AbfBLSpH (ORCPT ); Tue, 12 Feb 2019 13:45:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wU07qB9XQlS0d1djNaIi1on+8sJFmtyguN+9hQA20ao=; b=B/AammYDfpPF5UfB+jK408ufC KwEHJjkA1tuXXXCP6+xREUOQpdFBMNqA2clb2mk76d+XPRpn9WJLA9+2a3e4w168cagmFyJ7SiRCc KBRclTiT5yENHBp3fP9+wJpMgK5vBIYpFpEq3WaHHZKCIDzaWewIMcziPqbDCv3TRHsSgamkikB0h DB2tV2fLETqDv5EVkKILMACntcQvSYsySvGXaAxt5I7WNVPKHkmKSL5dzLjIKHOdSOK/Xlu++tAcR LUFYN1C5FktDUFwMXI9OdzuznThEq2+U3H/QBS5ycLICEt0fms2pOcMXahNtaFhNOA3q4PBA/t4fs kIxpOjhqw==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gtd3J-0004X1-8H; Tue, 12 Feb 2019 18:45:05 +0000 Date: Tue, 12 Feb 2019 10:45:05 -0800 From: Christoph Hellwig To: Anup Patel Cc: Christoph Hellwig , Palmer Dabbelt , Anup Patel , "linux-kernel@vger.kernel.org" , Atish Patra , Albert Ou , Paul Walmsley , "linux-riscv@lists.infradead.org" Subject: Re: [PATCH v2 6/6] RISC-V: Implement keepinitrd kernel parameter Message-ID: <20190212184505.GA10984@infradead.org> References: <20190119132650.9978-1-anup.patel@wdc.com> <20190119132650.9978-7-anup.patel@wdc.com> <20190212070807.GD26747@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 12, 2019 at 03:53:21PM +0530, Anup Patel wrote: > If it is initramfs (i.e. CPIO image) then contents of CPIO archive > are extracted to create a ramfs instance. > > If it is initrd (i.e. some filesystem image) then RAM block device > is created in-place at initrd location. (Please correct me if I am > wrong about initrd here). No. If it is an initrd image we still copy it into the rootfs first, and then load it into a ram disk. Take a look at init/initramfs.c:populate_rootfs() and init/do_mounts_initrd.c:initrd_load(). > So in case of initrd we might not want to free-up the RAM but > we can certainly free-up in case of initramfs. No, in either case we do not need the original initramfs/initrd memory. I suspect arm has this as a workaround for some weird legacy boot issue, but I can't see any reason why we would not want to free the memory on riscv.