Do I need strong mathematical bases to work in the memory subsystem?

Valdis Kl=?utf-8?Q?=c4=93?=tnieks valdis.kletnieks at vt.edu
Thu Oct 3 12:51:44 EDT 2019


On Thu, 03 Oct 2019 06:55:50 -0400, Ruben Safir said:

> I wouldn't call that C code basic.  Regardless, showing an example of a
> driver that doesn't need math, and it might if you understood the high
> level math, and your not aware of it, but predictive branching would
> need it.  

See the kernel code that maintains statistical data on likely()/unlikely()
under CONFIG_PROFILE_ANNOTATED_BRANCHES. Seems like "this likely() actually
only triggers 3% of the time" isn't exactly higher math.

There may be some magic going on in the chip hardware - but that's in the
*hardware* and inaccessible to the programmer.  I'll also point out that
speculative execution has *other* problems.....

> You can not calculate simple interest efficiently without calculus. 

Simple interest is *easy*.  Amount * percent.  Done.  It's compound interest
that only sort of needs calculus (and there only to understand the limiting
case) - and even there I doubt any banks actually use calculus, just apply the
iterative approach.

//  yearly interest compounded monthly
for (i=0;i<num_months;i++) { balance += (balance * percent) /12;}

I'd like to see you do it more efficiently using calculus. Especially if you
have to take into account rounding to the nearest penny 36 times for a 3
year loan.  That stuff is why COBOL is still around. :)

> calculus.  This repeadely ends up being an issue of "if I don't know it,
> I don't need it", which is wrong.  More math helps you every time.  Math

Somehow I doubt that the Taniyama-Shimura-Weil conjecture is ever
going to have any relevance inside the kernel.

> is advanced logic.  I can't tell you how many times I see folks brute
> force their way to solutions that they should be using integration.

Can you show an example of where the kernel needs to be using integration?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20191003/ad3d5abb/attachment.sig>


More information about the Kernelnewbies mailing list