4
votes

I found the flush_dcache_page() does nothing in linux kernel on x86 arch as below

include/asm-generic/cacheflush.h

Line 17    #define flush_dcache_page(page) do {} while (0)

I think there is the cache flush instruction "CLFLUSH" on x86 arch and it can be used for this page flushing.

However flush_dcache_page() does not run any CPU instructions as above source code.

Why does not flush_dcache_page() run any instructions on the x86 architecture?

Does it guarantee to write a page in dcache to main memory?

1

1 Answers

3
votes

From https://www.kernel.org/doc/Documentation/cachetlb.txt

"If D-cache aliasing is not an issue, this routine may simply be defined as a nop on that architecture."