lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20090218210940.GA8094@redhat.com>
Date:	Wed, 18 Feb 2009 22:09:40 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	hpa@...or.com, mingo@...hat.com, shemminger@...tta.com,
	kaber@...sh.net, davem@...emloft.net, akpm@...ux-foundation.org,
	tglx@...utronix.de, linux-kernel@...r.kernel.org
Subject: Q: timer_stats_account_xtimer() should reset ->start_site?

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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ