linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov@parallels.com>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: <linux-kernel@vger.kernel.org>, <shawn@churchofgit.com>,
	<tglx@linutronix.de>, <akpm@linux-foundation.org>,
	<avagin@openvz.org>, <xemul@parallels.com>
Subject: Re: [patch 1/3] timerfd: Implement show_fdinfo method
Date: Tue, 8 Apr 2014 10:54:45 +0400	[thread overview]
Message-ID: <53439D35.3050201@parallels.com> (raw)
In-Reply-To: <20140408064223.GD23983@moon>

On 04/08/2014 10:42 AM, Cyrill Gorcunov wrote:
> On Tue, Apr 08, 2014 at 10:17:14AM +0400, Vladimir Davydov wrote:
> ...
>>> +static int timerfd_show(struct seq_file *m, struct file *file)
>>> +{
>>> +	struct timerfd_ctx *ctx = file->private_data;
>>> +	struct itimerspec t;
>>> +
>>> +	spin_lock_irq(&ctx->wqh.lock);
>>> +	t.it_value = ktime_to_timespec(timerfd_get_remaining(ctx));
>>> +	t.it_interval = ktime_to_timespec(ctx->tintv);
>>> +	spin_unlock_irq(&ctx->wqh.lock);
>>> +
>>> +	return seq_printf(m,
>>> +			  "clockid: %d\n"
>>> +			  "ticks: %llu\n"
>>> +			  "settime flags: 0%o\n"
>>> +			  "it_value: (%llu, %llu)\n"
>>> +			  "it_interval: (%llu, %llu)\n",
>> IMO, one would expect to setup the timer on restore by passing the
>> values of settime_flags, it_value, and it_interval obtained from the
>> fdinfo to sys_timerfd_settime, but this will be incorrect, because AFAIU
>> the it_value you report here is always relative to the current time, no
>> matter whether TFD_TIMER_ABSTIME was set in settime_flags or not. Is it OK?
> Hi Vladimir! Well it_value returns remaining time so it's up to user to
> adjust this value when restore with abs time. That said one can examinate
> if abs flag was set and restore accordingly. If this is vague I'm open
> to change it to more clear way. Ideas?

If it's intended, it should be documented explicitly I think. Currently
in the doc patch I see nothing about whether expiration time is absolute
or relative:

> 'it_value' and 'it_interval' are the expiration time and interval for the timer.

Thanks.

  reply	other threads:[~2014-04-08  6:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-07 17:47 [patch 0/3] timerfd -- implement missing parts to checkpoint and restore timerfd state, v2 Cyrill Gorcunov
2014-04-07 17:47 ` [patch 1/3] timerfd: Implement show_fdinfo method Cyrill Gorcunov
2014-04-08  6:17   ` Vladimir Davydov
2014-04-08  6:42     ` Cyrill Gorcunov
2014-04-08  6:54       ` Vladimir Davydov [this message]
2014-04-08  7:10         ` Cyrill Gorcunov
2014-04-07 17:47 ` [patch 2/3] docs: procfs -- Document timerfd output Cyrill Gorcunov
2014-04-08  7:43   ` [patch 2/3] docs: procfs -- Document timerfd output, v2 Cyrill Gorcunov
2014-04-08  7:52     ` Vladimir Davydov
2014-04-07 17:47 ` [patch 3/3] timerfd: Implement write method Cyrill Gorcunov
2014-04-28 20:53 ` [patch 0/3] timerfd -- implement missing parts to checkpoint and restore timerfd state, v2 Cyrill Gorcunov
2014-04-28 20:59   ` Thomas Gleixner
2014-04-28 21:03     ` Cyrill Gorcunov
  -- strict thread matches above, loose matches on Subject: below --
2014-04-28 21:25 [patch 0/3] timerfd -- implement missing parts to checkpoint and restore timerfd state, v3 Cyrill Gorcunov
2014-04-28 21:25 ` [patch 1/3] timerfd: Implement show_fdinfo method Cyrill Gorcunov
2014-05-21 21:41   ` Thomas Gleixner
2014-05-21 21:54     ` Cyrill Gorcunov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53439D35.3050201@parallels.com \
    --to=vdavydov@parallels.com \
    --cc=akpm@linux-foundation.org \
    --cc=avagin@openvz.org \
    --cc=gorcunov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shawn@churchofgit.com \
    --cc=tglx@linutronix.de \
    --cc=xemul@parallels.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).