Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4831973imj; Wed, 13 Feb 2019 01:43:44 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib0JY76iaCAsW7ACV5dr+zBf7j18Ag4Y8rJXN30Aut7FAYX4YCW6C5ojGQISkcArrF+JCbF X-Received: by 2002:a17:902:29aa:: with SMTP id h39mr8558325plb.6.1550051023957; Wed, 13 Feb 2019 01:43:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550051023; cv=none; d=google.com; s=arc-20160816; b=FMJ8ceQtqHa+gDVyz1mZQSoYVU5eqqWKtQh9qwiq6GwV8iOgDHcWOQOxYYN/V61eUs XQgqOANNu7/QAtMfF26TD3QuAhDptHNZzMtsuvAygovu+ovSiRzdSWQn+0gHFORhNem5 crXlaUIHT//NNay4EG1IxJ8xr/Frx09Ty66v1jvY8yCjas0iYt3WYcqxl6XoJYSOu/z0 lnEfv14t/xE4a5ybvge69AD7ayGT8CHvhAaH4D0xwzFYbnRmS6CCUgKQtd3Xyg0M8D/E zHKBteEhjuJoyuAFYutZ8Xwr2AdGMITSI5beUA3WWg6EJb937R6e8adA8vmSuuwpRWNN VmEA== 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=PWbL/4SM/FCpa2kpx0HFkhtSLmcFMEfuKZ+eKMOIyw0=; b=UHIJbSXsEkgeGAuB+rSdJ+ouo93ldx4mi2IEecJle7e9qTv07EvqQjMJVmApNMr1eE sZxAHpgkNcr77fKCDdq0w1Kucqu3czcPBRWISRqltG1PaiVTkUTb8YrMVwuEK4Qjd4D0 wrCRssV0B503w09+bSuvcxd1b9Z4SSkLBUXO/kotxkhnPu7Pv4SiTdRGAPA66N43PoHN PSKawAG3OYtFPZ0opqZIcEO/DywjOx2PMEn5gQeaFrvAL+l8i9xCD+6t2kGJIOfDBFtV BMhBFOIkcKcJ81/4Xc9zwxikTZ1/yg61tzcoz0xNc0Eb6m2LrXbR0lL3GXPIBkw0tuXm YfAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Qw7ortlk; 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 t14si994665plr.183.2019.02.13.01.43.27; Wed, 13 Feb 2019 01:43:43 -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=Qw7ortlk; 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 S1733249AbfBMGoX (ORCPT + 99 others); Wed, 13 Feb 2019 01:44:23 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:47240 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727069AbfBMGoX (ORCPT ); Wed, 13 Feb 2019 01:44:23 -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=PWbL/4SM/FCpa2kpx0HFkhtSLmcFMEfuKZ+eKMOIyw0=; b=Qw7ortlk+26yXlOSEFiN8o6oG ptj2G6yzSeaWW5H3csqikFRZ61vK5L0ddsPgErQvuyuouQZnUsCdeMt6SIchawf057qU/7QaqyfEh SRURhFe5DuVSukM3WnIc9cxyFieTNrD0CZ4tQ2lFquq3HoW2arPazu+L/1MKKkJwcWq7uwhPQlTjv uNOgtN/PsvkUP3L5vi/RX8hfOhwuas0uYuIkzdi5xScXdJqFUvl2V9mkRwYNSJDDhXQtC9Zw98FSd QhkQZDvjHw0HGRo424isfSUN6lhIS+hpdeFZKY5FgMemuoEAGVf2xv1xiXynGKBhB4WCJWrzumBro bq5XBnhzw==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gtoHL-0001uh-Ak; Wed, 13 Feb 2019 06:44:19 +0000 Date: Tue, 12 Feb 2019 22:44:19 -0800 From: Christoph Hellwig To: Anup Patel Cc: Palmer Dabbelt , Albert Ou , Atish Patra , Paul Walmsley , Christoph Hellwig , Mike Rapoport , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v4 6/6] RISC-V: Free-up initrd in free_initrd_mem() Message-ID: <20190213064419.GA27012@infradead.org> References: <20190213063127.28703-1-anup.patel@wdc.com> <20190213063127.28703-7-anup.patel@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190213063127.28703-7-anup.patel@wdc.com> 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 Wed, Feb 13, 2019 at 06:32:24AM +0000, Anup Patel wrote: > index 9cd583b6d1cd..c22b873de856 100644 > --- a/arch/riscv/kernel/setup.c > +++ b/arch/riscv/kernel/setup.c > @@ -97,8 +97,9 @@ static void __init setup_initrd(void) > initrd_end = 0; > } > > -void free_initrd_mem(unsigned long start, unsigned long end) > +void __init free_initrd_mem(unsigned long start, unsigned long end) > { > + memblock_free(__pa(start), end - start); I'm pretty sure this should be a call to free_reserved_area instead. All regions reserved using memblock_reserved and not freed before initializing the MM are marked reserved and don't have valid page counts, etc. So we need the actions in free_reserved_area to actually make the memory useful. Now every other architecture except for arm64 seems to do fine without a memblock_free. I'm not an expert on memblock (but I've CCed one), but I guess the reason is that once the kernel has booted we don't really care about freeing memblock area.