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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 09 Jun 2009 16:03:16 +0200
From:	Patrick McHardy <kaber@...sh.net>
To:	Jarek Poplawski <jarkao2@...il.com>
CC:	Stephen Hemminger <shemminger@...tta.com>,
	Antonio Almeida <vexwek@...il.com>,
	David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
	Martin Devera <devik@....cz>,
	Eric Dumazet <dada1@...mosbay.com>,
	Vladimir Ivashchenko <hazard@...ncoudi.com>,
	Badalian Vyacheslav <slavon@...telecom.ru>
Subject: Re: [PATCH iproute2 1/2] tc_core: Use double in tc_core_time2tick()

Jarek Poplawski wrote:
> Change 'time' parameters of tc_core_time2tick() and tc_core_time2big()
> from unsigned to double. It is especially needed to use in
> tc_calc_rtable() for kernels with increased psched ticks resolution,
> but even without this, it looks reasonable to avoid rounding here.

I would prefer to keep using integers, which are a lot easier to
analyze for rounding errors and overflows, besides having constant
granularity.

> -unsigned tc_core_time2tick(unsigned time)
> +unsigned tc_core_time2tick(double time)
>  {
> -	return time*tick_in_usec;
> +	return time * tick_in_usec + 0.5;

ceil()?

>  }

It seems inconsistent to have the time2tick() function take a
double, but return an unsigned from tick2time(). If we're going
to change this, please keep them symetrical (you could even use
floor() in tick2time() to make it more explicit).

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ