All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: Ruben Safir <ruben@mrbrklyn.com>
Cc: kernelnewbies@kernelnewbies.org
Subject: Re: Do I need strong mathematical bases to work in the memory subsystem?
Date: Thu, 03 Oct 2019 12:51:44 -0400	[thread overview]
Message-ID: <71184.1570121504@turing-police> (raw)
In-Reply-To: <7374125a-646f-7057-347b-f17ef51e9865@mrbrklyn.com>


[-- Attachment #1.1: Type: text/plain, Size: 1852 bytes --]

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?

[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply	other threads:[~2019-10-03 16:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-29 22:48 Do I need strong mathematical bases to work in the memory subsystem? CRISTIAN ANDRES VARGAS GONZALEZ
2019-09-30  5:06 ` Valdis Klētnieks
2019-10-03  1:47   ` Ruben Safir
2019-10-03  3:35     ` Valdis Klētnieks
2019-10-03  3:42       ` Ruben Safir
2019-10-03  7:00         ` Greg KH
2019-10-03 10:55           ` Ruben Safir
2019-10-03 16:51             ` Valdis Klētnieks [this message]
2019-10-03 17:21               ` Sahil Gupta
2019-10-06  1:49         ` Grant Taylor
2019-10-16 15:18         ` Cindy Sue Causey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=71184.1570121504@turing-police \
    --to=valdis.kletnieks@vt.edu \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=ruben@mrbrklyn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.