From: Jeff Mahoney <jeffm@suse.com>
Subject: [PATCH] s390: Define FREE_PTE_NR
Patch-mainline: Never, unless FREE_PTE_NR is used in generic code

 Commit ba8a9229ab9e80278c28ad68b15053f65b2b0a7c from
 Martin Schwidefsky <schwidefsky@de.ibm.com> removed the
 #include <asm-generic/tlb.h> from asm-s390/tlb.h when he defined the
 s390-specific TLB operations.

 FREE_PTR_NR is generally an internal-only value, but our unmap_vmas-lat
 patch uses it to make smarter decisions about dumping PTEs in chunks.

 This patch restores the generic value in asm-s390/tlb.h. Since it's only
 used for an optimization, this should be safe.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>

---
 arch/s390/include/asm/tlb.h |   13 +++++++++++++
 1 file changed, 13 insertions(+)

--- a/arch/s390/include/asm/tlb.h
+++ b/arch/s390/include/asm/tlb.h
@@ -28,6 +28,19 @@
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 
+/* Lifted from asm-generic/tlb.h; Is used by patches.suse/unmap_vmas-lat */
+/*
+ * For UP we don't need to worry about TLB flush
+ * and page free order so much..
+ */
+#ifdef CONFIG_SMP
+  #define FREE_PTE_NR 506
+  #define tlb_fast_mode(tlb) ((tlb)->nr == ~0U)
+#else
+  #define FREE_PTE_NR   1
+  #define tlb_fast_mode(tlb) 1
+#endif
+
 struct mmu_gather {
 	struct mm_struct *mm;
 	struct mmu_table_batch *batch;
