From patchwork Wed Jan 27 04:17:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seung-Woo Kim X-Patchwork-Id: 12048853 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=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 9F80BC433DB for ; Wed, 27 Jan 2021 04:16:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 63B9A20709 for ; Wed, 27 Jan 2021 04:16:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 63B9A20709 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:MIME-Version:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Owner; bh=HIRCRqjKr0zQMCXBw9c9SZVA65ilP2wxtBfxihr/kOY=; b=YlwEu+ZfMd35aZ89zl8/gtwWK ZM4/lHMYGpi0TxupqqCWPZuQ8GDWbIY3Cj36awwrJ7FcPk0/OvzwRrPU85b554i+bQELfEcKpFEeZ 4scv/J7HznAMXqppxqsWFZBq1WwozNpLAMWk2E5htihMrQyepzZWjtdSLJ3tynj8sMXmI8LW6YEnf CwM6L90gsR1QF0Z5JFOEqhGNcKsdC1oVxB9HiDyETnm7u8hI8ArZiY2brSlc/z/2K3gc6xVH2/1zv MKdC5yiXW8wHL1t4p5V8803UJ8xgKK/NqavhtHFuWQOuSG0UTbFJF4KZv2NfNBk8bQaIDhwZf98dj n5QEV/Uww==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4cEt-0000wy-FP; Wed, 27 Jan 2021 04:15:31 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4cEq-0000wA-Hd for linux-arm-kernel@lists.infradead.org; Wed, 27 Jan 2021 04:15:30 +0000 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20210127041524epoutp025f05c1ab5e686d8c0015c1fe3bbf17c1~d_6QjX2CP0969509695epoutp02T for ; Wed, 27 Jan 2021 04:15:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20210127041524epoutp025f05c1ab5e686d8c0015c1fe3bbf17c1~d_6QjX2CP0969509695epoutp02T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1611720924; bh=Y8aJiRSGEeDMH8i++If4hXnSlgw4orlR0qNeQcGyICQ=; h=From:To:Cc:Subject:Date:References:From; b=fADqJqwlg393v/7ZARLKKdQEelaReOjTtcWNETV+edsNHJfL6n0jvbSN37ZmjhjUi AlGRM+19BvtxRpEAcY3te+PAUgd4XMLpZSZLp2bN2kDQbH1HBVz5nhCQZblufoNN4D 3ymv49ZJBGPlCYF0PWpHrHXMeDhM9OupmkJVc71s= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20210127041523epcas1p278a99e2c8459babca51ff030c8161af1~d_6P-GXFN2594925949epcas1p2y; Wed, 27 Jan 2021 04:15:23 +0000 (GMT) Received: from epsmges1p4.samsung.com (unknown [182.195.40.153]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4DQVd36btLz4x9Q2; Wed, 27 Jan 2021 04:15:19 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id CE.4B.10463.1D8E0106; Wed, 27 Jan 2021 13:15:13 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20210127041512epcas1p1306df0339fd2ffffec43cca6b0475a88~d_6GQFpXH1093210932epcas1p15; Wed, 27 Jan 2021 04:15:12 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210127041512epsmtrp1c121d3106369e40dc269d52f63859e0f~d_6GPQ9BX2187921879epsmtrp1U; Wed, 27 Jan 2021 04:15:12 +0000 (GMT) X-AuditID: b6c32a38-efbff700000028df-50-6010e8d17275 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id E6.30.08745.0D8E0106; Wed, 27 Jan 2021 13:15:12 +0900 (KST) Received: from localhost.localdomain (unknown [10.113.221.223]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210127041512epsmtip25dcfa6d973d293dff38fe1bed9c0afb9~d_6GABNT-0653506535epsmtip2U; Wed, 27 Jan 2021 04:15:12 +0000 (GMT) From: Seung-Woo Kim To: linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org Subject: [RESEND][PATCH] ARM: mm: Free memblock from free_initrd_mem() Date: Wed, 27 Jan 2021 13:17:26 +0900 Message-Id: <20210127041727.11001-1-sw0312.kim@samsung.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFJsWRmVeSWpSXmKPExsWy7bCmge7FFwIJBrtPKFjMWb+GzeLnl/eM Ft8eLmS0uPGrjdVi0+NrrBaXd81hszg0dS+jxanrn9ksjqzfzmQxY/JLNgcuj8vXLjJ77Jx1 l91j06pONo8TM36zeGxeUu9x5UQTq0ffllWMHp83yQVwRGXbZKQmpqQWKaTmJeenZOal2yp5 B8c7x5uaGRjqGlpamCsp5CXmptoqufgE6Lpl5gDdqKRQlphTChQKSCwuVtK3synKLy1JVcjI Ly6xVUotSMkpsCzQK07MLS7NS9dLzs+1MjQwMDIFKkzIzjjblVJwjL3i5/YelgbGDWxdjJwc EgImEo1NM5hAbCGBHYwSVz/wdjFyAdmfGCWmTn7EDuF8ZpR4cfkPO0xH/4ZTTBCJXYwSB47P YINo/8Io8aaRH8RmE9CR2L/kNyuILSJgL3Ht8SxmkAZmga2MEi3t/8ESwgJuErePrwFrZhFQ lTi86jPQVA4OXgFriaOXtCCWyUtc2HALrJxXQFDi5MwnLCA2M1C8eetssJkSAn/ZJb42nmaG aHCR2P5oCxOELSzx6vgWqKulJF72t0HZ1RLbJ/xkh2juYJToaW9kgUgYS+xfOhnsCGYBTYn1 u/QhwooSO3/PZYRYzCfx7msPK0iJhACvREebEESJisTOo5PYIMJSErM2BEOEPST+PloCDd1Y iaUdi1kmMMrPQvLNLCTfzELYu4CReRWjWGpBcW56arFhgQlylG5iBCdSLYsdjHPfftA7xMjE wXiIUYKDWUmE972yQIIQb0piZVVqUX58UWlOavEhRlNg8E5klhJNzgem8rySeENTI2NjYwsT QzNTQ0Mlcd4kgwf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tDGhXcXWZ/3b8oaDm66Er9vRv2Xpt7abZmISqbMr1Q7vazn8a1PYh7uvrCem sQhO/7JC11P/TmyqX4m7t6tI2ZqyVcs/TbfoffpnA89Dj0dTbir9z+N582/G6YPCx5LXuYSE i0e+yN4elM93UnGK4+frCSteLVH9ljTNJf9VUp3GHrdZGcvyHugKb7U+L7ujlVHcn3PCq/Wd s9YpWbGHxegHNWVevRizi+H16i1ynfpvV0wKs71naaB8woBD9+TrXS+djJVu/a8NuafZqcRS nJFoqMVcVJwIAGsLr4vdAgAA X-CMS-MailID: 20210127041512epcas1p1306df0339fd2ffffec43cca6b0475a88 X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210127041512epcas1p1306df0339fd2ffffec43cca6b0475a88 References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210126_231529_146043_6A61E630 X-CRM114-Status: GOOD ( 14.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sw0312.kim@samsung.com, linux-kernel@vger.kernel.org, jh80.chung@samsung.com, jcmvbkbc@gmail.com, olof@lixom.net, akpm@linux-foundation.org, ardb@kernel.org, rppt@kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Even after free_initrd_mem(), memblock for initrd remains. Free memblock for initrd from free_initrd_mem() line generic function. Reported-by: Jaehoon Chung Signed-off-by: Seung-Woo Kim --- arch/arm/mm/init.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 828a256..f7db023 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -530,6 +530,13 @@ void free_initmem(void) #ifdef CONFIG_BLK_DEV_INITRD void free_initrd_mem(unsigned long start, unsigned long end) { +#ifdef CONFIG_ARCH_KEEP_MEMBLOCK + unsigned long aligned_start = ALIGN_DOWN(start, PAGE_SIZE); + unsigned long aligned_end = ALIGN(end, PAGE_SIZE); + + memblock_free(__pa(aligned_start), aligned_end - aligned_start); +#endif + if (start == initrd_start) start = round_down(start, PAGE_SIZE); if (end == initrd_end)