)]}'
{
  "commit": "a2f0db2be27385211f033271d8b83e9caf362236",
  "tree": "15de9347d92427dd99d7566ccfcf7a787b12dc61",
  "parents": [
    "366bb4ab851137e669a2e7db7a45d73b39090249"
  ],
  "author": {
    "name": "Paul Jakma",
    "email": "paul.jakma@hpe.com",
    "time": "Thu Feb 25 16:41:56 2016 +0000"
  },
  "committer": {
    "name": "Paul Jakma",
    "email": "paul@quagga.net",
    "time": "Mon Jan 23 18:51:59 2017 +0000"
  },
  "message": "lib: track worst case # of cycles and don\u0027t allow granularity to go above\n\n* The workqueue code at present errs towards optimising the granularity\n  for throughput of queue items in runs.  This perhaps is at the cost\n  of risking excessive delays at times.  Make the workqueue take\n  worst-cases into account.\n\n* thread.c: (thread_should_yield) When thread should yield, we can\n  return the time taken for free, as it might be useful to caller.\n  work_queue_run\n\n* workqueue.h: (struct work_queue) Add fields for worst # of cycles,\n  and (independently) worst time taken.\n\n* workqueue.c: (work_queue_new) Worst starts high.\n\n  (work_queue_run) Track the worst number of cycles taken, where a\n  queue run had to yield before clearing out the queue.  Use this as an\n  upper-bound on the granularity, so the granulity can never increase.\n\n  Track the worst-case delay per work-queue, where it had to yield, thanks\n  to the thread_should_yield return value change.  Note that \"show thread\n  cpu\" already shows stats for the work_queue_run function, inc average and\n  worst cases.\n\nDeficiencies:\n\n- A spurious outside delay (e.g.  process not run in ages) could cause\n  \u0027worst\u0027 to be very low in some particular invocation of a process,\n  and it will stay that way for life of process.\n\n- The whole thing of trying to calculate suitable granularities is just\n  fragile and impossible to get 100% right.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b65078c6860d9b526c8b8e78107a6eb0e0350c62",
      "old_mode": 33188,
      "old_path": "lib/thread.c",
      "new_id": "de4d76d615227f8475fa87b428f1e196091087c3",
      "new_mode": 33188,
      "new_path": "lib/thread.c"
    },
    {
      "type": "modify",
      "old_id": "b1a5d5bfe53ef4778bdac378cb6aedba053a06a9",
      "old_mode": 33188,
      "old_path": "lib/workqueue.c",
      "new_id": "6453e7bb60cdb6b6c8adfe398fbc89b5d8c74cad",
      "new_mode": 33188,
      "new_path": "lib/workqueue.c"
    },
    {
      "type": "modify",
      "old_id": "5ad25893b279c0f0195770288badedb3d4a3d2c5",
      "old_mode": 33188,
      "old_path": "lib/workqueue.h",
      "new_id": "aac786058334d93641d0a9aa32941f52382e1072",
      "new_mode": 33188,
      "new_path": "lib/workqueue.h"
    }
  ]
}
