linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [CFT:PATCH] Remove a seemingly unnecessary cache flush
@ 2009-12-07 22:12 Russell King - ARM Linux
  2009-12-10 10:40 ` Russell King - ARM Linux
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Russell King - ARM Linux @ 2009-12-07 22:12 UTC (permalink / raw)
  To: linux-arm-kernel

While looking into the possible msync() issue (which turned out to be a
non-issue - it's covered by clever code), I found that we're flushing
the same page multiple times.

Normally, update_mmu_cache() would not be doing anything on architectures
which don't have a software-loaded TLB.  However, we use this hook for
two things:

1. for our delayed flush_dcache_page().
2. to fix up multiple shared write-able mappings of the same page.

However, as of 8 years ago, I committed this patch (sorry for the
bkbits URL):

http://linux.bkbits.net:8080/linux-2.6/?PAGE=patch&REV=3dd7c1f9DypjNd1HyQFAOsA3p7mYig

What the majority of that patch is doing is adding the user-mapping
flushing to __flush_dcache_page() - that's fine, and it's explained in
the changeset comments.

It also tries to merge the new __flush_dcache_page() code inside
make_coherent() - make_coherent() is sort-of already doing most of what
__flush_dcache_page() does, and for good measure it does a final
flush_cache_page().

The unused addition of 'dirty' seems to suggest that this extra
flush_cache_page should have been conditional on that.

Moreover, this final flush_cache_page() should not be needed - the whole
"delayed flush_dcache_page" thing only happens when there are no pre-
existing mappings of the page, and so there should be no user mappings
to worry about.

Hence, I believe it is safe to get rid of this - but this patch will
need some rigorous testing.  My ARM VersatilePB926 still boots without
this additional patch - but that's not a very good test.  I can't say
much more than that for the time being.

Note: for ARMv6 and later, flush_cache_page() is a no-op, so please
don't bother testing this patch there.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/mm/fault-armv.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
index 7296022..666a871 100644
--- a/arch/arm/mm/fault-armv.c
+++ b/arch/arm/mm/fault-armv.c
@@ -127,8 +127,6 @@ make_coherent(struct address_space *mapping, struct vm_area_struct *vma, unsigne
 	flush_dcache_mmap_unlock(mapping);
 	if (aliases)
 		adjust_pte(vma, addr);
-	else
-		flush_cache_page(vma, addr, pfn);
 }
 
 /*

^ permalink raw reply related	[flat|nested] 12+ messages in thread
[parent not found: <20091207203258.GH26821@n2100.arm.linux.org.uk>]

end of thread, other threads:[~2010-03-09 19:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-07 22:12 [CFT:PATCH] Remove a seemingly unnecessary cache flush Russell King - ARM Linux
2009-12-10 10:40 ` Russell King - ARM Linux
2009-12-14 11:50   ` Mikael Pettersson
2009-12-14 11:53     ` Russell King - ARM Linux
2009-12-14 12:15       ` Mikael Pettersson
2009-12-20 19:32         ` Mikael Pettersson
2009-12-10 16:04 ` Mike Rapoport
2009-12-18 16:09 ` Russell King - ARM Linux
2010-03-09 15:46 ` Mikael Pettersson
2010-03-09 17:20   ` Russell King - ARM Linux
2010-03-09 19:15     ` Mikael Pettersson
     [not found] <20091207203258.GH26821@n2100.arm.linux.org.uk>
2009-12-08 13:26 ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).