quicklist: Set tlb->need_flush if pages are remaining in quicklist 0

This ensures that the quicklists are drained. Otherwise draining may only
occur when the processor reaches an idle state.

Fixes fatal leakage of pgd_t's on 2.6.22 and later.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Reported-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Christoph Lameter and committed by Linus Torvalds 421d9919 3811dbf6

+4
+4
include/asm-generic/tlb.h
··· 14 14 #define _ASM_GENERIC__TLB_H 15 15 16 16 #include <linux/swap.h> 17 + #include <linux/quicklist.h> 17 18 #include <asm/pgalloc.h> 18 19 #include <asm/tlbflush.h> 19 20 ··· 86 85 static inline void 87 86 tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) 88 87 { 88 + #ifdef CONFIG_QUICKLIST 89 + tlb->need_flush += &__get_cpu_var(quicklist)[0].nr_pages != 0; 90 + #endif 89 91 tlb_flush_mmu(tlb, start, end); 90 92 91 93 /* keep the page table cache within bounds */