)]}'
{
  "commit": "6ebcf5074cff0402730c6981d2397139fee6322d",
  "tree": "686df3c240a48183eaf71f50a117ddcd15f121aa",
  "parents": [
    "8c9190bfd18a2548dea677faed7d6ee11f3cb0c8"
  ],
  "author": {
    "name": "Ilya Maximets",
    "email": "i.maximets@ovn.org",
    "time": "Wed Sep 02 22:30:41 2026 +0200"
  },
  "committer": {
    "name": "Jakub Kicinski",
    "email": "kuba@kernel.org",
    "time": "Thu Sep 03 17:46:43 2026 -0700"
  },
  "message": "net: openvswitch: don\u0027t schedule rebalancing if there are no datapaths\n\nDuring namespace initialization the masks rebalancing work is\nscheduled and automatically re-scheduled every 4 seconds afterwards.\nThis is happening in every namespace.  On a large kubernetes node with\n500 pods, i.e., 500+ namespaces, this creates a decent amount of\nunnecessary churn scheduling 500 jobs every 4 seconds that take the\nmutex, check that there are no datapaths in their namespace, release\nthe mutex, re-schedule themselves and exit.  These 500 unnecessary\nmutex locks may hold off operations in a single namespace that\nactually has a datapath configured and has real user requests to\nhandle under this lock.  They can also add delay to removal of other\nnamespaces as ovs_exit_net() needs to take that lock as well and\nsynchronously waits for the work to be cancelled.\n\nLet\u0027s only fire the job when the first datapath is actually created\nand not re-arm it if there are no more datapaths configured in the\nnamespace.\n\nAnother approach would be to make ovs_mutex per-namespace, but it\u0027s\na much larger change that should be handled separately, and the\nunnecessary work scheduling feels like a waste regardless.\n\nIt\u0027s safe to check and re-arm outside of the mutex as DP_CMD_NEW\nhandler will re-arm if the new datapath appears.  The scheduling\nattempt also doesn\u0027t change the work or delay if it is already queued,\nso it\u0027s also safe to call multiple times.\n\nSkipping the re-arming is more elegant than canceling on removal of\nthe last datapath as it allows us to not think about potential race\nconditions at a negligible cost of potentially one extra re-scheduling.\n\nmsecs_to_jiffies() moved to the macro to save on line length.\n\nSigned-off-by: Ilya Maximets \u003ci.maximets@ovn.org\u003e\nAcked-by: Eelco Chaudron \u003cechaudro@redhat.com\u003e\nLink: https://patch.msgid.link/20260902203200.1416026-1-i.maximets@ovn.org\nSigned-off-by: Jakub Kicinski \u003ckuba@kernel.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "631a03136fa142b6457b4ccd8572f5558b497e32",
      "old_mode": 33188,
      "old_path": "net/openvswitch/datapath.c",
      "new_id": "218703414325524440f4a3d211ad5e722d085c71",
      "new_mode": 33188,
      "new_path": "net/openvswitch/datapath.c"
    },
    {
      "type": "modify",
      "old_id": "b2c2b8da12d40bf630062aa1db6827cffcc39428",
      "old_mode": 33188,
      "old_path": "net/openvswitch/datapath.h",
      "new_id": "7a7afaeceee5ee062a2a6640b214c4ff65cb5c91",
      "new_mode": 33188,
      "new_path": "net/openvswitch/datapath.h"
    }
  ]
}
