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:	Mon, 2 Feb 2015 11:39:19 -0800
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Joe Perches <joe@...ches.com>
Cc:	Anshul Garg <aksgarg1989@...il.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	anshul.g@...sung.com
Subject: Re: [PATCH] lib/int_sqrt.c: Optimize square root function

On Mon, Feb 2, 2015 at 11:10 AM, Joe Perches <joe@...ches.com> wrote:
>
> Perhaps removing the while and using fls(x) would be better.

No. fls is often slow, and you then do have to also round it down to
an even bit number etc, so it gets somewhat complex too.

We *probably* have some argument range that we care more about, which
is why I'd like to know what the profile is that triggered this
optimization, and what the common argument range is.

For example, one user is the cpu frequency governor, which seems to
try to predict the length of the next sleep. The values can probably
be anything (it has protections for overflowing into "long long"), but
presumably the onyl time we care about performance is when it's called
very very often, in which case I'm going out on a limb and saying that
the intervals will be short, and the standard deviation of those
intervals will also be small. So *maybe* that function really only
cares about performance when we have small arguments. I dunno.

                        Linus
--
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