From: Oleg Nesterov <oleg@redhat.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: hpa@zytor.com, mingo@redhat.com, shemminger@vyatta.com,
kaber@trash.net, davem@davemloft.net, akpm@linux-foundation.org,
tglx@linutronix.de, linux-kernel@vger.kernel.org
Subject: Q: timer_stats_account_xtimer() should reset ->start_site?
Date: Wed, 18 Feb 2009 22:09:40 +0100 [thread overview]
Message-ID: <20090218210940.GA8094@redhat.com> (raw)
In-Reply-To: <tip-74019224ac34b044b44a31dd89a54e3477db4896@kernel.org>
On 02/18, Ingo Molnar wrote:
>
> +__mod_timer(struct timer_list *timer, unsigned long expires, bool pending_only)
> {
> struct tvec_base *base, *new_base;
> unsigned long flags;
> - int ret = 0;
> + int ret;
> +
> + ret = 0;
>
> timer_stats_timer_set_start_info(timer);
> BUG_ON(!timer->function);
> @@ -603,6 +606,9 @@ int __mod_timer(struct timer_list *timer, unsigned long expires)
> if (timer_pending(timer)) {
> detach_timer(timer, 0);
> ret = 1;
> + } else {
> + if (pending_only)
> + goto out_unlock;
At first glance, I thought this is not exactly right wrt timer stats when
__mod_timer(pending_only => true) fails.
But it turns out, I just can't understand the behaviour of /proc/timer_stats.
The first task which does __mod_timer() fills ->start_site/etc, this info
is cleared by del_timer(). This looks correct.
But when __run_hrtimer/__run_timers report this timer to /proc/timer_stats
we don't clear this info. If the timer expires, and then another task uses
the same timer, timer_stats will report the same ->start_site/pid twice.
Is it correct? Perhaps timer_stats_account_timer() should reset start_site?
Or we can kill the "if (timer->start_site)" in _set_start_info().
Or I missed something. Hmm... and del_timer_sync() doesn't clear start_site.
Confused, please help.
Oleg.
parent reply other threads:[~2009-02-18 21:13 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <tip-74019224ac34b044b44a31dd89a54e3477db4896@kernel.org>]
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=20090218210940.GA8094@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=hpa@zytor.com \
--cc=kaber@trash.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=shemminger@vyatta.com \
--cc=tglx@linutronix.de \
/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