mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: Thought about credit_entropy_bits() math
       [not found] <5626B01F.9050305@linux.intel.com>
@ 2015-10-21 18:13 ` George Spelvin
  0 siblings, 0 replies; only message in thread
From: George Spelvin @ 2015-10-21 18:13 UTC (permalink / raw)
  To: hpa; +Cc: linux-kernel, tytso

(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.)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-21 18:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <5626B01F.9050305@linux.intel.com>
2015-10-21 18:13 ` Thought about credit_entropy_bits() math George Spelvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®