summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Morton <akpm@zip.com.au>2002-09-03 05:33:46 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-09-03 05:33:46 -0700
commit11bf19bc0eb48735772e664d07573f916f6e3f29 (patch)
tree441037455364b8a1241238f7d9a12035da4ffdc1 /include
parentef5bf0b55cb5563d80acdc7a8cbb54b8b86d07c3 (diff)
[PATCH] place rmap locking in rmap-locking.h
The rmap locking inlines are causing some header file dependency/ordering problems - move them out of page-flags.h and into their own header file.
Diffstat (limited to 'include')
-rw-r--r--include/linux/page-flags.h30
-rw-r--r--include/linux/rmap-locking.h33
2 files changed, 33 insertions, 30 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 5a49020e728b..2b2eb67ae7a8 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -229,36 +229,6 @@ extern void get_page_state(struct page_state *ret);
#define TestClearPageDirect(page) test_and_clear_bit(PG_direct, &(page)->flags)
/*
- * inlines for acquisition and release of PG_chainlock
- */
-static inline void pte_chain_lock(struct page *page)
-{
- /*
- * Assuming the lock is uncontended, this never enters
- * the body of the outer loop. If it is contended, then
- * within the inner loop a non-atomic test is used to
- * busywait with less bus contention for a good time to
- * attempt to acquire the lock bit.
- */
- preempt_disable();
-#ifdef CONFIG_SMP
- while (test_and_set_bit(PG_chainlock, &page->flags)) {
- while (test_bit(PG_chainlock, &page->flags))
- cpu_relax();
- }
-#endif
-}
-
-static inline void pte_chain_unlock(struct page *page)
-{
-#ifdef CONFIG_SMP
- smp_mb__before_clear_bit();
- clear_bit(PG_chainlock, &page->flags);
-#endif
- preempt_enable();
-}
-
-/*
* The PageSwapCache predicate doesn't use a PG_flag at this time,
* but it may again do so one day.
*/
diff --git a/include/linux/rmap-locking.h b/include/linux/rmap-locking.h
new file mode 100644
index 000000000000..302a58f54ca3
--- /dev/null
+++ b/include/linux/rmap-locking.h
@@ -0,0 +1,33 @@
+/*
+ * include/linux/rmap-locking.h
+ *
+ * Locking primitives for exclusive access to a page's reverse-mapping
+ * pte chain.
+ */
+
+static inline void pte_chain_lock(struct page *page)
+{
+ /*
+ * Assuming the lock is uncontended, this never enters
+ * the body of the outer loop. If it is contended, then
+ * within the inner loop a non-atomic test is used to
+ * busywait with less bus contention for a good time to
+ * attempt to acquire the lock bit.
+ */
+ preempt_disable();
+#ifdef CONFIG_SMP
+ while (test_and_set_bit(PG_chainlock, &page->flags)) {
+ while (test_bit(PG_chainlock, &page->flags))
+ cpu_relax();
+ }
+#endif
+}
+
+static inline void pte_chain_unlock(struct page *page)
+{
+#ifdef CONFIG_SMP
+ smp_mb__before_clear_bit();
+ clear_bit(PG_chainlock, &page->flags);
+#endif
+ preempt_enable();
+}