lkml.org 
[lkml]   [2006]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/5] ide: add cpu cache flushes after kmapping and modifying a page
Christoph Hellwig wrote:
> On Sun, Jun 04, 2006 at 12:41:20PM +0900, Tejun Heo wrote:
>> data = bvec_kmap_irq(bvec, &flags);
>> drive->hwif->atapi_input_bytes(drive, data, count);
>> + flush_kernel_dcache_page(kmap_atomic_to_page(data));
>> bvec_kunmap_irq(data, &flags);
>
> shouldn't bvec_kunmap_irq do the flush_kernel_dcache_page call?
>

Eventually, yes. At the moment, not all archs implement
flush_kernel_dcache_page(), so converting

kmap();
modify buffer;
flush_dcache_page();
kunmap();

to

kmap_wrapper();
modify buffer;
kunmap_wrapper_which_calls_flush_kernel_dcache_page()

breaks cache coherency on those archs. The current patches simply add
calls to flush_kernel_dcache_page() where missing such that it doesn't
break anything while fixing cache coherency for arm and parisc. In the
long term...

1. implement flush_kernel_dcache_page() for all needed archs
2. update kmap interface such that the caller is mandated to specify
whether the buffer has been modified or not when unmapping (maybe
addition of simple boolean argument?)
3. update bvec_kmap_*() similarly
4. update all calls to kunmap & friends.

Thanks.

--
tejun
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-04 11:12    [W:0.403 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site