Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752351AbdLUIzb (ORCPT ); Thu, 21 Dec 2017 03:55:31 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:52380 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752278AbdLUIza (ORCPT ); Thu, 21 Dec 2017 03:55:30 -0500 Message-ID: <5A3B76EE.8020001@huawei.com> Date: Thu, 21 Dec 2017 16:55:10 +0800 From: Xishi Qiu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Toshi Kani , "H. Peter Anvin" , "Thomas Gleixner" , Ingo Molnar CC: LKML , Linux MM , "Xishi Qiu" Subject: [RFC] does ioremap() cause memory leak? Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.25.179] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 380 Lines: 9 When we use iounmap() to free the mapping, it calls unmap_vmap_area() to clear page table, but do not free the memory of page table, right? So when use ioremap() to mapping another area(incluce the area before), it may use large mapping(e.g. ioremap_pmd_enabled()), so the original page table memory(e.g. pte memory) will be lost, it cause memory leak, right? Thanks, Xishi Qiu