[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e25b1da2-14fb-eeec-1a76-1756011535bb@huawei.com>
Date: Tue, 2 Jan 2018 09:39:47 +0800
From: Hanjun Guo <guohanjun@...wei.com>
To: Xishi Qiu <qiuxishi@...wei.com>
CC: Toshi Kani <toshi.kani@...com>, "H. Peter Anvin" <hpa@...or.com>,
"Thomas Gleixner" <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
Linux MM <linux-mm@...ck.org>, <lious.lilei@...ilicon.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
LinuxArm <linuxarm@...wei.com>
Subject: Re: [RFC] does ioremap() cause memory leak?
On 2017/12/23 13:32, Xishi Qiu wrote:
> On 2017/12/21 16:55, Xishi Qiu wrote:
>
>> 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?
>
>
>
> So I have two questions for this scene.
>
> 1. When the same virtual address allocated from ioremap, first is 4K size, second is 2M size, if Kernel would leak memory.
>
> 2. Kernel modifies the old invalid 4K pagetable to 2M, but doesn`t follow the ARM break-before-make flow, CPU maybe get the old invalid 4K pagetable information, then Kernel would panic.
I sent a RFC patch for this one [1].
[1]: https://patchwork.kernel.org/patch/10134581/
Thanks
Hanjun
Powered by blists - more mailing lists