)]}'
{
  "commit": "8a2e8e5dec7e29c56a46ba176c664ab6a3d04118",
  "tree": "57da96451bead4986dfcd82aadf47ba2c05745ac",
  "parents": [
    "e41e704bc4f49057fc68b643108366e6e6781aa3"
  ],
  "author": {
    "name": "Tejun Heo",
    "email": "tj@kernel.org",
    "time": "Wed Aug 25 10:33:56 2010 +0200"
  },
  "committer": {
    "name": "Tejun Heo",
    "email": "tj@kernel.org",
    "time": "Wed Aug 25 10:33:56 2010 +0200"
  },
  "message": "workqueue: fix cwq-\u003enr_active underflow\n\ncwq-\u003enr_active is used to keep track of how many work items are active\nfor the cpu workqueue, where \u0027active\u0027 is defined as either pending on\nglobal worklist or executing.  This is used to implement the\nmax_active limit and workqueue freezing.  If a work item is queued\nafter nr_active has already reached max_active, the work item doesn\u0027t\nincrement nr_active and is put on the delayed queue and gets activated\nlater as previous active work items retire.\n\ntry_to_grab_pending() which is used in the cancellation path\nunconditionally decremented nr_active whether the work item being\ncancelled is currently active or delayed, so cancelling a delayed work\nitem makes nr_active underflow.  This breaks max_active enforcement\nand triggers BUG_ON() in destroy_workqueue() later on.\n\nThis patch fixes this bug by adding a flag WORK_STRUCT_DELAYED, which\nis set while a work item in on the delayed list and making\ntry_to_grab_pending() decrement nr_active iff the work item is\ncurrently active.\n\nThe addition of the flag enlarges cwq alignment to 256 bytes which is\ngetting a bit too large.  It\u0027s scheduled to be reduced back to 128\nbytes by merging WORK_STRUCT_PENDING and WORK_STRUCT_CWQ in the next\ndevel cycle.\n\nSigned-off-by: Tejun Heo \u003ctj@kernel.org\u003e\nReported-by: Johannes Berg \u003cjohannes@sipsolutions.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c959666eafca2a8acc8c31ef9eec1587a43a392a",
      "old_mode": 33188,
      "old_path": "include/linux/workqueue.h",
      "new_id": "f11100f964824c250b4eacb21e96e36640527ac6",
      "new_mode": 33188,
      "new_path": "include/linux/workqueue.h"
    },
    {
      "type": "modify",
      "old_id": "362b50d092e2a067ff5da7bbda6d6118537df5d8",
      "old_mode": 33188,
      "old_path": "kernel/workqueue.c",
      "new_id": "a2dccfca03ba7f122532f28519e134a4c63a92e5",
      "new_mode": 33188,
      "new_path": "kernel/workqueue.c"
    }
  ]
}
