Suspend 2 merge: 13/51: Disable highmem tlb flush for copyback.

Nigel Cunningham
2004-11-24T13:04:36Z

When we're making/restoring our atomic copy of the image, secondary
processors are frozen. Trying an SMP call at that time could thus lead
to deadlock. Secondary processors have their tlbs unconditionally
flushed when leaving the processor refrigerator, so this doesn't come
back to bite us.

diff -ruN 502-disable-highmem-tlb-flush-for-copyback-old/mm/highmem.c 502-disable-highmem-tlb-flush-for-copyback-new/mm/highmem.c
--- 502-disable-highmem-tlb-flush-for-copyback-old/mm/highmem.c 2004-11-03 21:54:14.000000000 +1100
+++ 502-disable-highmem-tlb-flush-for-copyback-new/mm/highmem.c 2004-11-04 16:27:40.000000000 +1100
@@ -26,6 +26,7 @@
#include <linux/init.h>
#include <linux/hash.h>
#include <linux/highmem.h>
+#include <linux/suspend.h>
#include <asm/tlbflush.h>

static mempool_t *page_pool, *isa_page_pool;
@@ -94,7 +95,10 @@

set_page_address(page, NULL);
}
- flush_tlb_kernel_range(PKMAP_ADDR(0), PKMAP_ADDR(LAST_PKMAP));
+ if (test_suspend_state(SUSPEND_FREEZE_SMP))
+ __flush_tlb();
+ else
+ flush_tlb_kernel_range(PKMAP_ADDR(0), PKMAP_ADDR(LAST_PKMAP));
}

static inline unsigned long map_new_virtual(struct page *page)