Re: [PATCH] ring-buffer: Remove 32bit timestamp logic

From: Steven Rostedt
Date: Thu Dec 14 2023 - 16:01:19 EST


On Thu, 14 Dec 2023 12:50:29 -0800
Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> > But do all archs have an implementation of cmpxchg64, even if it requires
> > disabling interrupts? If not, then I definitely cannot remove this code.
>
> We have a generic header file, so anybody who uses that would get the
> fallback version, ie
>
> arch_cmpxchg64 -> generic_cmpxchg64_local -> __generic_cmpxchg64_local
>
> which does that irq disabling thing.
>
> But no, not everybody is guaranteed to use that fallback. From a quick
> look, ARC, hexagon and CSky don't do this, for example.
>
> And then I got bored and stopped looking.
>
> My guess is that *most* 32-bit architectures do not have a 64-bit
> cmpxchg - not even the irq-safe one.

OK, that means I have to completely abandon this change, even for the next
merge window.

I may add a check if cmpxchg64 exists before falling back to the 32bit
cmpxchg version. But even that will have to wait till the next merge
window, with a fixes tag (but not Cc'd stable) in case anyone would like to
backport it.

Thanks for the advice!

-- Steve