How does Linux kernel flush_write_buffers() work on x86?
问题 The following code is from include/asm-i386/io.h , and it is invoked from dma_map_single() . My understanding is that flush_write_buffers() is supposed to flush CPU memory cache before mapping the memory for DMA. But how does this assembly code flush CPU cache? static inline void flush_write_buffers(void) { __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory"); } 回答1: The Intel Pentium Pro processors had a bug wherein a store to a memory location of type UC may be reordered with