Skip to contentSkip to conversation

BUG_ON in remap_pte_range: Why?

DISCUSSION Ravi 2 participants 2 messages May 20, 2003 – May 21, 2003 Memory management

lore
Share & tools
lore

Ravi

author
#0 lore raw

Hi,

I am looking at the latest mm/memory.c on Bitkeeper. The comment for remap_pte_range() says "maps a range of physical memory into the requested pages. the old mappings are removed". But the code has this check:

BUG_ON(!pte_none(*pte));

Why is it a bug to have a valid PTE when remap_pte_range() is called? The 2.4 version of this fucntion cleared the old PTE using ptep_get_and_clear() and then installed a new one. Why was this changed?

Thanks,
Ravi.

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#1 lore raw
Quoted 7 lines · Ravi

Hi,

I am looking at the latest mm/memory.c on Bitkeeper. The comment for remap_pte_range() says "maps a range of physical memory into the requested pages. the old mappings are removed". But the code has this check:

Quoted 6 lines

BUG_ON(!pte_none(*pte));

Why is it a bug to have a valid PTE when remap_pte_range() is called? The 2.4 version of this fucntion cleared the old PTE using ptep_get_and_clear() and then installed a new one. Why was this changed?

It used to be a call to forget_pte, and, as Flavio Bruno Leitner pointed out, wli changed it last year:

http://www.ussg.iu.edu/hypermail/linux/kernel/0206.0/0053.html

... making forget_pte into a macro, which has since been completely inlined. The comment that used to be above the macro was this:

bug check to be sure pte's are unmapped when no longer used

Signature · 7 lines
--Ed L Cashin     PGP public key: http://noserose.net/e/pgp/

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>