Skip to contentSkip to conversation

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

DISCUSSION Timur Tabi 1 participant 1 message Jan 9, 2001

lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

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?

Signature · 8 lines
Timur Tabi - [email protected]
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 [email protected]
Please read the FAQ at http://www.tux.org/lkml/