)]}'
{
  "commit": "d6ad3e286d2c075a60b9f11075a2c55aeeeca2ad",
  "tree": "24f374a6cb1ef36c2aec41b9de6b8f3b1b09780d",
  "parents": [
    "48d50674179981e41f432167b2441cec782d5484"
  ],
  "author": {
    "name": "Jason Wessel",
    "email": "jason.wessel@windriver.com",
    "time": "Wed Jan 27 16:25:22 2010 -0600"
  },
  "committer": {
    "name": "Ingo Molnar",
    "email": "mingo@elte.hu",
    "time": "Mon Feb 01 08:22:32 2010 +0100"
  },
  "message": "softlockup: Add sched_clock_tick() to avoid kernel warning on kgdb resume\n\nWhen CONFIG_HAVE_UNSTABLE_SCHED_CLOCK is set, sched_clock() gets\nthe time from hardware such as the TSC on x86. In this\nconfiguration kgdb will report a softlock warning message on\nresuming or detaching from a debug session.\n\nSequence of events in the problem case:\n\n 1) \"cpu sched clock\" and \"hardware time\" are at 100 sec prior\n    to a call to kgdb_handle_exception()\n\n 2) Debugger waits in kgdb_handle_exception() for 80 sec and on\n    exit the following is called ...  touch_softlockup_watchdog() --\u003e\n    __raw_get_cpu_var(touch_timestamp) \u003d 0;\n\n 3) \"cpu sched clock\" \u003d 100s (it was not updated, because the\n    interrupt was disabled in kgdb) but the \"hardware time\" \u003d 180 sec\n\n 4) The first timer interrupt after resuming from\n    kgdb_handle_exception updates the watchdog from the \"cpu sched clock\"\n\nupdate_process_times() { ...  run_local_timers() --\u003e\nsoftlockup_tick() --\u003e check (touch_timestamp \u003d\u003d 0) (it is \"YES\"\nhere, we have set \"touch_timestamp \u003d 0\" at kgdb) --\u003e\n__touch_softlockup_watchdog() ***(A)--\u003e reset \"touch_timestamp\"\nto \"get_timestamp()\" (Here, the \"touch_timestamp\" will still be\nset to 100s.)  ...\n\n    scheduler_tick() ***(B)--\u003e sched_clock_tick() (update \"cpu sched\n    clock\" to \"hardware time\" \u003d 180s) ...  }\n\n 5) The Second timer interrupt handler appears to have a large\n    jump and trips the softlockup warning.\n\nupdate_process_times() { ...  run_local_timers() --\u003e\nsoftlockup_tick() --\u003e \"cpu sched clock\" - \"touch_timestamp\" \u003d\n180s-100s \u003e 60s --\u003e printk \"soft lockup error messages\" ...  }\n\nnote: ***(A) reset \"touch_timestamp\" to\n\"get_timestamp(this_cpu)\"\n\nWhy is \"touch_timestamp\" 100 sec, instead of 180 sec?\n\nWhen CONFIG_HAVE_UNSTABLE_SCHED_CLOCK is set, the call trace of\nget_timestamp() is:\n\nget_timestamp(this_cpu)\n --\u003ecpu_clock(this_cpu)\n --\u003esched_clock_cpu(this_cpu)\n --\u003e__update_sched_clock(sched_clock_data, now)\n\nThe __update_sched_clock() function uses the GTOD tick value to\ncreate a window to normalize the \"now\" values.  So if \"now\"\nvalue is too big for sched_clock_data, it will be ignored.\n\nThe fix is to invoke sched_clock_tick() to update \"cpu sched\nclock\" in order to recover from this state.  This is done by\nintroducing the function touch_softlockup_watchdog_sync(). This\nallows kgdb to request that the sched clock is updated when the\nwatchdog thread runs the first time after a resume from kgdb.\n\n[yong.zhang0@gmail.com: Use per cpu instead of an array]\nSigned-off-by: Jason Wessel \u003cjason.wessel@windriver.com\u003e\nSigned-off-by: Dongdong Deng \u003cDongdong.Deng@windriver.com\u003e\nCc: kgdb-bugreport@lists.sourceforge.net\nCc: peterz@infradead.org\nLKML-Reference: \u003c1264631124-4837-2-git-send-email-jason.wessel@windriver.com\u003e\nSigned-off-by: Ingo Molnar \u003cmingo@elte.hu\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6f7bba93929bf5c55434b6fb196af320087e9c11",
      "old_mode": 33188,
      "old_path": "include/linux/sched.h",
      "new_id": "89232151a9d03a6d7a4c628860143fb224792015",
      "new_mode": 33188,
      "new_path": "include/linux/sched.h"
    },
    {
      "type": "modify",
      "old_id": "2eb517e2351462bd263d8976cf3d2108ecfeebc2",
      "old_mode": 33188,
      "old_path": "kernel/kgdb.c",
      "new_id": "87f2cc557553c80e4eea5eb707b984a5deb36b57",
      "new_mode": 33188,
      "new_path": "kernel/kgdb.c"
    },
    {
      "type": "modify",
      "old_id": "d22579087e27a5bdb04e3962b117432c29497b33",
      "old_mode": 33188,
      "old_path": "kernel/softlockup.c",
      "new_id": "0d4c7898ab805dd868880e7deca2d0d69d88fc67",
      "new_mode": 33188,
      "new_path": "kernel/softlockup.c"
    }
  ]
}
