)]}'
{
  "commit": "5c1ea08215f1f830dfaf4819a5f22efca41c3832",
  "tree": "1d52d7972969090cf6702f69b2e5c97a5bdc2613",
  "parents": [
    "deef325086c3897393b8f7d6bccd03405244fe18"
  ],
  "author": {
    "name": "Steven Rostedt",
    "email": "rostedt@goodmis.org",
    "time": "Sun May 25 11:13:32 2008 -0400"
  },
  "committer": {
    "name": "Thomas Gleixner",
    "email": "tglx@linutronix.de",
    "time": "Wed Jun 04 13:11:46 2008 +0200"
  },
  "message": "x86: enable preemption in delay\n\nThe RT team has been searching for a nasty latency. This latency shows\nup out of the blue and has been seen to be as big as 5ms!\n\nUsing ftrace I found the cause of the latency.\n\n   pcscd-2995  3dNh1 52360300us : irq_exit (smp_apic_timer_interrupt)\n   pcscd-2995  3dN.2 52360301us : idle_cpu (irq_exit)\n   pcscd-2995  3dN.2 52360301us : rcu_irq_exit (irq_exit)\n   pcscd-2995  3dN.1 52360771us : smp_apic_timer_interrupt (apic_timer_interrupt\n)\n   pcscd-2995  3dN.1 52360771us : exit_idle (smp_apic_timer_interrupt)\n\nHere\u0027s an example of a 400 us latency. pcscd took a timer interrupt and\nreturned with \"need resched\" enabled, but did not reschedule until after\nthe next interrupt came in at 52360771us 400us later!\n\nAt first I thought we somehow missed a preemption check in entry.S. But\nI also noticed that this always seemed to happen during a __delay call.\n\n   pcscd-2995  3dN.2 52360836us : rcu_irq_exit (irq_exit)\n   pcscd-2995  3.N.. 52361265us : preempt_schedule (__delay)\n\nLooking at the x86 delay, I found my problem.\n\nIn git commit 35d5d08a085c56f153458c3f5d8ce24123617faf, Andrew Morton\nplaced preempt_disable around the entire delay due to TSC\u0027s not working\nnicely on SMP.  Unfortunately for those that care about latencies this\nis devastating! Especially when we have callers to mdelay(8).\n\nHere I enable preemption during the loop and account for anytime the task\nmigrates to a new CPU. The delay asked for may be extended a bit by\nthe migration, but delay only guarantees that it will delay for that minimum\ntime. Delaying longer should not be an issue.\n\n[\n  Thanks to Thomas Gleixner for spotting that cpu wasn\u0027t updated,\n    and to place the rep_nop between preempt_enabled/disable.\n]\n\nSigned-off-by: Steven Rostedt \u003csrostedt@redhat.com\u003e\nCc: akpm@osdl.org\nCc: Clark Williams \u003cclark.williams@gmail.com\u003e\nCc: Peter Zijlstra \u003cpeterz@infradead.org\u003e\nCc: \"Luis Claudio R. Goncalves\" \u003clclaudio@uudg.org\u003e\nCc: Gregory Haskins \u003cghaskins@novell.com\u003e\nCc: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\nCc: Andi Kleen \u003candi-suse@firstfloor.org\u003e\nSigned-off-by: Thomas Gleixner \u003ctglx@linutronix.de\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4535e6d147adb11ffb570a9adcb4e08c6d638130",
      "old_mode": 33188,
      "old_path": "arch/x86/lib/delay_32.c",
      "new_id": "d710f2d167bb49505e56ed4c0e9c5cc91a52546e",
      "new_mode": 33188,
      "new_path": "arch/x86/lib/delay_32.c"
    },
    {
      "type": "modify",
      "old_id": "bbc610518516b11c4bdbe1d10dacd29ce41130c6",
      "old_mode": 33188,
      "old_path": "arch/x86/lib/delay_64.c",
      "new_id": "4c441be92641a3ae295c8dea3db10b86323e7de2",
      "new_mode": 33188,
      "new_path": "arch/x86/lib/delay_64.c"
    }
  ]
}
