Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1253103 > unrolled thread

Re: Thought about credit_entropy_bits() math

Started by"George Spelvin" <linux@horizon.com>
First post2015-10-21 20:20 +0200
Last post2015-10-21 20:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Thought about credit_entropy_bits() math "George Spelvin" <linux@horizon.com> - 2015-10-21 20:20 +0200

#1253103 — Re: Thought about credit_entropy_bits() math

From"George Spelvin" <linux@horizon.com>
Date2015-10-21 20:20 +0200
SubjectRe: Thought about credit_entropy_bits() math
Message-ID<qm69r-2wo-9@gated-at.bofh.it>
(Resend because I can't spell "kernel.org".)

H. Peter Anvin wrote:
> The main advantage with this approximation is that it doesn't need a
> multiplication instruction.  Instead, it can be implemented with two
> shifts and a subtract on hardware for which multiplication is slow.

Er...  I'm as addicted to micro-optimization as anyone, which is why
I posted all those various approximations, but I'm taking about going
from one to two, not zero to one.

The current approximaion is used right in the middle of a non-constant
multiply:
	unsigned int add = ((pool_size - entropy_count)*anfrac*3) >> s;


(Does Linux even run on any hardware without a multiply instruction?
There are tons of multiplies all over the scheduler.  The worst cases
I can think of just have slow bitwise multiplies: the nommu 68000 and
SPARCv7's multiply step.)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web