)]}'
{
  "commit": "a3f00298b035bbf9701d2f3db74bcadfb346a504",
  "tree": "42e35b883552aef8bded6bf34357013d34ea739a",
  "parents": [
    "bc4644bddd95499d03c9d7ac27b5c84059a8cc0e"
  ],
  "author": {
    "name": "Tejun Heo",
    "email": "tj@kernel.org",
    "time": "Thu May 18 11:25:58 2023 -1000"
  },
  "committer": {
    "name": "Tejun Heo",
    "email": "tj@kernel.org",
    "time": "Thu May 18 11:25:58 2023 -1000"
  },
  "message": "workqueue: Implement localize-to-issuing-CPU for unbound workqueues\n\nThe non-strict cache affinity scope provides a reasonable default behavior\nfor improving execution locality while avoiding strict utilization limits\nand the overhead of too-fine-grained scopes. However, it ignores L1/2\nlocality which may benefit some workloads.\n\nThis patch implements workqueue_attrs-\u003elocalize which, when turned on, tries\nto put the worker on the work item\u0027s issuing CPU when starting execution in\nthe same way non-strict cache affinity is implemented. As it uses the same\ntask_struct-\u003ewake_cpu, the same caveats apply. It isn\u0027t clear whether this\nis an acceptable use of the scheduler property and there is a small race\nwindow where the setting from position_worker() may be ignored.\n\nTo locate a worker on the work item\u0027s issuing CPU, we need to pre-assign the\nwork item to the worker before waking it up; otherwise, we can\u0027t know which\nexact worker the work item is going to be assigned to. For work items that\nrequest localization, this patch updates kick_pool() to pre-assign each work\nitem to an idle worker, exit the worker from the idle state before waking it\nup. In turn, worker_thread() directly proceeds to work item execution if\nIDLE was already clear when it woke up.\n\nTheoretically, localizing to the issuing CPU without any hard restrictions\nshould be the best option as it tells the scheduler the best CPU to use for\nlocality without any restrictions on future scheduler decisions. However, in\npractice, this doesn\u0027t work out that way due to loss of work conservation.\nAs such, this patch isn\u0027t for upstream yet. See the cover letter for further\ndiscussion.\n\nNOT_FOR_UPSTREAM\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4a8e764f41aeaed097a133bd4b436ab2b2e7ee71",
      "old_mode": 33188,
      "old_path": "Documentation/core-api/workqueue.rst",
      "new_id": "3a7b3b0e7196d5e885060fe57c3e7df9ca93514b",
      "new_mode": 33188,
      "new_path": "Documentation/core-api/workqueue.rst"
    },
    {
      "type": "modify",
      "old_id": "751eb915e3f0e3548badb7fada3eb9a0e7947e26",
      "old_mode": 33188,
      "old_path": "include/linux/workqueue.h",
      "new_id": "d989f95f664626f6fd2bb76976fb69c8ad659ce7",
      "new_mode": 33188,
      "new_path": "include/linux/workqueue.h"
    },
    {
      "type": "modify",
      "old_id": "4efb0bd6f2e00bdb0e4d391b9ccd2cfd03c674b9",
      "old_mode": 33188,
      "old_path": "kernel/workqueue.c",
      "new_id": "b2e914655f05c84c23ca792758f93d4bbfa5a6e2",
      "new_mode": 33188,
      "new_path": "kernel/workqueue.c"
    },
    {
      "type": "modify",
      "old_id": "d0df5833f2c1851a816b40ce9e308d5ac2cc9a0d",
      "old_mode": 33188,
      "old_path": "tools/workqueue/wq_dump.py",
      "new_id": "036fb89260a3b03944f2aca205e9792b88b0b07e",
      "new_mode": 33188,
      "new_path": "tools/workqueue/wq_dump.py"
    },
    {
      "type": "modify",
      "old_id": "a8856a9c45dcc954df5bf3587abfbb475afb8d9c",
      "old_mode": 33188,
      "old_path": "tools/workqueue/wq_monitor.py",
      "new_id": "a0b0cd50b629a0e933cdd251e6eb6d40609f3a35",
      "new_mode": 33188,
      "new_path": "tools/workqueue/wq_monitor.py"
    }
  ]
}
