Disable elision for lglock readers

lglocks reader locks very rarely have any contention, because they
are normally only used privately on each CPU.

Don't run them with elision. The risk of aborting for some reason
outweights the benefit of eliding them. This helps in particular
the dcache, which has a tendency to exceed the transaction
capacity of Haswell during dcache walks.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
diff --git a/kernel/lglock.c b/kernel/lglock.c
index 6535a66..d083972 100644
--- a/kernel/lglock.c
+++ b/kernel/lglock.c
@@ -23,7 +23,13 @@
 	preempt_disable();
 	rwlock_acquire_read(&lg->lock_dep_map, 0, 0, _RET_IP_);
 	lock = this_cpu_ptr(lg->lock);
+	/*
+	 * Don't elide these locks, because they are not expected
+	 * to be contended much, but may abort.
+	 */
+	disable_txn();
 	arch_spin_lock(lock);
+	reenable_txn();
 }
 EXPORT_SYMBOL(lg_local_lock);
 
@@ -45,7 +51,9 @@
 	preempt_disable();
 	rwlock_acquire_read(&lg->lock_dep_map, 0, 0, _RET_IP_);
 	lock = per_cpu_ptr(lg->lock, cpu);
+	disable_txn();
 	arch_spin_lock(lock);
+	reenable_txn();
 }
 EXPORT_SYMBOL(lg_local_lock_cpu);