lkml.org 
[lkml]   [2019]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 1/5] x86: tsc: add tsc to art helpers
Felipe,

On Tue, 16 Jul 2019, Felipe Balbi wrote:

-ENOCHANGELOG

As you said in the cover letter:

> (3) The change in arch/x86/kernel/tsc.c needs to be reviewed at length
> before going in.

So some information what those interfaces are used for and why they are
needed would be really helpful.

> +void get_tsc_ns(struct system_counterval_t *tsc_counterval, u64 *tsc_ns)
> +{
> + u64 tmp, res, rem;
> + u64 cycles;
> +
> + tsc_counterval->cycles = clocksource_tsc.read(NULL);
> + cycles = tsc_counterval->cycles;
> + tsc_counterval->cs = art_related_clocksource;
> +
> + rem = do_div(cycles, tsc_khz);
> +
> + res = cycles * USEC_PER_SEC;
> + tmp = rem * USEC_PER_SEC;
> +
> + do_div(tmp, tsc_khz);
> + res += tmp;
> +
> + *tsc_ns = res;
> +}
> +EXPORT_SYMBOL(get_tsc_ns);
> +
> +u64 get_art_ns_now(void)
> +{
> + struct system_counterval_t tsc_cycles;
> + u64 tsc_ns;
> +
> + get_tsc_ns(&tsc_cycles, &tsc_ns);
> +
> + return tsc_ns;
> +}
> +EXPORT_SYMBOL(get_art_ns_now);

While the changes look innocuous I'm missing the big picture why this needs
to emulate ART instead of simply using TSC directly.

Thanks,

tglx

\
 
 \ /
  Last update: 2019-07-16 09:58    [W:0.177 / U:2.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site