[patch 5/13] speed up pte_chain locking on uniprocessors

Andrew Morton (akpm@zip.com.au)
Sun, 28 Jul 2002 00:32:48 -0700


ifdef out some operations in pte_chain_lock() which are not necessary
on uniprocessor.

page-flags.h | 4 ++++
1 files changed, 4 insertions(+)

--- 2.5.29/include/linux/page-flags.h~SMP-pte_chain_lock Sat Jul 27 23:39:04 2002
+++ 2.5.29-akpm/include/linux/page-flags.h Sat Jul 27 23:39:04 2002
@@ -240,16 +240,20 @@ static inline void pte_chain_lock(struct
* 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();
}

.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/