mbox series

[0/2] timekeeping: cleanup _fast_ variety of functions

Message ID 20190625081912.14813-1-Jason@zx2c4.com
Headers show
Series timekeeping: cleanup _fast_ variety of functions | expand

Message

Jason A. Donenfeld June 25, 2019, 8:19 a.m. UTC
Hi Thomas,

When Arnd and I discussed this prior, he thought it best that I separate
these two commits out into a separate patchset, because they might
require additional discussion or consideration from you. They seem
straightforward enough to me, but if deliberations require me to make
some tweaks, I'm happy to do so.

Thanks,
Jason

Jason A. Donenfeld (2):
  timekeeping: add missing non-_ns functions for fast accessors
  timekeeping: rename fast getter functions to be consistent

 Documentation/core-api/timekeeping.rst | 15 ++++---
 Documentation/trace/ftrace.rst         |  2 +-
 drivers/base/power/runtime.c           | 12 +++---
 drivers/gpu/drm/i915/i915_perf.c       |  2 +-
 fs/pstore/platform.c                   |  2 +-
 include/linux/pm_runtime.h             |  2 +-
 include/linux/timekeeping.h            | 28 +++++++++++--
 kernel/bpf/helpers.c                   |  2 +-
 kernel/debug/kdb/kdb_main.c            |  2 +-
 kernel/events/core.c                   |  4 +-
 kernel/rcu/rcuperf.c                   |  6 +--
 kernel/rcu/srcutree.c                  |  6 +--
 kernel/time/timekeeping.c              | 56 +++++++++++++-------------
 kernel/trace/trace.c                   |  6 +--
 kernel/watchdog_hld.c                  |  2 +-
 15 files changed, 85 insertions(+), 62 deletions(-)

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Arnd Bergmann <arnd@arndb.de>

-- 
2.21.0

Comments

Arnd Bergmann June 25, 2019, 10:18 a.m. UTC | #1
On Tue, Jun 25, 2019 at 10:19 AM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
>

> Hi Thomas,

>

> When Arnd and I discussed this prior, he thought it best that I separate

> these two commits out into a separate patchset, because they might

> require additional discussion or consideration from you. They seem

> straightforward enough to me, but if deliberations require me to make

> some tweaks, I'm happy to do so.


One concern I had was whether we want to replace 'fast' with something
else, such as 'in_nmi' that might be less confusing.  The current naming
might be easy to confuse between 'fast' and 'coarse'.

Another point might be whether we actually need more than one
kind of accessor for each time domain, given how rarely these are
used. In theory we could have the full set of combinations of fast:
monotonic/real/boottime/raw (but not clocktai) with ktime_t/ns/seconds/ts64
for 16 versions.  We currently have four, and you are adding another
four, but not the final eight. I'm not saying this is wrong, but
it feels a bit arbitrary and could use an explanation why you feel that
is the right subset.

For coarse, we have ktime_t and ts64. The _seconds() accessors are
coarse by definition, but we probably don't want to add _ns().
We also don't have the combination of 'raw' with 'coarse' or 'seconds',
as that seems to have no use case.

      Arnd
Thomas Gleixner June 27, 2019, 10:21 p.m. UTC | #2
On Tue, 25 Jun 2019, Arnd Bergmann wrote:
> On Tue, Jun 25, 2019 at 10:19 AM Jason A. Donenfeld <Jason@zx2c4.com> wrote:

> >

> > When Arnd and I discussed this prior, he thought it best that I separate

> > these two commits out into a separate patchset, because they might

> > require additional discussion or consideration from you. They seem

> > straightforward enough to me, but if deliberations require me to make

> > some tweaks, I'm happy to do so.

> 

> One concern I had was whether we want to replace 'fast' with something

> else, such as 'in_nmi' that might be less confusing.  The current naming

> might be easy to confuse between 'fast' and 'coarse'.

> 

> Another point might be whether we actually need more than one

> kind of accessor for each time domain, given how rarely these are

> used. In theory we could have the full set of combinations of fast:

> monotonic/real/boottime/raw (but not clocktai) with ktime_t/ns/seconds/ts64

> for 16 versions.  We currently have four, and you are adding another

> four, but not the final eight. I'm not saying this is wrong, but

> it feels a bit arbitrary and could use an explanation why you feel that

> is the right subset.

> 

> For coarse, we have ktime_t and ts64. The _seconds() accessors are

> coarse by definition, but we probably don't want to add _ns().

> We also don't have the combination of 'raw' with 'coarse' or 'seconds',

> as that seems to have no use case.


Can we please just add those which are actually needed. If new code misses
something we can add them anytime later.

Thanks,

	tglx