Skip to contentSkip to conversation

USB mass storage and ARM cache coherency

DISCUSSION George Spelvin 2 participants 2 messages Feb 3, 2010 – Feb 4, 2010

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines

Apart from that, flush_dcache_page() doesn't have any data flow information. Optimisations could be done on ARM if we know that the kernel only intends to read from a page (no flushing necessary with a non-aliasing D-cache).

Already done in flush_dcache_page(). If possible (uniprocessor), it just flags the page as PG_dcache_dirty, and defers the actual flush operation until it's mapped somewhere else (either a virtual alias or executable).

See Documentation/cachetlb.txt. (Really, all PIO drivers should be calling flush_dcache_page.)

#1 lore raw
Quoted 9 lines · George Spelvin
Quoted 4 lines

Apart from that, flush_dcache_page() doesn't have any data flow information. Optimisations could be done on ARM if we know that the kernel only intends to read from a page (no flushing necessary with a non-aliasing D-cache).

Already done in flush_dcache_page(). If possible (uniprocessor), it just flags the page as PG_dcache_dirty, and defers the actual flush operation until it's mapped somewhere else (either a virtual alias or executable).

Try reading the thread again, as you seem to have missed the point completely. The issue isn't with lazy dcache writeback, the issue is that flush_dcache_page() is a bit of a sledgehammer for cases when directional information is available. The DMA mapping operations conversely are aware of data flow and optimize accordingly.

Additionally, with something like a flush_dcache_range() it's possible to optimize for large ranges as opposed to page-at-a-time looping for anything that needs to flag PG_dcache_dirty on a bulk group of pages.