Commit ab35295d authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] speed up pte_chain locking on uniprocessors

ifdef out some operations in pte_chain_lock() which are not necessary
on uniprocessor.
parent c1ab3459
...@@ -240,16 +240,20 @@ static inline void pte_chain_lock(struct page *page) ...@@ -240,16 +240,20 @@ static inline void pte_chain_lock(struct page *page)
* attempt to acquire the lock bit. * attempt to acquire the lock bit.
*/ */
preempt_disable(); preempt_disable();
#ifdef CONFIG_SMP
while (test_and_set_bit(PG_chainlock, &page->flags)) { while (test_and_set_bit(PG_chainlock, &page->flags)) {
while (test_bit(PG_chainlock, &page->flags)) while (test_bit(PG_chainlock, &page->flags))
cpu_relax(); cpu_relax();
} }
#endif
} }
static inline void pte_chain_unlock(struct page *page) static inline void pte_chain_unlock(struct page *page)
{ {
#ifdef CONFIG_SMP
smp_mb__before_clear_bit(); smp_mb__before_clear_bit();
clear_bit(PG_chainlock, &page->flags); clear_bit(PG_chainlock, &page->flags);
#endif
preempt_enable(); preempt_enable();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment