)]}'
{
  "commit": "3e52417318473782012b236d0325bf7d2266a597",
  "tree": "74560d95539d4cc8081012ebd025235218021db6",
  "parents": [
    "7f83d174073234839aea176f265e517e0d50a1d2"
  ],
  "author": {
    "name": "Usama Arif",
    "email": "usama.arif@linux.dev",
    "time": "Thu May 21 03:29:26 2026 -0700"
  },
  "committer": {
    "name": "Steffen Klassert",
    "email": "steffen.klassert@secunet.com",
    "time": "Tue May 26 10:35:29 2026 +0200"
  },
  "message": "xfrm: move policy_bydst RCU sync from per-netns .exit to .pre_exit\n\nThe struct pernet_operations docstring in include/net/net_namespace.h\nexplicitly warns against blocking RCU primitives in .exit handlers:\n\n    Exit methods using blocking RCU primitives, such as\n    synchronize_rcu(), should be implemented via exit_batch.\n    [...]\n    Please, avoid synchronize_rcu() at all, where it\u0027s possible.\n\n    Note that a combination of pre_exit() and exit() can\n    be used, since a synchronize_rcu() is guaranteed between\n    the calls.\n\nxfrm_policy_fini() violates this: it calls synchronize_rcu() before\nfreeing the policy_bydst hash tables (so no RCU reader is mid-\ntraversal at free time), but runs from xfrm_net_ops.exit -- once per\nnamespace -- so a cleanup_net() of N namespaces pays N full RCU\ngrace periods serially.\n\nUse the documented pre_exit/exit split. Move the policy flush (and\nthe workqueue drains it depends on) into a new .pre_exit handler;\nxfrm_policy_fini() then runs in .exit and frees the hash tables\nafter the synchronize_rcu_expedited() that cleanup_net() guarantees\nbetween the two phases. Providing O(1) RCU grace periods per batch\ninstead of O(N).\n\nObserved on Linux 6.18 with a workload doing unshare(CLONE_NEWNET)\nat ~13/sec sustained: cleanup_net() and the netns_wq rescuer kthread\nboth stuck in xfrm_policy_fini()\u0027s synchronize_rcu(), \u003e300k struct\nnet accumulated in the cleanup queue, Percpu in /proc/meminfo climbed\nto 130+ GB on 256-CPU hosts, and memcg OOMs followed. setup_net and\n__put_net counts were balanced, ruling out a refcount leak.\n\nFixes: 069daad4f2ae (\"xfrm: Wait for RCU readers during policy netns exit\")\nSigned-off-by: Usama Arif \u003cusama.arif@linux.dev\u003e\nSigned-off-by: Steffen Klassert \u003csteffen.klassert@secunet.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "59968dcbafe1fcd6ab1cf15da55cfdea859b738a",
      "old_mode": 33188,
      "old_path": "net/xfrm/xfrm_policy.c",
      "new_id": "dd09d2063da2d68cd40b72d7a944ed24286b942d",
      "new_mode": 33188,
      "new_path": "net/xfrm/xfrm_policy.c"
    }
  ]
}
