Re: flush_dcache_page vs kunmap_local

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 04, 2021 at 08:30:55AM -0700, Linus Torvalds wrote:
> On Thu, Nov 4, 2021 at 8:03 AM Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
> > Linus offers the opinion that kunmap calls should imply a
> > flush_dcache_page().  Christoph added calls to flush_dcache_page()
> > in commit 8dad53a11f8d.  Was this "voodoo programming", or was there
> > a real problem being addressed?
> 
> I don't think anybody actually uses/cares about flush_dcache_page() at
> all, and pretty much all uses are random and voodoo.

We do. flush_dcache_page() is not just about virtual caches. On arm32/64
(and powerpc), even with PIPT-like caches, we use it to flag a page's
D-cache as no longer clean. Subsequently in set_pte_at(), if the mapping
is executable, we do the cache maintenance to ensure the I and D caches
are coherent with each other.

I wouldn't add this call to kmap/kunmap_local(), it would be a slight
unnecessary overhead (we had a customer complaining about kmap_atomic()
breaking write-streaming, I think the new kmap_local() solved this
problem, if in the right context).

-- 
Catalin



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux