alternative-live

しかし、最近の電力消費量制御機構は、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 シフトすれば済むよっ!!!

…この段階で何か嫌な予感がしなかったんだろうか、こいつらは…

  1. compozz reblogged this from saitamanaka
  2. faf04 reblogged this from yanma
  3. m-enfants reblogged this from otsune
  4. hirotamaki reblogged this from mug-g
  5. mug-g reblogged this from otsune
  6. wktksan reblogged this from otsune
  7. ken0205 reblogged this from otsune
  8. yanma reblogged this from otsune
  9. ds9-garak reblogged this from otsune
  10. sasagon reblogged this from otsune
  11. kesera reblogged this from otsune
  12. longroof reblogged this from otsune
  13. tabasou reblogged this from otsune
  14. yclipse reblogged this from otsune
  15. hibinomisaki reblogged this from otsune
  16. taraxalive reblogged this from otsune
  17. osamu2001 reblogged this from otsune
  18. mteramoto reblogged this from otsune
  19. wataruk reblogged this from otsune
  20. uessai reblogged this from otsune
  21. gosunatxrea reblogged this from otsune
  22. tommby reblogged this from otsune
  23. tmbtter reblogged this from otsune
  24. hagix reblogged this from otsune
  25. ryujisnote reblogged this from otsune
  26. exp777 reblogged this from otsune
  27. kaery reblogged this from otsune
  28. smozzarella reblogged this from otsune
  29. toshiyam reblogged this from knnr
  30. knnr reblogged this from otsune
  31. mamemomonga reblogged this from otsune
  32. wizardblue reblogged this from otsune
  33. otafood reblogged this from otsune
  34. saitamanaka reblogged this from otsune
  35. poochin reblogged this from otsune
  36. otsune posted this
  37. text-man reblogged this from otsune