)]}'
{
  "commit": "b7e4e85337060354f8b860cc38066725559313a4",
  "tree": "bdb958c6002fee2d73ed51e78d71dc663d2ad297",
  "parents": [
    "f0fbd5fc09b20f7ba7bc8c80be33e39925bb38e1"
  ],
  "author": {
    "name": "Paulo Marques",
    "email": "pmarques@grupopie.com",
    "time": "Thu May 05 16:15:49 2005 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@ppc970.osdl.org",
    "time": "Thu May 05 16:36:41 2005 -0700"
  },
  "message": "[PATCH] setitimer timer expires too early\n\nIt seems that the code responsible for this is in kernel/itimer.c:126:\n\n\tp-\u003esignal-\u003ereal_timer.expires \u003d jiffies + interval;\n\tadd_timer(\u0026p-\u003esignal-\u003ereal_timer);\n\nIf you request an interval of, lets say 900 usecs, the interval given by\ntimeval_to_jiffies will be 1.\n\nIf you request this when we are half-way between two timer ticks, the\ninterval will only give 400 usecs.\n\nIf we want to guarantee that we never ever give intervals less than\nrequested, the simple solution would be to change that to:\n\n\tp-\u003esignal-\u003ereal_timer.expires \u003d jiffies + interval + 1;\n\nThis however will produce pathological cases, like having a idle system\nbeing requested 1 ms timeouts will give systematically 2 ms timeouts,\nwhereas currently it simply gives a few usecs less than 1 ms.\n\nThe complex (and more computationally expensive) solution would be to\ncheck the gettimeofday time, and compute the correct number of jiffies.\nThis way, if we request a 300 usecs timer 200 usecs inside the timer\ntick, we can wait just one tick, but not if we are 800 usecs inside the\ntick. This would also mean that we would have to lock preemption during\nthese computations to avoid races, etc.\n\nI\u0027ve searched the archives but couldn\u0027t find this particular issue being\ndiscussed before.\n\nAttached is a patch to do the simple solution, in case anybody thinks\nthat it should be used.\n\nSigned-Off-By: Paulo Marques \u003cpmarques@grupopie.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e9a40e947e079615650c2491eddf7d7b35fdea9f",
      "old_mode": 33188,
      "old_path": "kernel/itimer.c",
      "new_id": "1dc988e0d2c77e962063c776b7b035800f51b9be",
      "new_mode": 33188,
      "new_path": "kernel/itimer.c"
    }
  ]
}
