Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4853550imj; Wed, 13 Feb 2019 02:09:44 -0800 (PST) X-Google-Smtp-Source: AHgI3IbsQvs6/SCG3SavTDlfWG/AVfF0bfgzLCN/Q4uaI3dcLH+t0hsueXXwurjOq2ErdFIZD01m X-Received: by 2002:a17:902:bb89:: with SMTP id m9mr8901734pls.320.1550052584400; Wed, 13 Feb 2019 02:09:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550052584; cv=none; d=google.com; s=arc-20160816; b=b6LP1PNP3bio9L3LbUB2c3tiBf2KGqaygEhrS6VbUw5Mo3Dthws02Frbt2irpOOkeo u7NOX4faXeRoGqRl8+17gyXgUqV9ggPHprC6DCgYxlIAkmaWt/TjGDeWUoaTpwIq1+tQ gRbPLhl7Qg6xRrx3CXPzybqZo3Ixm2EjXkc2pX/1+Igp4oxT6jLdr+6sc7mgQ4cq67oH wA1VFss7BptTAiHQlUtdc47YmNOQfneMQK28DUvaOWTXMl1CMytOCgGe6tkhKcg9T/5y LsVq6dnMoN3e0ELPHxH2KY+iJEikO4O7nJI4CIwQH3qyFV39TLoQAUUpfL1zduG9cDVR Qw0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date; bh=9QQLUXydG/gzKOPUyehDHD8Cnv123Ia7bZzT7MZwIaM=; b=Gl3UD6tjDMsfQqO169Iy8iv02PVd87OQjJX652QNV4Ni7cQk8j+WE/YrHz+BsJs2Pi Jx8kmCCsPa5SXxiJ85GJ3Bt5ik1/ucX2JkaP206arbZruilF8GmgDl6q/4a3CCT0Z+/D jK4eQliQxCMEb93iZ8twwXETqOE+SMaxRg5LK176eGeZYd6MYmcBgbeoSgDLR184O1VK qt0Spck6fGdnRYJ8ajL8siBqKRBV8nU//NT+vlMGV7ZqXFrq4ZQnNyG35+TqWac4BbrL ZU+OjHHVWf86H4WfUcf+oEMt0Mb36/L4vKn2qi9J2DSGSDMHWFF+RWHbwHHgIuAT3lq4 +ezg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 13si15679160pld.398.2019.02.13.02.09.28; Wed, 13 Feb 2019 02:09:44 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388395AbfBMHir (ORCPT + 99 others); Wed, 13 Feb 2019 02:38:47 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:60006 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729502AbfBMHir (ORCPT ); Wed, 13 Feb 2019 02:38:47 -0500 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1D7Tbnu070216 for ; Wed, 13 Feb 2019 02:38:45 -0500 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2qmed7hev3-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 13 Feb 2019 02:38:45 -0500 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Feb 2019 07:38:42 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 13 Feb 2019 07:38:39 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x1D7ccIZ63832314 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 13 Feb 2019 07:38:38 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C35E352054; Wed, 13 Feb 2019 07:38:38 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.59.186]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id 1C5E452052; Wed, 13 Feb 2019 07:38:38 +0000 (GMT) Date: Wed, 13 Feb 2019 09:38:36 +0200 From: Mike Rapoport To: Christoph Hellwig Cc: Anup Patel , Palmer Dabbelt , Albert Ou , Atish Patra , Paul Walmsley , "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() References: <20190213063127.28703-1-anup.patel@wdc.com> <20190213063127.28703-7-anup.patel@wdc.com> <20190213064419.GA27012@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190213064419.GA27012@infradead.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 19021307-0016-0000-0000-00000255D897 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19021307-0017-0000-0000-000032AFFDEB Message-Id: <20190213073835.GA18267@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-13_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=811 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902130056 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Feb 12, 2019 at 10:44:19PM -0800, Christoph Hellwig wrote: > 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. This late in the boot process there should be a call to free_reserved_area() to give pages to the buddy allocator. memblock_free() is has no real effect at this point, no idea why arm64 calls it. -- Sincerely yours, Mike.