diff options
Diffstat (limited to 'arch/sparc64')
-rw-r--r-- | arch/sparc64/mm/init.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 89022ccaa75b..db6fa77b4dab 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -201,13 +201,24 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t p | |||
201 | 201 | ||
202 | void flush_dcache_page(struct page *page) | 202 | void flush_dcache_page(struct page *page) |
203 | { | 203 | { |
204 | struct address_space *mapping = page_mapping(page); | 204 | struct address_space *mapping; |
205 | int dirty = test_bit(PG_dcache_dirty, &page->flags); | 205 | int this_cpu; |
206 | int dirty_cpu = dcache_dirty_cpu(page); | ||
207 | int this_cpu = get_cpu(); | ||
208 | 206 | ||
207 | /* Do not bother with the expensive D-cache flush if it | ||
208 | * is merely the zero page. The 'bigcore' testcase in GDB | ||
209 | * causes this case to run millions of times. | ||
210 | */ | ||
211 | if (page == ZERO_PAGE(0)) | ||
212 | return; | ||
213 | |||
214 | this_cpu = get_cpu(); | ||
215 | |||
216 | mapping = page_mapping(page); | ||
209 | if (mapping && !mapping_mapped(mapping)) { | 217 | if (mapping && !mapping_mapped(mapping)) { |
218 | int dirty = test_bit(PG_dcache_dirty, &page->flags); | ||
210 | if (dirty) { | 219 | if (dirty) { |
220 | int dirty_cpu = dcache_dirty_cpu(page); | ||
221 | |||
211 | if (dirty_cpu == this_cpu) | 222 | if (dirty_cpu == this_cpu) |
212 | goto out; | 223 | goto out; |
213 | smp_flush_dcache_page_impl(page, dirty_cpu); | 224 | smp_flush_dcache_page_impl(page, dirty_cpu); |