From: guohanjun@huawei.com (Hanjun Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] does ioremap() cause memory leak?
Date: Tue, 2 Jan 2018 09:39:47 +0800 [thread overview]
Message-ID: <e25b1da2-14fb-eeec-1a76-1756011535bb@huawei.com> (raw)
In-Reply-To: <5A3DEA6A.9080709@huawei.com>
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
prev parent reply other threads:[~2018-01-02 1:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5A3B76EE.8020001@huawei.com>
2017-12-23 5:32 ` [RFC] does ioremap() cause memory leak? Xishi Qiu
2018-01-02 1:39 ` Hanjun Guo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e25b1da2-14fb-eeec-1a76-1756011535bb@huawei.com \
--to=guohanjun@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).