)]}'
{
  "commit": "dbb5daa347de068ce303416670bb9f859074ea88",
  "tree": "0b50246da8c83260b2a954a584d2ab1e276b47fe",
  "parents": [
    "77b7bd6697768231a93df41335f38de4023836a4"
  ],
  "author": {
    "name": "John Johansen",
    "email": "john.johansen@canonical.com",
    "time": "Tue Oct 25 01:18:41 2022 -0700"
  },
  "committer": {
    "name": "Cloud Image Release",
    "email": "cloud-image-release@prod.google.com",
    "time": "Fri Aug 22 10:14:09 2025 -0700"
  },
  "message": "apparmor: cache buffers on percpu list if there is lock contention\n\n[ Upstream commit ea9bae12d02819556db63348db8bd8441eb316f2 ]\n\ncommit df323337e507 (\"apparmor: Use a memory pool instead per-CPU caches\")\n\nchanged buffer allocation to use a memory pool, however on a heavily\nloaded machine there can be lock contention on the global buffers\nlock. Add a percpu list to cache buffers on when lock contention is\nencountered.\n\nWhen allocating buffers attempt to use cached buffers first,\nbefore taking the global buffers lock. When freeing buffers\ntry to put them back to the global list but if contention is\nencountered, put the buffer on the percpu list.\n\nThe length of time a buffer is held on the percpu list is dynamically\nadjusted based on lock contention.  The amount of hold time is\nincreased and decreased linearly.\n\nv5:\n- simplify base patch by removing: improvements can be added later\n  - MAX_LOCAL and must lock\n  - contention scaling.\nv4:\n- fix percpu -\u003ecount buffer count which had been spliced across a\n  debug patch.\n- introduce define for MAX_LOCAL_COUNT\n- rework count check and locking around it.\n- update commit message to reference commit that introduced the\n  memory.\nv3:\n- limit number of buffers that can be pushed onto the percpu\n  list. This avoids a problem on some kernels where one percpu\n  list can inherit buffers from another cpu after a reschedule,\n  causing more kernel memory to used than is necessary. Under\n  normal conditions this should eventually return to normal\n  but under pathelogical conditions the extra memory consumption\n  may have been unbouanded\nv2:\n- dynamically adjust buffer hold time on percpu list based on\n  lock contention.\nv1:\n- cache buffers on percpu list on lock contention\n\nBUG\u003db/437414032,b/440373491\nTEST\u003dpresubmit, go/sql-apparmor-spinlock-fix-verification\nRELEASE_NOTE\u003dNone\n\ncos-patch: bug\nReported-by: Sergey Senozhatsky \u003csenozhatsky@chromium.org\u003e\nReviewed-by: Georgia Garcia \u003cgeorgia.garcia@canonical.com\u003e\nChange-Id: I90dba49409979dfac00c820ba063d38256084d2a\nSigned-off-by: John Johansen \u003cjohn.johansen@canonical.com\u003e\nReviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/109265\nTested-by: Cusky Presubmit Bot \u003cpresubmit@cos-infra-prod.iam.gserviceaccount.com\u003e\nMain-Branch-Verified: Cusky Presubmit Bot \u003cpresubmit@cos-infra-prod.iam.gserviceaccount.com\u003e\nReviewed-by: Robert Kolchmeyer \u003crkolchmeyer@google.com\u003e\nReviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/109613\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5303a51eff9c10d04934f504270330e2b15cc418",
      "old_mode": 33188,
      "old_path": "security/apparmor/lsm.c",
      "new_id": "d7682f5db45b0fb44933ff09cee53e22ff9593ba",
      "new_mode": 33188,
      "new_path": "security/apparmor/lsm.c"
    }
  ]
}
