[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALAqxLVpTtjFrtKAkcrjDKN9R6FuSdY6LKQw8Mye-3Atqv7kQw@mail.gmail.com>
Date: Mon, 15 Nov 2021 09:26:54 -0800
From: John Stultz <john.stultz@...aro.org>
To: Huacai Chen <chenhuacai@...ngson.cn>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Stephen Boyd <sboyd@...nel.org>, linux-kernel@...r.kernel.org,
Xuefeng Li <lixuefeng@...ngson.cn>,
Huacai Chen <chenhuacai@...il.com>,
Jiaxun Yang <jiaxun.yang@...goat.com>
Subject: Re: [PATCH] time/sched_clock: Allow architecture to override cyc_to_ns()
On Sat, Nov 13, 2021 at 11:47 PM Huacai Chen <chenhuacai@...ngson.cn> wrote:
>
> The current cyc_to_ns() implementation is like this:
>
> static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift)
> {
> return (cyc * mult) >> shift;
> }
>
> But u64*u32 maybe overflow, so introduce ARCH_HAS_CYC_TO_NS to allow
> architecture to override it.
>
If that's the case, it would seem too large a mult/shift pair had been selected.
What sort of cycle range are you considering to be valid here? Can you
provide more rationale as to why this needs the ability to be
overridden?
And what sort of arch-specific logic do you envision, rather than
having a common implementation to avoid the overflow?
thanks
-john
Powered by blists - more mailing lists