)]}'
{
  "commit": "a6f29192b1e2bf93a6ab7c25c854307431124b8b",
  "tree": "102c841258ca4f246f7de2efdf390343dc85ddd2",
  "parents": [
    "fa796c53bdbc3c8619a6f8d7d2d530e4c2e76ba9"
  ],
  "author": {
    "name": "Nicolas Saenz Julienne",
    "email": "nsaenzju@redhat.com",
    "time": "Wed Oct 06 13:19:02 2021 +0200"
  },
  "committer": {
    "name": "Nicolas Saenz Julienne",
    "email": "nsaenzju@redhat.com",
    "time": "Thu Oct 07 20:03:57 2021 +0200"
  },
  "message": "mm/page_alloc: Add remote draining support to per-cpu lists\n\npage_alloc.c\u0027s per-cpu page lists are currently protected using local\nlocks. While performance savvy, this doesn\u0027t allow for remote access to\nthese structures. CPUs requiring system-wide per-cpu list drains get\naround this by scheduling drain work on all CPUs. That said, some select\nsetups like systems with NOHZ_FULL CPUs, aren\u0027t well suited to this, as\nthey can\u0027t handle interruptions of any sort.\n\nTo mitigate this introduce a new lock-less remote draining mechanism. It\nleverages the fact that the per-cpu page lists are accessed through\nindirection, and that the pointer can be updated atomically. It goes\nlike this:\n\n - Atomically switch the per-cpu lists pointers to ones pointing to an\n   empty list.\n\n - Wait for a grace period so as for all concurrent users of the old\n   per-cpu lists pointer to finish updating them. Note that whatever\n   they were doing, the result was going to be flushed anyway[1].\n\n - Remotely flush the old lists now that we know nobody is using them.\n   Once empty, these per-cpu lists will be used for the next drain.\n   Concurrent access to the drain process is protected by a mutex.\n\nRCU guarantees atomicity both while dereferencing the per-cpu lists\npointer and replacing it. It also checks for RCU critical\nsection/locking correctness, as all readers have to hold their per-cpu\npagesets local lock. Also, synchronize_rcu_expedited() is used to\nminimize hangs during low memory situations, without interrupting\nNOHZ_FULL CPUs, since they are in an extended quiescent state.\n\nAs a side effect to all this we now have to promote the spin_lock() in\nfree_pcppages_bulk() to spin_lock_irqsave() since not all function users\nenter with interrupts disabled.\n\nAccesses to the pcplists like the ones in mm/vmstat.c don\u0027t require RCU\nsupervision since they can handle outdated data.\n\nSigned-off-by: Nicolas Saenz Julienne \u003cnsaenzju@redhat.com\u003e\n\n[1] The old mechanism disabled preemption as the means for\n    serialization, so per-cpu drain works were already stepping over\n    whatever was being processed concurrently to the drain call.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "fb023da9a1819f1ff85b8a7235676d5fafe3e05d",
      "old_mode": 33188,
      "old_path": "include/linux/mmzone.h",
      "new_id": "c112e7831c54ff3d87fbb855b8eed6b533c13e50",
      "new_mode": 33188,
      "new_path": "include/linux/mmzone.h"
    },
    {
      "type": "modify",
      "old_id": "4da6fcb990ab8017a499ad76cd3f24cc343d61ca",
      "old_mode": 33188,
      "old_path": "mm/page_alloc.c",
      "new_id": "9ce9e4d3a2a453ed46d278df6c577f4b445623c9",
      "new_mode": 33188,
      "new_path": "mm/page_alloc.c"
    },
    {
      "type": "modify",
      "old_id": "5279d3f34e0b6cb12cd8bc3011a57ec8d8faa74c",
      "old_mode": 33188,
      "old_path": "mm/vmstat.c",
      "new_id": "1ffa4fc64a4f43f2b4becb18aac58cf89b0ff224",
      "new_mode": 33188,
      "new_path": "mm/vmstat.c"
    }
  ]
}
