Received: by 10.213.65.68 with SMTP id h4csp226375imn; Thu, 5 Apr 2018 22:08:45 -0700 (PDT) X-Google-Smtp-Source: AIpwx49oNgxwF5bNpVD1NhsJCGShwZm9Iqzrj6Arvc1I/YjYXO9etrYJuxsyGqujNuElbhNoNCfZ X-Received: by 10.98.133.139 with SMTP id m11mr19245035pfk.49.1522991325124; Thu, 05 Apr 2018 22:08:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522991325; cv=none; d=google.com; s=arc-20160816; b=oliju0/6CoEhWRXIdGzZ93vaHbSffzJE1gskLzg5vvde46A5WiM0j8b/btcWshsNFw IkM1MkcTANkXz/QkakoxjStJTD62fMBvFy2xUzxLAdZAfanRCAECxkAc08b/2SodAuOU u3bKAW2QmWhGPZlWI/hrDdK62cqHyH4QpzJ9RhAP1EaH7XZI6uPYL0X2jbRvwjHyQsGS OBDS/17bQ1A9mXVCanWQw02E5drpPySGbVlQ1Ite2WhxMEHU5di64UEXu9HlGrQbwM8N +BxjajSa40cHtovU1VXrJ+l/x6kM1ICGLj16FH0vE/yy7X7g5aolRC/ZovrADAd/KmT2 s9sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=JPN7pQ/KtRQuQOi+oKutHaUhHF7+dN8gFtzuVFHDexo=; b=C0Y/ZXZAtxgfFgA0NmM/7R286I33PfnwjrOyHwV2Y4ToWBFSCb9O4mYt5E/ivdQo3m RKCg7Xb85ZKRCuvILRF/gHcYkRJoSkYz9ac4BFv3LJL7rF3a/zg0dHguh7jKXSwVY/kS LDLr0BFnYEZwPGbNQOaD4mAAEF7wgNoxxXm4z0jfSXfyc0dVXfPzOvExOeWkmt9f5JTF iPg9Q8t+SAswafyogDPsUD/ArlxLLzqSyOB7+E6G+z6yvHWvUnmvEjE5XgfHm4nq90QP HyLiTvwexCdfemJt0eT4icoMGMZEOVsXN/itOd9yG7pUCKYbRB/4yCR38JJeB9L2tCVH T+YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=fvRZn4O8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w19-v6si7365308plq.250.2018.04.05.22.08.31; Thu, 05 Apr 2018 22:08:45 -0700 (PDT) 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=pass header.i=@samsung.com header.s=mail20170921 header.b=fvRZn4O8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752745AbeDFExp (ORCPT + 99 others); Fri, 6 Apr 2018 00:53:45 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:53689 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751935AbeDFExn (ORCPT ); Fri, 6 Apr 2018 00:53:43 -0400 Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20180406045341epoutp0472792626a80c08a6a55889d52a9a15b8~iv7gX7lPi0479504795epoutp04d; Fri, 6 Apr 2018 04:53:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20180406045341epoutp0472792626a80c08a6a55889d52a9a15b8~iv7gX7lPi0479504795epoutp04d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1522990421; bh=JPN7pQ/KtRQuQOi+oKutHaUhHF7+dN8gFtzuVFHDexo=; h=From:To:Cc:Subject:Date:References:From; b=fvRZn4O8b2biyzyihShYh9NqZhz/JBm1cyiPgy9p48+Lhly7khVk5iZKQE6K3Eb85 D+0l+ePo0+HKOZA8NRmZxp9m333YD9n8Rpq3j8x7o+ertcfmFFczwnDTgWYp+BL7YL tMrXwP572C2JxmzKAAObpoBgzITB1ZPqGs6095fc= Received: from epsmges1p1.samsung.com (unknown [182.195.40.75]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20180406045340epcas5p1f74c8de12119e344349caeeb558f47b0~iv7fqWlUr2348623486epcas5p1p; Fri, 6 Apr 2018 04:53:40 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 00.F4.04078.45DF6CA5; Fri, 6 Apr 2018 13:53:40 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20180406045340epcas1p1ae6416dc25823212303c9109d125c018~iv7fcch5i0407704077epcas1p1m; Fri, 6 Apr 2018 04:53:40 +0000 (GMT) X-AuditID: b6c32a35-139ff70000000fee-7f-5ac6fd5486fe Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 70.C5.03849.45DF6CA5; Fri, 6 Apr 2018 13:53:40 +0900 (KST) Received: from chandan.sisodomain.com ([107.109.106.209]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P6Q0074EYWPTQ80@mmp2.samsung.com>; Fri, 06 Apr 2018 13:53:40 +0900 (KST) From: CHANDAN VN To: catalin.marinas@arm.com, will.deacon@arm.com, takahiro.akashi@linaro.org, james.morse@arm.com, robin.murphy@arm.com, labbott@redhat.com, steve.capper@arm.com, kristina.martsenko@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: cpgs@samsung.com, chandan.vn@samsung.com, vn.chandan@gmail.com Subject: [PATCH 1/1] arm64: To remove initrd reserved area entry from memblock Date: Fri, 06 Apr 2018 10:23:10 +0530 Message-id: <1522990390-30804-1-git-send-email-chandan.vn@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPKsWRmVeSWpSXmKPExsWy7bCmgW7I32NRBtP/q1i8X9bDaDHhS4TF y0OaFvf3LWeyuH+8jdVi5Z4fTBabHl9jtbi8aw6bxcEPT1gtJr3ZxmTxZ/9PFovXty+wW7z8 eILFgddjzbw1jB47Z91l97hzbQ+bx+Yl9R7v911l8+jbsorR4/MmuQD2qFSbjNTElNQihdS8 5PyUzLx0WyXv4HjneFMzA0NdQ0sLcyWFvMTcVFslF58AXbfMHKBblRTKEnNKgUIBicXFSvp2 NkX5pSWpChn5xSW2StGGhkZ6hgbmekZGRnomprFWRqZAJQmpGTfPL2ApuMpe8fbpGtYGxtVs XYycHBICJhK9i+cydjFycQgJ7GCU6Hn8nAnC+c4osf33NkaYqlN/97FDJDYwSmxY/5YZJCEk 8JtRYvF1JxCbTUBT4sS8aWBFIgLtTBJXj3cCjeLgYBZwkrh+3R/EFBYIkDj0NBmknEVAVWJv 61sWEJtXwE3i9NynUBfJSZw8NpkVZIyEwAo2ieVb5kEd4SLx6+AXqCJhiVfHt7CDzJQQkJa4 dNQWIlwvsf7yZRaI3g5GiZ9Nl6Hq7SVmLN4KdjOzAJ/Eu689rBC9vBIdbUIQJR4SvcefMkHY jhJbNlxkgXgxVmJ75z6WCYySCxgZVjGKpRYU56anFhsWGOoVJ+YWl+al6yXn525iBCceLdMd jFPO+RxiFOBgVOLhzYg4FiXEmlhWXJl7iFGCg1lJhHf3H6AQb0piZVVqUX58UWlOavEhRlNg cExklhJNzgcmxbySeEMTSwMTMyNjEwtDM0Mlcd6AAJcoIYH0xJLU7NTUgtQimD4mDk6pBsYe NdMKzoMVM86EvV9yhVnLrfbfORsL/sg9xc5yjHxb7z17vHPiziIf+zMVXwqa00u5dFddbqnO YuSR9UqQdeVviQrcbbfDReHD2+WCzZ+3HJA9s7Fqg9C846eTZvEarbza7+LHUjYtlEPwJ+/H BaJnv67czGT8jz9+6q1Zxr8W3PB/MfVMd40SS3FGoqEWc1FxIgCqBQHoUgMAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprJLMWRmVeSWpSXmKPExsVy+t9jQd2Qv8eiDJZ/F7J4v6yH0WLClwiL l4c0Le7vW85kcf94G6vFyj0/mCw2Pb7GanF51xw2i4MfnrBaTHqzjcniz/6fLBavb19gt3j5 8QSLA6/HmnlrGD12zrrL7nHn2h42j81L6j3e77vK5tG3ZRWjx+dNcgHsUVw2Kak5mWWpRfp2 CVwZN88vYCm4yl7x9uka1gbG1WxdjJwcEgImEqf+7mPvYuTiEBJYxyhxa88rKOc3o8S7/e1M IFVsApoSJ+ZNA0uICLQzSTQv/MDcxcjBwSzgJHH9uj9IjbCAn8T0w4cZQWwWAVWJva1vWUBs XgE3idNzn0Jtk5M4eWwy6wRGrgWMDKsYJVMLinPTc4uNCgzzUsv1ihNzi0vz0vWS83M3MQID bNthrb4djPeXxB9iFOBgVOLhzYg4FiXEmlhWXJl7iFGCg1lJhHf3H6AQb0piZVVqUX58UWlO avEhRmkOFiVx3tt5xyKFBNITS1KzU1MLUotgskwcnFINjDwaFRoKgrt0W60+VljvuLTd949G GOfDyrROY965Ph6Lv8fP0z0knH7gRvqUrx84z7bc930/Ufhtzj1Bi7yCGtEd59QDJ1YKT/R3 l12oOO/YDMGtGw9+OnHj7+cAxoZdGwr3777cEpvXxbDI8XyoOcenq/ESU+b1zGC8PcPu4RPG t7JMe6TcYpVYijMSDbWYi4oTAca1qPAsAgAA X-CMS-MailID: 20180406045340epcas1p1ae6416dc25823212303c9109d125c018 X-Msg-Generator: CA CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20180406045340epcas1p1ae6416dc25823212303c9109d125c018 X-RootMTR: 20180406045340epcas1p1ae6416dc25823212303c9109d125c018 References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org INITRD reserved area entry is not removed from memblock even though initrd reserved area is freed. After freeing the memory it is released from memblock. The same can be checked from /sys/kernel/debug/memblock/reserved. The patch makes sure that the initrd entry is removed from memblock when keepinitrd is not enabled. Signed-off-by: CHANDAN VN --- arch/arm64/mm/init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 9f3c47a..1b18b47 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -646,8 +646,10 @@ void free_initmem(void) void __init free_initrd_mem(unsigned long start, unsigned long end) { - if (!keep_initrd) + if (!keep_initrd) { free_reserved_area((void *)start, (void *)end, 0, "initrd"); + memblock_free(__virt_to_phys(start), end - start); + } } static int __init keepinitrd_setup(char *__unused) -- 1.9.1