* [PATCH] tweaks for page_convert_anon
@ 2003-04-04 16:41 Hugh Dickins
2003-04-04 18:18 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Hugh Dickins @ 2003-04-04 16:41 UTC (permalink / raw)
To: Andrew Morton; +Cc: Dave McCracken, Pete Zaitcev, linux-kernel, linux-mm
A couple of small additions on top of Dave's objfix-2.5.66-mm3-3:
To maintain an accurate nr_mapped, page_remove_rmap must check
page_mapped with pte_chain_lock held, both at end and at start:
particularly now it's being called speculatively (in ignorance
of whether this pte is already listed or not).
Coincidentally, Pete Zaitcev's "gcc 3.2 breaks rmap on s390x" problem
reported yesterday would also be corrected by this, though it doesn't
fix the root of the problem (no barrier in pte_chain_lock on s390x).
Also, page_convert_anon remember pte_unmap after successful find_pte.
Hugh
--- 2.5.66-mm3-3/mm/rmap.c Fri Apr 4 12:20:40 2003
+++ linux/mm/rmap.c Fri Apr 4 16:13:42 2003
@@ -398,10 +398,10 @@
BUG();
if (!pfn_valid(page_to_pfn(page)) || PageReserved(page))
return;
- if (!page_mapped(page))
- return; /* remap_page_range() from a driver? */
pte_chain_lock(page);
+ if (!page_mapped(page))
+ goto outer;
/*
* If this is an object-based page, just uncount it. We can
@@ -461,10 +461,10 @@
}
}
out:
- pte_chain_unlock(page);
if (!page_mapped(page))
dec_page_state(nr_mapped);
- return;
+outer:
+ pte_chain_unlock(page);
}
/**
@@ -831,6 +831,7 @@
/* Make sure this isn't a duplicate */
page_remove_rmap(page, pte);
pte_chain = page_add_rmap(page, pte, pte_chain);
+ pte_unmap(pte);
}
spin_unlock(&vma->vm_mm->page_table_lock);
}
@@ -850,6 +851,7 @@
/* Make sure this isn't a duplicate */
page_remove_rmap(page, pte);
pte_chain = page_add_rmap(page, pte, pte_chain);
+ pte_unmap(pte);
}
spin_unlock(&vma->vm_mm->page_table_lock);
}
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-04-04 18:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-04 16:41 [PATCH] tweaks for page_convert_anon Hugh Dickins
2003-04-04 18:18 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox