[Devel] [PATCH rh7] ve: Add interface for @start_timespec and @real_start_timespec adjustmen
Vladimir Davydov
vdavydov at virtuozzo.com
Tue Feb 9 02:02:09 PST 2016
On Mon, Feb 08, 2016 at 11:32:12AM +0300, Cyrill Gorcunov wrote:
> +static int ve_ts_read(struct cgroup *cg, struct cftype *cft, struct seq_file *m)
> +{
> + struct ve_struct *ve = cgroup_ve(cg);
> + struct timespec ts, *delta;
> +
> + do_posix_clock_monotonic_gettime(&ts);
> + if (cft->private == VE_CF_START_TIMESPEC) {
> + delta = &ve->start_timespec;
> + } else if (cft->private == VE_CF_REAL_START_TIMESPEC) {
> + delta = &ve->real_start_timespec;
> + monotonic_to_bootbased(&ts);
> + } else {
> + delta = &ts;
> + memset(&ts, 0, sizeof(ts));
> + WARN_ON_ONCE(1);
> + }
> +
> + set_normalized_timespec(&ts, ts.tv_sec - delta->tv_sec,
> + ts.tv_nsec - delta->tv_nsec);
> + seq_printf(m, "%ld %ld", ts.tv_sec, ts.tv_nsec);
> + return 0;
> +}
So the output of ve.start_timespec is going to evolve over time, right?
This looks weird to me. Wouldn't it be better if we returned the
timespec as is?
More information about the Devel
mailing list