--On Monday, March 03, 2003 14:15:18 -0800 Andrew Morton wrote: > Well why not make mapcount an "int" and move the places where it is > modified inside pte_chain_lock()? > > That does not increase the number of atomic operations, and it makes me > stop wondering if this: > > if (atomic_read(&page->pte.mapcount) == 0) > inc_page_state(nr_mapped); > > is racy ;) That would be entirely too easy a solution :) You're entirely right, of course. Here's the patch that makes it an int instead of atomic, with the appropriate locking. Dave ====================================================================== Dave McCracken IBM Linux Base Kernel Team 1-512-838-3059 dmccr@us.ibm.com T/L 678-3059