しかし、最近の電力消費量制御機構は、CPU駆動クロック周波数を変更してしまう。すると TSC の値は何がなんだか判らなくなる… そこで、Linux Kernel 内部には cycles_2_ns() という関数があって、TSCの値をナノ秒に修正してくれる事になっている。
しかし、不幸はここに内包されていた
すごく簡単に言うと、TSCの値を必要な Scale Factor 倍すれば nano sec になる。しかし、TSCの値は nano sec に近い。当然 Scale Factor は 1.0 に近い、微妙な浮動小数点になってしまう。
そうだ! Scale Factor を分数で表そう!! SC/1024 で表現して、 SCを整数にしておけば、 SCを掛け算した後、 右に10bit シフトすれば済むよっ!!!
…この段階で何か嫌な予感がしなかったんだろうか、こいつらは…
-
compozz reblogged this from saitamanaka
-
faf04 reblogged this from yanma
-
m-enfants reblogged this from otsune
-
sorshi liked this
-
hirotamaki reblogged this from mug-g
-
mug-g reblogged this from otsune
-
wktksan reblogged this from otsune
-
ken0205 reblogged this from otsune
-
yanma reblogged this from otsune
-
ds9-garak reblogged this from otsune
-
sasagon reblogged this from otsune
-
kesera reblogged this from otsune
-
longroof reblogged this from otsune
-
tabasou reblogged this from otsune
-
yclipse reblogged this from otsune
-
hibinomisaki reblogged this from otsune
-
urihari liked this
-
taraxalive reblogged this from otsune
-
osamu2001 reblogged this from otsune
-
mteramoto reblogged this from otsune
-
wataruk reblogged this from otsune
-
maezonojp liked this
-
uessai reblogged this from otsune
-
gosunatxrea reblogged this from otsune
-
tommby reblogged this from otsune
-
nelnia liked this
-
tmbtter reblogged this from otsune
-
hagix reblogged this from otsune
-
ryujisnote reblogged this from otsune
-
exp777 reblogged this from otsune
-
kaery liked this
-
kaery reblogged this from otsune
-
smozzarella reblogged this from otsune
-
toshiyam reblogged this from knnr
-
knnr reblogged this from otsune
-
mamemomonga reblogged this from otsune
-
wizardblue reblogged this from otsune
-
otafood reblogged this from otsune
-
saitamanaka reblogged this from otsune
-
futureisfailed liked this
-
poochin reblogged this from otsune
-
otsune posted this
-
text-man reblogged this from otsune