bounce: call flush_dcache_page after bounce_copy_vec
PATCH 1/1 bounce: call flush_dcache_page after bounce_copy_vec
I have been seeing problems on Tegra 2 (ARMv7 SMP) systems with HIGHMEM enabled on 2.6.35 (plus some patches targetted at 2.6.36 to perform cache maintenance lazily), and the root cause appears to be that the mm bouncing code is calling flush_dcache_page before it copies the bounce buffer into the bio.
The patch below reorders these two operations, and eliminates numerous arbitrary application crashes on my dev system.
Gary
--
Andrew Morton
maintainerQuoted 31 lines · On Tue, 7 Sep 2010 13:45:34 -0700 Gary King <[email protected]> wrote:
I have been seeing problems on Tegra 2 (ARMv7 SMP) systems with HIGHMEM enabled on 2.6.35 (plus some patches targetted at 2.6.36 to perform cache maintenance lazily), and the root cause appears to be that the mm bouncing code is calling
flush_dcache_pagebefore it copies the bounce buffer into the bio.The patch below reorders these two operations, and eliminates numerous arbitrary application crashes on my dev system.
Gary
--
Quoted 1 line
From
678c9bca8d8a8f254f28af91e69fad3aa1be7593Mon Sep 17 00:00:00 2001From: Gary King <[email protected]>
Date: Mon, 6 Sep 2010 15:37:12 -0700
Subject: bounce: callflush_dcache_pageafterbounce_copy_vecthe bounced page needs to be flushed after data is copied into it, to ensure that architecture implementations can synchronize instruction and data caches if necessary.
Signed-off-by Gary King <[email protected]>--- mm/bounce.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)mm/bounce.c +0
-0
mm/bounce.c static void copy_to_high_bio_irq(struct bio *to, struct bio *from) · line 122
Quoted 8 lines
mm/bounce.c +1
-1@@ -116,8 +116,8 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from)*/ vfrom =page_address (fromvec->bv_page) + tovec->bv_offset; -flush_dcache_page (tovec->bv_page);bounce_copy_vec (tovec, vfrom); +flush_dcache_page (tovec->bv_page); } }
Oh my, that was bad.
I queued your fix for 2.6.36 and tagged it for -stable backporting, thanks.
Quoted 37 lines · Andrew Morton
Quoted 34 lines · On Tue, 7 Sep 2010 13:45:34 -0700 Gary King <[email protected]> wrote:
I have been seeing problems on Tegra 2 (ARMv7 SMP) systems with HIGHMEM enabled on 2.6.35 (plus some patches targetted at 2.6.36 to perform cache maintenance lazily), and the root cause appears to be that the mm bouncing code is calling
flush_dcache_pagebefore it copies the bounce buffer into the bio.The patch below reorders these two operations, and eliminates numerous arbitrary application crashes on my dev system.
Gary
--
Quoted 1 line
From
678c9bca8d8a8f254f28af91e69fad3aa1be7593Mon Sep 17 00:00:00 2001From: Gary King <[email protected]>
Date: Mon, 6 Sep 2010 15:37:12 -0700
Subject: bounce: callflush_dcache_pageafterbounce_copy_vecthe bounced page needs to be flushed after data is copied into it, to ensure that architecture implementations can synchronize instruction and data caches if necessary.
Signed-off-by Gary King <[email protected]>--- mm/bounce.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)mm/bounce.c +0
-0@@ -116,8 +116,8 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from)*/ vfrom =page_address (fromvec->bv_page) + tovec->bv_offset;
Quoted 7 lines
mm/bounce.c static void copy_to_high_bio_irq(struct bio *to, struct bio *from) · line 122
Quoted 5 lines
mm/bounce.c +1
-1-flush_dcache_page (tovec->bv_page);bounce_copy_vec (tovec, vfrom); +flush_dcache_page (tovec->bv_page); } }Oh my, that was bad.
Indeed, I wonder how that could have been wrong for so long.
Quoted 2 lines
I queued your fix for 2.6.36 and tagged it for -stable backporting, thanks.
Thanks, you can add my acked-by.
Signature · 1 line
Jens Axboe
Quoted 9 lines · Gary King
I have been seeing problems on Tegra 2 (ARMv7 SMP) systems with HIGHMEM enabled on 2.6.35 (plus some patches targetted at 2.6.36 to perform cache maintenance lazily), and the root cause appears to be that the mm bouncing code is calling
flush_dcache_pagebefore it copies the bounce buffer into the bio.The patch below reorders these two operations, and eliminates numerous arbitrary application crashes on my dev system.
We also experience the package building failure on OMAP4 SMP system with HIGHMEM enabled
on 2.6.35. Thanks a lot for this fixing, we will try it later soon.
-Bryan
Quoted 40 lines
Gary
--
From678c9bca8d8a8f254f28af91e69fad3aa1be7593Mon Sep 17 00:00:00 2001
From: Gary King <[email protected]>
Date: Mon, 6 Sep 2010 15:37:12 -0700
Subject: bounce: callflush_dcache_pageafterbounce_copy_vecthe bounced page needs to be flushed after data is copied into it, to ensure that architecture implementations can synchronize instruction and data caches if necessary.
Signed-off-by Gary King <[email protected]>---
?mm/bounce.c | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)mm/bounce.c +0
-0@@ -116,8 +116,8 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from)? ? ? ? ? ? ? ? */
? ? ? ? ? ? ? ?vfrom =page_address(fromvec->bv_page)+tovec->bv_offset;- ? ? ? ? ? ? ?
flush_dcache_page(tovec->bv_page); ? ? ? ? ? ? ? ?bounce_copy_vec(tovec, vfrom);
+ ? ? ? ? ? ? ?flush_dcache_page(tovec->bv_page); ? ? ? ?}
?}--
1.7.0.4_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel