From 8da464d2d3b98bf9ba59d94d53937595b2d22c56 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sun, 17 Apr 2005 18:03:09 -0700 Subject: [PATCH] --- yaml --- r: 237 b: refs/heads/master c: a9546f59e90d6ec1b65952c547302e0678e3a5ac h: refs/heads/master i: 235: f66c9ba6fc463da0cb48637bb96cd7a50daa7d98 v: v3 --- [refs] | 2 +- trunk/arch/sparc64/mm/init.c | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 6d61d58b5f41..829fb523a906 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a4e884a311893b476893739901bed382cd62b4fe +refs/heads/master: a9546f59e90d6ec1b65952c547302e0678e3a5ac diff --git a/trunk/arch/sparc64/mm/init.c b/trunk/arch/sparc64/mm/init.c index 89022ccaa75b..db6fa77b4dab 100644 --- a/trunk/arch/sparc64/mm/init.c +++ b/trunk/arch/sparc64/mm/init.c @@ -201,13 +201,24 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t p void flush_dcache_page(struct page *page) { - struct address_space *mapping = page_mapping(page); - int dirty = test_bit(PG_dcache_dirty, &page->flags); - int dirty_cpu = dcache_dirty_cpu(page); - int this_cpu = get_cpu(); + struct address_space *mapping; + int this_cpu; + /* Do not bother with the expensive D-cache flush if it + * is merely the zero page. The 'bigcore' testcase in GDB + * causes this case to run millions of times. + */ + if (page == ZERO_PAGE(0)) + return; + + this_cpu = get_cpu(); + + mapping = page_mapping(page); if (mapping && !mapping_mapped(mapping)) { + int dirty = test_bit(PG_dcache_dirty, &page->flags); if (dirty) { + int dirty_cpu = dcache_dirty_cpu(page); + if (dirty_cpu == this_cpu) goto out; smp_flush_dcache_page_impl(page, dirty_cpu);