[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wiKac4t-fOP_3fAf7nETfFLhT3ShmRmBq2J96y6jAr56Q@mail.gmail.com>
Date: Thu, 4 Nov 2021 08:30:55 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Matthew Wilcox <willy@...radead.org>
Cc: Christoph Hellwig <hch@....de>,
linux-arch <linux-arch@...r.kernel.org>,
Ira Weiny <ira.weiny@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: flush_dcache_page vs kunmap_local
On Thu, Nov 4, 2021 at 8:03 AM Matthew Wilcox <willy@...radead.org> 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.
No sane architecture uses pure virtual caches, and the insane ones
haven't been an issue for a long time either.
But if there are still systems with pure virtual caches, and they need
manual cache flushing, then I do think that kunmap is one of the
points that needs it, since that's the "I'm done accessing this data
through this virtual address" place.
End result: I really don't think anybody cares any more (and only
truly broken architectures ever did). I'd personally be perfectly
happy just saying "we might as well drop support for non-coherent
caches entirely".
But as long as we have those random odd "flush dcache manually"
things, I think kunmap() is one of the places that probably should
continue to do them.
Of course, the kunmap case is _doubly_ irrelevant, because we should
certainly hope that not only are those noncoherent pure virtual caches
a thing of the past, highmem itself should be going away.
Why did this come up? Do you actually have some hardware or situation
that cares?
Linus
Powered by blists - more mailing lists