From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60AE3C282C2 for ; Wed, 13 Feb 2019 07:38:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3AD1A222BE for ; Wed, 13 Feb 2019 07:38:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388420AbfBMHir (ORCPT ); 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.