ioremap doesn't increment page->count, but iounmap decrements it

Timur Tabi (ttabi@interactivesi.com)
Tue, 9 Jan 2001 11:35:09 -0600


I just discovered an oddity in 2.2.18pre15. When ioremap() is used to map
reserved pages (of real RAM), it does not increment the "count" field for the
page it remaps (i.e. page->count). However, when you call iounmap on that
memory, that function decrements page->count. Since the count was originally
zero, it gets decremented to -1, and that's when things start to go bad.

I get the feeling that if I remap reserved memory, I'm not supposed to ever
unmap it. But that means that my driver will have a memory leak. Can someone
help me out?

-- 
Timur Tabi - ttabi@interactivesi.com
Interactive Silicon - http://www.interactivesi.com

When replying to a mailing-list message, please direct the reply to the mailing list only. Don't send another copy to me. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/