Re: [PATCH v2 1/2] tracing: ring-buffer: Have the ring buffer code do the vmap of physical memory
From: Linus Torvalds
Date: Mon Mar 31 2025 - 20:38:34 EST
On Mon, 31 Mar 2025 at 17:29, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> > Of course, I would expect the same to be true of the page/folio cases,
> > so I don't think using flush_cache_range() should be any worse, but I
> > *could* imagine that it's bad in a different way ;)
>
> At least we can say we covered those other archs, and if a bug is reported,
> then all that would need to be fixed is the flush_cache_range()
> implementation ;-)
Well, there's also the whole "is it I$ or D$" question.
I think flush_cache_range() is basically expected to do both, and you
don't care about the I$ side (and I$ coherency issues are a *lot* more
common than D$ coherency issues are - while D$ coherency is happily
the common situation, the I$ not being coherent is actually the
default, and x86 - and s390? - is unusual in this area).
So maybe powerpc people will be unhappy about flush_cache_range()
because it does the "look out for I$" thing too.
There's a flush_dcache_range() thing too, but I don't see a single use
of that function in generic code, so I suspect that one is currently
purely for architecture-specific drivers and doesn't work in egneral.
So *this* is the kind of "bad in a different way" I could imagine:
things that probably should be cleaned up and be available to generic
code, but very few people have cared, and so they are used in ad-hoc
places and haven't been sufficiently generalized and cleaned up.
Linus