From patchwork Fri Nov 21 08:27:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhichang.yuan@linaro.org X-Patchwork-Id: 41285 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E9C75244B0 for ; Fri, 21 Nov 2014 08:30:30 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id s18sf2738176lam.2 for ; Fri, 21 Nov 2014 00:30:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=KSwFZU2fh7HMi0LbvkqdMXwaf/0kBF97vz1zEAq2XVE=; b=AQ7invXRBA91bmdxslMJKG7ifrhkCV9Wr2pTS4REVwH7diLYhBeamVbAa079XG8wyb Fla3Y0Tep7UYdV9E9ihLd7J81HtFyTPsMpKUh7pmMUTmLJREHAAd7raweRazXVb1ckPv MyoqtcFjjQEaTkucX10yO+YncRT6GnAmwyRT1/DaW7aW2kku4Ehg7ts/WxpETQ1vYXr7 PIl5CpQpzp/Yq2fY7y4Tfi7TeQpkLVZUK6Z/ZkE1JOBtdZMcAITPzRyiYh78S7kFG/Ay 5zCJHVo3p2noCbNNGNLcHz5SjjIEeTy7zR1hfv9XABKBOOimDzdk3/k2I2UWtMpDeb6D xY6A== X-Gm-Message-State: ALoCoQkcRgbh8gCWA3/yEWmoAwznlUtvvG3velXYigvp5FtRk0KRas2b5jrzbaJBSWnKhojfl4+K X-Received: by 10.152.42.196 with SMTP id q4mr1091696lal.6.1416558629885; Fri, 21 Nov 2014 00:30:29 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.41 with SMTP id q9ls131833lag.67.gmail; Fri, 21 Nov 2014 00:30:29 -0800 (PST) X-Received: by 10.152.19.37 with SMTP id b5mr2732010lae.80.1416558629450; Fri, 21 Nov 2014 00:30:29 -0800 (PST) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id ob4si4343380lbb.40.2014.11.21.00.30.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 00:30:29 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by mail-la0-f52.google.com with SMTP id q1so3759527lam.39 for ; Fri, 21 Nov 2014 00:30:29 -0800 (PST) X-Received: by 10.152.42.226 with SMTP id r2mr2696233lal.29.1416558629352; Fri, 21 Nov 2014 00:30:29 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp43872lbc; Fri, 21 Nov 2014 00:30:28 -0800 (PST) X-Received: by 10.70.44.208 with SMTP id g16mr4752381pdm.130.1416558626597; Fri, 21 Nov 2014 00:30:26 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id aa1si6690135pbd.184.2014.11.21.00.30.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Nov 2014 00:30:26 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XrjZP-0004WH-EW; Fri, 21 Nov 2014 08:27:59 +0000 Received: from mail-pd0-f181.google.com ([209.85.192.181]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XrjZM-0004VM-JY for linux-arm-kernel@lists.infradead.org; Fri, 21 Nov 2014 08:27:57 +0000 Received: by mail-pd0-f181.google.com with SMTP id z10so4828379pdj.12 for ; Fri, 21 Nov 2014 00:27:32 -0800 (PST) X-Received: by 10.70.37.8 with SMTP id u8mr4670359pdj.9.1416558452767; Fri, 21 Nov 2014 00:27:32 -0800 (PST) Received: from localhost ([58.251.159.252]) by mx.google.com with ESMTPSA id b16sm4087326pdl.56.2014.11.21.00.27.30 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 21 Nov 2014 00:27:31 -0800 (PST) From: zhichang.yuan@linaro.org To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH] arm64:mm: free the useless initial page table Date: Fri, 21 Nov 2014 16:27:40 +0800 Message-Id: <1416558460-7257-1-git-send-email-zhichang.yuan@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141121_002756_674933_237822D8 X-CRM114-Status: UNSURE ( 9.58 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.192.181 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.181 listed in wl.mailspike.net] Cc: dsaxena@linaro.org, liguozhu@huawei.com, "zhichang.yuan" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zhichang.yuan@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: "zhichang.yuan" For 64K page system, after mapping a PMD section, the corresponding initial page table is not needed any more. That page can be freed. Signed-off-by: Zhichang Yuan --- arch/arm64/mm/mmu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index f4f8b50..12a336b 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -191,8 +191,11 @@ static void __init alloc_init_pmd(pud_t *pud, unsigned long addr, * Check for previous table entries created during * boot (__create_page_tables) and flush them. */ - if (!pmd_none(old_pmd)) + if (!pmd_none(old_pmd)) { flush_tlb_all(); + if (pmd_table(old_pmd)) + memblock_free(pte_pfn(pmd_pte(old_pmd)) << PAGE_SHIFT, PAGE_SIZE); + } } else { alloc_init_pte(pmd, addr, next, __phys_to_pfn(phys), prot_pte);