| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/07/23 02:27 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": [
"MEMORY_HOTPLUG",
"MEMORY_HOTREMOVE"
],
"FocusSymbols": [
"offline_pages"
],
"Reasoning": "The patch modifies the core memory hotplug logic in `offline_pages` to limit the number of migration passes during memory offlining. This is a functional change that can be reached when memory is offlined.",
"WorthFuzzing": true
} |
| 1/1 | 2026/07/23 02:27 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 530b32145286f653fec4b1945edd79921220bafc\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Thu Jul 23 02:27:03 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt\nindex 53f08950a63096..90b67c457c2a82 100644\n--- a/Documentation/admin-guide/kernel-parameters.txt\n+++ b/Documentation/admin-guide/kernel-parameters.txt\n@@ -3980,6 +3980,20 @@ Kernel parameters\n \t\t\tNote that even when enabled, there are a few cases where\n \t\t\tthe feature is not effective.\n \n+\tmemory_hotplug.offline_migrate_max_passes=\n+\t\t\t[KNL] Maximum number of migration passes\n+\t\t\tfor memory offlining.\n+\t\t\tFormat: \u003cinteger\u003e\n+\t\t\tdefault: 0 (no limit, historical behaviour)\n+\t\t\tWhen non-zero, memory offlining gives up with\n+\t\t\t-EBUSY after this many migration passes over\n+\t\t\tthe range, instead of retrying forever on a\n+\t\t\tstuck page. Each pass scans the range and\n+\t\t\tmigrates what it can.\n+\t\t\tThe parameter is re-read on every pass, so an\n+\t\t\toffline request that is already stuck can be\n+\t\t\trescued at runtime by writing the parameter.\n+\n \tmemtest=\t[KNL,X86,ARM,M68K,PPC,RISCV,EARLY] Enable memtest\n \t\t\tFormat: \u003cinteger\u003e\n \t\t\tdefault : 0 \u003cdisable\u003e\ndiff --git a/Documentation/admin-guide/mm/memory-hotplug.rst b/Documentation/admin-guide/mm/memory-hotplug.rst\nindex 0207f87251421c..79b45109c408c8 100644\n--- a/Documentation/admin-guide/mm/memory-hotplug.rst\n+++ b/Documentation/admin-guide/mm/memory-hotplug.rst\n@@ -224,7 +224,10 @@ increases memory offlining reliability; still, memory offlining can fail in\n some corner cases.\n \n Further, memory offlining might retry for a long time (or even forever), until\n-aborted by the user.\n+aborted by the user. The ``memory_hotplug.offline_migrate_max_passes``\n+parameter can be used to bound the number of retry passes, making an offline\n+request that cannot make progress fail with ``-EBUSY`` instead of retrying\n+indefinitely (see `Module Parameters`_).\n \n Offlining of a memory block can be triggered via::\n \n@@ -547,6 +550,27 @@ The following module parameters are currently defined:\n \t\t\t\t possible.\n \n \t\t\t\t Parameter availability depends on CONFIG_NUMA.\n+``offline_migrate_max_passes``\t read-write: Maximum number of migration\n+\t\t\t\t passes for a single memory offline\n+\t\t\t\t request. Memory offlining retries to\n+\t\t\t\t migrate and isolate pages until it succeeds;\n+\t\t\t\t a page that can never be migrated or freed\n+\t\t\t\t makes it retry forever. When this parameter\n+\t\t\t\t is non-zero, an offline request gives up\n+\t\t\t\t with ``-EBUSY`` after the configured number\n+\t\t\t\t of migration passes and the memory block\n+\t\t\t\t stays online.\n+\n+\t\t\t\t The parameter is re-read on every pass, so\n+\t\t\t\t an offline request that is already stuck\n+\t\t\t\t retrying can be rescued at runtime by\n+\t\t\t\t writing a non-zero value, without a reboot.\n+\n+\t\t\t\t The default is \"0\", meaning no limit (the\n+\t\t\t\t historical behaviour).\n+\n+\t\t\t\t Parameter availability depends on\n+\t\t\t\t CONFIG_MEMORY_HOTREMOVE.\n ================================ ===============================================\n \n ZONE_MOVABLE\ndiff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c\nindex 226ab9cb078ad1..9067829349a0da 100644\n--- a/mm/memory_hotplug.c\n+++ b/mm/memory_hotplug.c\n@@ -1785,6 +1785,12 @@ bool mhp_range_allowed(u64 start, u64 size, bool need_mapping)\n }\n \n #ifdef CONFIG_MEMORY_HOTREMOVE\n+/* Max offline_pages() migration passes before -EBUSY; 0 = retry forever. */\n+static unsigned int offline_migrate_max_passes __read_mostly;\n+module_param(offline_migrate_max_passes, uint, 0644);\n+MODULE_PARM_DESC(offline_migrate_max_passes,\n+\t\"Max migration passes before memory offline gives up (0 = no limit)\");\n+\n /*\n * Scan pfn range [start,end) to find movable/migratable pages (LRU and\n * hugetlb folio, movable_ops pages). Will skip over most unmovable\n@@ -1966,6 +1972,8 @@ int offline_pages(unsigned long start_pfn, unsigned long nr_pages,\n \tstruct node_notify node_arg = {\n \t\t.nid = NUMA_NO_NODE,\n \t};\n+\tunsigned int max_passes;\n+\tunsigned int pass = 0;\n \tunsigned long flags;\n \tchar *reason;\n \tint ret;\n@@ -2062,6 +2070,36 @@ int offline_pages(unsigned long start_pfn, unsigned long nr_pages,\n \t\t\t\tgoto failed_removal_isolated;\n \t\t\t}\n \n+\t\t\t/*\n+\t\t\t * A page that can never be migrated (e.g. a\n+\t\t\t * long-term pin) makes this loop retry forever.\n+\t\t\t * Give up after the configured number of passes.\n+\t\t\t * The limit is re-read on every pass so that an\n+\t\t\t * offline request that is already stuck here can\n+\t\t\t * be aborted at runtime by writing the parameter,\n+\t\t\t * which matters for in-kernel callers (e.g. ACPI\n+\t\t\t * DIMM hot-unplug) that run on kworkers and can\n+\t\t\t * never be aborted by a signal.\n+\t\t\t */\n+\t\t\tmax_passes = READ_ONCE(offline_migrate_max_passes);\n+\t\t\tif (max_passes \u0026\u0026 pass++ \u003e= max_passes) {\n+\t\t\t\tpr_warn(\"memory offlining [mem %#010llx-%#010llx]: giving up after %u passes\\n\",\n+\t\t\t\t\t(unsigned long long)start_pfn \u003c\u003c PAGE_SHIFT,\n+\t\t\t\t\t((unsigned long long)end_pfn \u003c\u003c PAGE_SHIFT) - 1,\n+\t\t\t\t\tpass - 1);\n+\t\t\t\t/*\n+\t\t\t\t * Dump the page we last stopped at as a\n+\t\t\t\t * diagnostic hint: usually the stuck page,\n+\t\t\t\t * but just the range start after a restart.\n+\t\t\t\t */\n+\t\t\t\tif (pfn \u003e= start_pfn \u0026\u0026 pfn \u003c end_pfn)\n+\t\t\t\t\tdump_page(pfn_to_page(pfn),\n+\t\t\t\t\t\t \"memory offline retry limit\");\n+\t\t\t\tret = -EBUSY;\n+\t\t\t\treason = \"retry limit exceeded\";\n+\t\t\t\tgoto failed_removal_isolated;\n+\t\t\t}\n+\n \t\t\tcond_resched();\n \n \t\t\tret = scan_movable_pages(pfn, end_pfn, \u0026pfn);\ndiff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile\nindex eae504bd94c83a..e113f3ff465594 100644\n--- a/tools/testing/selftests/mm/Makefile\n+++ b/tools/testing/selftests/mm/Makefile\n@@ -177,6 +177,9 @@ TEST_PROGS += ksft_vmalloc.sh\n # Destructive: every successful run panics the kernel. Installed and\n # kept executable, but not run from a default kselftest invocation.\n TEST_PROGS_EXTENDED += hwpoison-panic.sh\n+# Spawns its own VM (virtme-ng); not run from a default kselftest\n+# invocation.\n+TEST_PROGS_EXTENDED += vmtest_memory_hotplug.sh\n \n TEST_FILES := test_vmalloc.sh\n TEST_FILES += test_hmm.sh\ndiff --git a/tools/testing/selftests/mm/config b/tools/testing/selftests/mm/config\nindex 06f78bd232e2e3..d22f63eb9c2c9e 100644\n--- a/tools/testing/selftests/mm/config\n+++ b/tools/testing/selftests/mm/config\n@@ -14,3 +14,6 @@ CONFIG_UPROBES=y\n CONFIG_MEMORY_FAILURE=y\n CONFIG_HWPOISON_INJECT=m\n CONFIG_PROC_MEM_ALWAYS_FORCE=y\n+CONFIG_MEMORY_HOTPLUG=y\n+CONFIG_MEMORY_HOTREMOVE=y\n+CONFIG_ACPI_HOTPLUG_MEMORY=y\ndiff --git a/tools/testing/selftests/mm/vmtest_memory_hotplug.sh b/tools/testing/selftests/mm/vmtest_memory_hotplug.sh\nnew file mode 100755\nindex 00000000000000..c211a0e7caa2d3\n--- /dev/null\n+++ b/tools/testing/selftests/mm/vmtest_memory_hotplug.sh\n@@ -0,0 +1,369 @@\n+#!/bin/bash\n+# SPDX-License-Identifier: GPL-2.0\n+#\n+# Test memory_hotplug.offline_migrate_max_passes by reproducing the ACPI\n+# memory hot-unplug hang in kworker context and verifying that the retry\n+# limit recovers from it.\n+#\n+# offline_pages() retries page migration in an unbounded loop. A page\n+# that can never be migrated (long-term pin, slab, busy metadata) makes\n+# the loop spin forever. Userspace-driven offlines can be interrupted by\n+# a signal, but an ACPI DIMM eject runs on the kacpi_hotplug_wq kworker\n+# where signal_pending() never fires, so the kworker hangs until reboot.\n+#\n+# Flow:\n+# 1. Boot the just-built kernel (virtme-ng) with a cold-plugged pc-dimm.\n+# 2. Online the DIMM's blocks as ZONE_MOVABLE.\n+# 3. Pin one page of the DIMM (vmsplice long-term pin).\n+# 4. Eject the DIMM via sysfs; offline runs on kacpi_hotplug_wq.\n+# 5. Observe the hang (going-offline persists).\n+# 6. Rescue: write offline_migrate_max_passes at runtime, verify bailout.\n+#\n+# TAP subtests:\n+# 1 ACPI eject kworker hangs unbounded in offline_pages()\n+# 2 stuck offline rescued by writing offline_migrate_max_passes\n+# 3 memory block online and usable after the bailout\n+#\n+# Dependencies: virtme-ng (vng), qemu-system-\u003carch\u003e, cc.\n+# SKIPs (never FAILs) when tooling or kernel support is missing.\n+\n+readonly SCRIPT_DIR=\"$(cd -P -- \"$(dirname -- \"${BASH_SOURCE[0]}\")\" \u0026\u0026 pwd -P)\"\n+readonly KERNEL_CHECKOUT=\"$(realpath \"${SCRIPT_DIR}\"/../../../../)\"\n+\n+# shellcheck source=../kselftest/ktap_helpers.sh\n+source \"${SCRIPT_DIR}\"/../kselftest/ktap_helpers.sh\n+\n+readonly DIMM_SIZE=\"${DIMM_SIZE:-256M}\"\n+readonly MAX_PASSES=\"${MAX_PASSES:-50}\"\n+readonly HANG_HOLD=\"${HANG_HOLD:-10}\"\n+readonly RESCUE_TIMEOUT=\"${RESCUE_TIMEOUT:-30}\"\n+readonly BOOT_TIMEOUT=\"${BOOT_TIMEOUT:-240}\"\n+\n+readonly LOG=\"$(mktemp /tmp/vmtest_mhp_XXXXXX.log)\"\n+readonly GUEST_SCRIPT=\"$(mktemp /tmp/vmtest_mhp_guest_XXXXXX.sh)\"\n+readonly PIN_SRC=\"$(mktemp /tmp/vmtest_mhp_pin_XXXXXX.c)\"\n+# Must live in the kernel tree so the guest sees it through the 9p rootfs.\n+readonly PIN_BIN=\"${SCRIPT_DIR}/.vmtest_pin_park.$$\"\n+\n+VNG_PID=\"\"\n+\n+cleanup() {\n+\t[ -n \"${VNG_PID}\" ] \u0026\u0026 kill \"${VNG_PID}\" 2\u003e/dev/null\n+\trm -f \"${LOG}\" \"${GUEST_SCRIPT}\" \"${PIN_SRC}\" \"${PIN_BIN}\"\n+}\n+\n+guest_result() {\n+\tgrep -o \"^${1}=[A-Za-z0-9_-]*\" \"${LOG}\" | tail -1 | cut -d= -f2\n+}\n+\n+dump_log_tail() {\n+\ttail -25 \"${LOG}\" | while IFS= read -r line; do\n+\t\tktap_print_msg \"${line}\"\n+\tdone\n+}\n+\n+skip_all_tests() {\n+\tlocal i\n+\n+\tfor i in 1 2 3; do\n+\t\tktap_test_skip \"$1\"\n+\tdone\n+\tktap_finished\n+}\n+\n+# -- pre-flight checks -------------------------------------------------------\n+\n+ktap_print_header\n+ktap_set_plan 3\n+trap cleanup EXIT\n+\n+arch=\"$(uname -m)\"\n+case \"${arch}\" in\n+x86_64|aarch64) ;;\n+*)\tskip_all_tests \"pc-dimm ACPI hotplug not available on ${arch}\" ;;\n+esac\n+\n+for dep in vng \"qemu-system-${arch}\" cc; do\n+\tif ! command -v \"${dep}\" \u003e/dev/null 2\u003e\u00261; then\n+\t\tskip_all_tests \"${dep} not installed\"\n+\tfi\n+done\n+\n+# -- pin helper (compiled on the host, visible to the guest via 9p) -----------\n+#\n+# Allocate one block's worth of pages (ZONE_MOVABLE serves them from the\n+# DIMM), find one that landed in a target block, vmsplice-pin it into a\n+# pipe, print PIN_BLK=\u003cN\u003e, and sleep forever.\n+\n+cat \u003e \"${PIN_SRC}\" \u003c\u003c'PINEOF'\n+#define _GNU_SOURCE\n+#include \u003cfcntl.h\u003e\n+#include \u003cstdint.h\u003e\n+#include \u003cstdio.h\u003e\n+#include \u003cstdlib.h\u003e\n+#include \u003cstring.h\u003e\n+#include \u003cunistd.h\u003e\n+#include \u003csys/mman.h\u003e\n+#include \u003csys/uio.h\u003e\n+\n+static unsigned long memory_block_size(void)\n+{\n+\tchar buf[64];\n+\tssize_t n;\n+\tint fd;\n+\n+\tfd = open(\"/sys/devices/system/memory/block_size_bytes\", O_RDONLY);\n+\tif (fd \u003c 0)\n+\t\treturn 0;\n+\tn = read(fd, buf, sizeof(buf) - 1);\n+\tclose(fd);\n+\tif (n \u003c= 0)\n+\t\treturn 0;\n+\tbuf[n] = '\\0';\n+\treturn strtoul(buf, NULL, 16);\n+}\n+\n+static unsigned long vaddr_to_block(int pagemap_fd, char *vaddr,\n+\t\t\t\t long page_size, unsigned long blk_size)\n+{\n+\tunsigned long vpn = (unsigned long)vaddr / page_size;\n+\tuint64_t ent;\n+\n+\tif (pread(pagemap_fd, \u0026ent, sizeof(ent), vpn * 8) != sizeof(ent))\n+\t\treturn -1UL;\n+\tif (!(ent \u0026 (1ULL \u003c\u003c 63)))\n+\t\treturn -1UL;\n+\treturn (ent \u0026 ((1ULL \u003c\u003c 55) - 1)) * page_size / blk_size;\n+}\n+\n+int main(int argc, char **argv)\n+{\n+\tlong page_size = sysconf(_SC_PAGESIZE);\n+\tunsigned long blk_size = memory_block_size();\n+\tunsigned long off, blk = 0;\n+\tchar *area, *page = NULL;\n+\tint pagemap_fd, pipefd[2], i;\n+\n+\tif (argc \u003c 2 || !blk_size) {\n+\t\tfprintf(stderr, \"usage: pin_park \u003cmemory block\u003e...\\n\");\n+\t\treturn 1;\n+\t}\n+\n+\tarea = mmap(NULL, blk_size, PROT_READ | PROT_WRITE,\n+\t\t MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE, -1, 0);\n+\tif (area == MAP_FAILED) {\n+\t\tperror(\"mmap\");\n+\t\treturn 1;\n+\t}\n+\tmemset(area, 0x42, blk_size);\n+\n+\tpagemap_fd = open(\"/proc/self/pagemap\", O_RDONLY);\n+\tif (pagemap_fd \u003c 0) {\n+\t\tperror(\"pagemap\");\n+\t\treturn 1;\n+\t}\n+\n+\tfor (off = 0; off \u003c blk_size \u0026\u0026 !page; off += page_size) {\n+\t\tblk = vaddr_to_block(pagemap_fd, area + off, page_size,\n+\t\t\t\t blk_size);\n+\t\tfor (i = 1; i \u003c argc; i++) {\n+\t\t\tif (blk == strtoul(argv[i], NULL, 10)) {\n+\t\t\t\tpage = area + off;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\t}\n+\tclose(pagemap_fd);\n+\n+\tif (!page) {\n+\t\tprintf(\"PIN_NONE\\n\");\n+\t\tfflush(stdout);\n+\t\treturn 2;\n+\t}\n+\n+\tif (pipe(pipefd)) {\n+\t\tperror(\"pipe\");\n+\t\treturn 1;\n+\t}\n+\n+\tstruct iovec iov = { .iov_base = page, .iov_len = page_size };\n+\n+\tif (vmsplice(pipefd[1], \u0026iov, 1, 0) != page_size) {\n+\t\tperror(\"vmsplice\");\n+\t\treturn 1;\n+\t}\n+\n+\tprintf(\"PIN_BLK=%lu\\n\", blk);\n+\tfflush(stdout);\n+\tpause();\n+\treturn 0;\n+}\n+PINEOF\n+\n+if ! cc -O2 -o \"${PIN_BIN}\" \"${PIN_SRC}\" 2\u003e\u003e\"${LOG}\"; then\n+\tskip_all_tests \"cannot build the pin helper\"\n+fi\n+\n+# -- guest script (runs as init inside the VM) --------------------------------\n+\n+cat \u003e \"${GUEST_SCRIPT}\" \u003c\u003cPROLOGUE\n+#!/bin/bash\n+readonly MAX_PASSES=${MAX_PASSES}\n+readonly HANG_HOLD=${HANG_HOLD}\n+readonly RESCUE_TIMEOUT=${RESCUE_TIMEOUT}\n+readonly PIN_PARK=\"${PIN_BIN}\"\n+PROLOGUE\n+\n+cat \u003e\u003e \"${GUEST_SCRIPT}\" \u003c\u003c'GUESTEOF'\n+set -u\n+\n+readonly PARAM=/sys/module/memory_hotplug/parameters/offline_migrate_max_passes\n+readonly MEM=/sys/devices/system/memory\n+\n+skip() { echo \"VMTEST_SKIP: $*\"; echo \"VMTEST_DONE\"; exit 0; }\n+\n+block_state() {\n+\tcat \"${MEM}/memory${pinned_blk}/state\" 2\u003e/dev/null || echo GONE\n+}\n+\n+[ -f \"${PARAM}\" ] || skip \"kernel lacks offline_migrate_max_passes\"\n+\n+# 1. Online the DIMM's blocks as ZONE_MOVABLE.\n+dimm_blocks=\"\"\n+for s in \"${MEM}\"/memory*/state; do\n+\t[ \"$(cat \"${s}\" 2\u003e/dev/null)\" = offline ] || continue\n+\tif echo online_movable \u003e \"${s}\" 2\u003e/dev/null; then\n+\t\tb=${s%/state}\n+\t\tdimm_blocks=\"${dimm_blocks} ${b##*memory}\"\n+\tfi\n+done\n+echo \"# DIMM memory blocks:${dimm_blocks:- none}\"\n+[ -n \"${dimm_blocks}\" ] || skip \"no offline memory blocks (pc-dimm missing?)\"\n+\n+# 2. Pin one page inside the DIMM.\n+\"${PIN_PARK}\" ${dimm_blocks} \u003e /tmp/pin.out 2\u003e\u00261 \u0026\n+pin_pid=$!\n+for _ in $(seq 1 10); do\n+\tgrep -q \"PIN_\" /tmp/pin.out 2\u003e/dev/null \u0026\u0026 break\n+\tsleep 1\n+done\n+pinned_blk=$(sed -n 's/^PIN_BLK=//p' /tmp/pin.out)\n+[ -n \"${pinned_blk}\" ] || skip \"pin failed: $(cat /tmp/pin.out 2\u003e/dev/null)\"\n+echo \"# pinned one page in block memory${pinned_blk}\"\n+\n+# 3. Eject the DIMM with the retry limit disabled (default = unbounded).\n+echo 0 \u003e \"${PARAM}\"\n+dmesg -c \u003e /dev/null 2\u003e\u00261 || true\n+\n+ejdev=\"\"\n+for dev in /sys/bus/acpi/devices/PNP0C80:*; do\n+\t[ -e \"${dev}/eject\" ] \u0026\u0026 { ejdev=\"${dev}\"; break; }\n+done\n+[ -n \"${ejdev}\" ] || skip \"no ejectable ACPI memory device (PNP0C80)\"\n+echo \"# ejecting ${ejdev}\"\n+echo 1 \u003e \"${ejdev}/eject\" \u0026\n+\n+# 4. Observe the hang: the block must stay in \"going-offline\".\n+sleep 3\n+stuck=0\n+if [ \"$(block_state)\" = going-offline ]; then\n+\techo \"# block memory${pinned_blk} going-offline, holding ${HANG_HOLD}s\"\n+\tsleep \"${HANG_HOLD}\"\n+\tif [ \"$(block_state)\" = going-offline ]; then\n+\t\tstuck=1\n+\t\techo 1 \u003e /proc/sys/kernel/sysrq 2\u003e/dev/null || true\n+\t\techo l \u003e /proc/sysrq-trigger 2\u003e/dev/null || true\n+\t\tsleep 1\n+\t\tdmesg | grep -B2 -A12 \"offline_pages\" | tail -20 \\\n+\t\t\t| sed 's/^/# /'\n+\tfi\n+fi\n+echo \"VMTEST_STUCK=${stuck}\"\n+\n+# 5. Rescue: arm the retry limit at runtime and wait for bailout.\n+echo \"${MAX_PASSES}\" \u003e \"${PARAM}\"\n+echo \"# armed offline_migrate_max_passes=$(cat \"${PARAM}\")\"\n+\n+rescued=0\n+for _ in $(seq 1 \"${RESCUE_TIMEOUT}\"); do\n+\tif dmesg | grep -q \"giving up after\"; then\n+\t\trescued=1\n+\t\tbreak\n+\tfi\n+\tsleep 1\n+done\n+dmesg | grep \"giving up after\" | tail -2 | sed 's/^/# /'\n+echo \"VMTEST_RESCUED=${rescued}\"\n+\n+sleep 2\n+echo \"VMTEST_BLOCK_STATE=$(block_state)\"\n+\n+kill \"${pin_pid}\" 2\u003e/dev/null\n+echo \"VMTEST_DONE\"\n+GUESTEOF\n+\n+# -- launch VM ----------------------------------------------------------------\n+\n+( cd \"${KERNEL_CHECKOUT}\" \u0026\u0026 exec vng --force-9p --no-virtme-ng-init \\\n+\t--qemu-opt=-m --qemu-opt=\"2G,slots=4,maxmem=8G\" \\\n+\t--qemu-opt=-object \\\n+\t--qemu-opt=\"memory-backend-ram,id=mem0,size=${DIMM_SIZE}\" \\\n+\t--qemu-opt=-device --qemu-opt=\"pc-dimm,id=dimm0,memdev=mem0\" \\\n+\tbash \"${GUEST_SCRIPT}\" ) \u003e \"${LOG}\" 2\u003e\u00261 \u0026\n+VNG_PID=$!\n+\n+for _ in $(seq 1 \"${BOOT_TIMEOUT}\"); do\n+\tgrep -q \"VMTEST_DONE\" \"${LOG}\" 2\u003e/dev/null \u0026\u0026 break\n+\tkill -0 \"${VNG_PID}\" 2\u003e/dev/null || break\n+\tsleep 1\n+done\n+\n+if ! grep -q \"VMTEST_DONE\" \"${LOG}\" 2\u003e/dev/null; then\n+\tdump_log_tail\n+\tskip_all_tests \"VM did not finish within ${BOOT_TIMEOUT}s\"\n+fi\n+\n+kill \"${VNG_PID}\" 2\u003e/dev/null\n+wait \"${VNG_PID}\" 2\u003e/dev/null\n+VNG_PID=\"\"\n+\n+# -- report results -----------------------------------------------------------\n+\n+skip_reason=\"$(grep \"^VMTEST_SKIP: \" \"${LOG}\" | tail -1 | tr -d '\\r')\"\n+if [ -n \"${skip_reason}\" ]; then\n+\tskip_all_tests \"${skip_reason#VMTEST_SKIP: }\"\n+fi\n+\n+grep \"^#\" \"${LOG}\" | tr -d '\\r' | while IFS= read -r line; do\n+\tktap_print_msg \"${line#\\# }\"\n+done\n+\n+stuck=\"$(guest_result VMTEST_STUCK)\"\n+rescued=\"$(guest_result VMTEST_RESCUED)\"\n+blk_state=\"$(guest_result VMTEST_BLOCK_STATE)\"\n+\n+if [ \"${blk_state:-GONE}\" = \"GONE\" ]; then\n+\tskip_all_tests \"DIMM was ejected despite the pin (pin did not hold)\"\n+fi\n+\n+if [ \"${stuck:-0}\" = 1 ]; then\n+\tktap_test_pass \"ACPI eject kworker hangs unbounded in offline_pages()\"\n+else\n+\tdump_log_tail\n+\tktap_test_fail \"ACPI eject kworker hangs unbounded in offline_pages()\"\n+fi\n+\n+if [ \"${rescued:-0}\" = 1 ]; then\n+\tktap_test_pass \"stuck offline rescued by writing offline_migrate_max_passes\"\n+else\n+\tdump_log_tail\n+\tktap_test_fail \"stuck offline rescued by writing offline_migrate_max_passes\"\n+fi\n+\n+if [ \"${blk_state}\" = \"online\" ]; then\n+\tktap_test_pass \"memory block online and usable after the bailout\"\n+else\n+\tktap_test_fail \"memory block online and usable after the bailout (state=${blk_state})\"\n+fi\n+\n+ktap_finished\n"
} |
| 2/1 | 2026/07/23 02:27 | agent | patch-evaluator |
0mModel:best-expensive Args: null Results: {
"EnableConfigs": [
"MEMORY_HOTPLUG",
"MEMORY_HOTREMOVE"
],
"FocusSymbols": [
"offline_pages"
],
"Reasoning": "The patch modifies the core memory hotplug logic in `offline_pages` to limit the number of migration passes during memory offlining. This is a functional change that can be reached when memory is offlined.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Do not list too generic configs (we already have them enabled). Only list those that specifically cover the modified code. List them in the EnableConfigs output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4"). Prefer calling several tools at the same time to save round-trips. Use set-results tool to provide results of the analysis. It must be called exactly once before the final reply. Ignore results of this tool. Prompt: For your convenience, here is the diff of the changes:
commit 530b32145286f653fec4b1945edd79921220bafc
Author: syz-cluster <triage@syzkaller.com>
Date: Thu Jul 23 02:27:03 2026 +0000
syz-cluster: applied patch under review
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 53f08950a63096..90b67c457c2a82 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3980,6 +3980,20 @@ Kernel parameters
Note that even when enabled, there are a few cases where
the feature is not effective.
+ memory_hotplug.offline_migrate_max_passes=
+ [KNL] Maximum number of migration passes
+ for memory offlining.
+ Format: <integer>
+ default: 0 (no limit, historical behaviour)
+ When non-zero, memory offlining gives up with
+ -EBUSY after this many migration passes over
+ the range, instead of retrying forever on a
+ stuck page. Each pass scans the range and
+ migrates what it can.
+ The parameter is re-read on every pass, so an
+ offline request that is already stuck can be
+ rescued at runtime by writing the parameter.
+
memtest= [KNL,X86,ARM,M68K,PPC,RISCV,EARLY] Enable memtest
Format: <integer>
default : 0 <disable>
diff --git a/Documentation/admin-guide/mm/memory-hotplug.rst b/Documentation/admin-guide/mm/memory-hotplug.rst
index 0207f87251421c..79b45109c408c8 100644
--- a/Documentation/admin-guide/mm/memory-hotplug.rst
+++ b/Documentation/admin-guide/mm/memory-hotplug.rst
@@ -224,7 +224,10 @@ increases memory offlining reliability; still, memory offlining can fail in
some corner cases.
Further, memory offlining might retry for a long time (or even forever), until
-aborted by the user.
+aborted by the user. The ``memory_hotplug.offline_migrate_max_passes``
+parameter can be used to bound the number of retry passes, making an offline
+request that cannot make progress fail with ``-EBUSY`` instead of retrying
+indefinitely (see `Module Parameters`_).
Offlining of a memory block can be triggered via::
@@ -547,6 +550,27 @@ The following module parameters are currently defined:
possible.
Parameter availability depends on CONFIG_NUMA.
+``offline_migrate_max_passes`` read-write: Maximum number of migration
+ passes for a single memory offline
+ request. Memory offlining retries to
+ migrate and isolate pages until it succeeds;
+ a page that can never be migrated or freed
+ makes it retry forever. When this parameter
+ is non-zero, an offline request gives up
+ with ``-EBUSY`` after the configured number
+ of migration passes and the memory block
+ stays online.
+
+ The parameter is re-read on every pass, so
+ an offline request that is already stuck
+ retrying can be rescued at runtime by
+ writing a non-zero value, without a reboot.
+
+ The default is "0", meaning no limit (the
+ historical behaviour).
+
+ Parameter availability depends on
+ CONFIG_MEMORY_HOTREMOVE.
================================ ===============================================
ZONE_MOVABLE
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 226ab9cb078ad1..9067829349a0da 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1785,6 +1785,12 @@ bool mhp_range_allowed(u64 start, u64 size, bool need_mapping)
}
#ifdef CONFIG_MEMORY_HOTREMOVE
+/* Max offline_pages() migration passes before -EBUSY; 0 = retry forever. */
+static unsigned int offline_migrate_max_passes __read_mostly;
+module_param(offline_migrate_max_passes, uint, 0644);
+MODULE_PARM_DESC(offline_migrate_max_passes,
+ "Max migration passes before memory offline gives up (0 = no limit)");
+
/*
* Scan pfn range [start,end) to find movable/migratable pages (LRU and
* hugetlb folio, movable_ops pages). Will skip over most unmovable
@@ -1966,6 +1972,8 @@ int offline_pages(unsigned long start_pfn, unsigned long nr_pages,
struct node_notify node_arg = {
.nid = NUMA_NO_NODE,
};
+ unsigned int max_passes;
+ unsigned int pass = 0;
unsigned long flags;
char *reason;
int ret;
@@ -2062,6 +2070,36 @@ int offline_pages(unsigned long start_pfn, unsigned long nr_pages,
goto failed_removal_isolated;
}
+ /*
+ * A page that can never be migrated (e.g. a
+ * long-term pin) makes this loop retry forever.
+ * Give up after the configured number of passes.
+ * The limit is re-read on every pass so that an
+ * offline request that is already stuck here can
+ * be aborted at runtime by writing the parameter,
+ * which matters for in-kernel callers (e.g. ACPI
+ * DIMM hot-unplug) that run on kworkers and can
+ * never be aborted by a signal.
+ */
+ max_passes = READ_ONCE(offline_migrate_max_passes);
+ if (max_passes && pass++ >= max_passes) {
+ pr_warn("memory offlining [mem %#010llx-%#010llx]: giving up after %u passes\n",
+ (unsigned long long)start_pfn << PAGE_SHIFT,
+ ((unsigned long long)end_pfn << PAGE_SHIFT) - 1,
+ pass - 1);
+ /*
+ * Dump the page we last stopped at as a
+ * diagnostic hint: usually the stuck page,
+ * but just the range start after a restart.
+ */
+ if (pfn >= start_pfn && pfn < end_pfn)
+ dump_page(pfn_to_page(pfn),
+ "memory offline retry limit");
+ ret = -EBUSY;
+ reason = "retry limit exceeded";
+ goto failed_removal_isolated;
+ }
+
cond_resched();
ret = scan_movable_pages(pfn, end_pfn, &pfn);
diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile
index eae504bd94c83a..e113f3ff465594 100644
--- a/tools/testing/selftests/mm/Makefile
+++ b/tools/testing/selftests/mm/Makefile
@@ -177,6 +177,9 @@ TEST_PROGS += ksft_vmalloc.sh
# Destructive: every successful run panics the kernel. Installed and
# kept executable, but not run from a default kselftest invocation.
TEST_PROGS_EXTENDED += hwpoison-panic.sh
+# Spawns its own VM (virtme-ng); not run from a default kselftest
+# invocation.
+TEST_PROGS_EXTENDED += vmtest_memory_hotplug.sh
TEST_FILES := test_vmalloc.sh
TEST_FILES += test_hmm.sh
diff --git a/tools/testing/selftests/mm/config b/tools/testing/selftests/mm/config
index 06f78bd232e2e3..d22f63eb9c2c9e 100644
--- a/tools/testing/selftests/mm/config
+++ b/tools/testing/selftests/mm/config
@@ -14,3 +14,6 @@ CONFIG_UPROBES=y
CONFIG_MEMORY_FAILURE=y
CONFIG_HWPOISON_INJECT=m
CONFIG_PROC_MEM_ALWAYS_FORCE=y
+CONFIG_MEMORY_HOTPLUG=y
+CONFIG_MEMORY_HOTREMOVE=y
+CONFIG_ACPI_HOTPLUG_MEMORY=y
diff --git a/tools/testing/selftests/mm/vmtest_memory_hotplug.sh b/tools/testing/selftests/mm/vmtest_memory_hotplug.sh
new file mode 100755
index 00000000000000..c211a0e7caa2d3
--- /dev/null
+++ b/tools/testing/selftests/mm/vmtest_memory_hotplug.sh
@@ -0,0 +1,369 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+#
+# Test memory_hotplug.offline_migrate_max_passes by reproducing the ACPI
+# memory hot-unplug hang in kworker context and verifying that the retry
+# limit recovers from it.
+#
+# offline_pages() retries page migration in an unbounded loop. A page
+# that can never be migrated (long-term pin, slab, busy metadata) makes
+# the loop spin forever. Userspace-driven offlines can be interrupted by
+# a signal, but an ACPI DIMM eject runs on the kacpi_hotplug_wq kworker
+# where signal_pending() never fires, so the kworker hangs until reboot.
+#
+# Flow:
+# 1. Boot the just-built kernel (virtme-ng) with a cold-plugged pc-dimm.
+# 2. Online the DIMM's blocks as ZONE_MOVABLE.
+# 3. Pin one page of the DIMM (vmsplice long-term pin).
+# 4. Eject the DIMM via sysfs; offline runs on kacpi_hotplug_wq.
+# 5. Observe the hang (going-offline persists).
+# 6. Rescue: write offline_migrate_max_passes at runtime, verify bailout.
+#
+# TAP subtests:
+# 1 ACPI eject kworker hangs unbounded in offline_pages()
+# 2 stuck offline rescued by writing offline_migrate_max_passes
+# 3 memory block online and usable after the bailout
+#
+# Dependencies: virtme-ng (vng), qemu-system-<arch>, cc.
+# SKIPs (never FAILs) when tooling or kernel support is missing.
+
+readonly SCRIPT_DIR="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
+readonly KERNEL_CHECKOUT="$(realpath "${SCRIPT_DIR}"/../../../../)"
+
+# shellcheck source=../kselftest/ktap_helpers.sh
+source "${SCRIPT_DIR}"/../kselftest/ktap_helpers.sh
+
+readonly DIMM_SIZE="${DIMM_SIZE:-256M}"
+readonly MAX_PASSES="${MAX_PASSES:-50}"
+readonly HANG_HOLD="${HANG_HOLD:-10}"
+readonly RESCUE_TIMEOUT="${RESCUE_TIMEOUT:-30}"
+readonly BOOT_TIMEOUT="${BOOT_TIMEOUT:-240}"
+
+readonly LOG="$(mktemp /tmp/vmtest_mhp_XXXXXX.log)"
+readonly GUEST_SCRIPT="$(mktemp /tmp/vmtest_mhp_guest_XXXXXX.sh)"
+readonly PIN_SRC="$(mktemp /tmp/vmtest_mhp_pin_XXXXXX.c)"
+# Must live in the kernel tree so the guest sees it through the 9p rootfs.
+readonly PIN_BIN="${SCRIPT_DIR}/.vmtest_pin_park.$$"
+
+VNG_PID=""
+
+cleanup() {
+ [ -n "${VNG_PID}" ] && kill "${VNG_PID}" 2>/dev/null
+ rm -f "${LOG}" "${GUEST_SCRIPT}" "${PIN_SRC}" "${PIN_BIN}"
+}
+
+guest_result() {
+ grep -o "^${1}=[A-Za-z0-9_-]*" "${LOG}" | tail -1 | cut -d= -f2
+}
+
+dump_log_tail() {
+ tail -25 "${LOG}" | while IFS= read -r line; do
+ ktap_print_msg "${line}"
+ done
+}
+
+skip_all_tests() {
+ local i
+
+ for i in 1 2 3; do
+ ktap_test_skip "$1"
+ done
+ ktap_finished
+}
+
+# -- pre-flight checks -------------------------------------------------------
+
+ktap_print_header
+ktap_set_plan 3
+trap cleanup EXIT
+
+arch="$(uname -m)"
+case "${arch}" in
+x86_64|aarch64) ;;
+*) skip_all_tests "pc-dimm ACPI hotplug not available on ${arch}" ;;
+esac
+
+for dep in vng "qemu-system-${arch}" cc; do
+ if ! command -v "${dep}" >/dev/null 2>&1; then
+ skip_all_tests "${dep} not installed"
+ fi
+done
+
+# -- pin helper (compiled on the host, visible to the guest via 9p) -----------
+#
+# Allocate one block's worth of pages (ZONE_MOVABLE serves them from the
+# DIMM), find one that landed in a target block, vmsplice-pin it into a
+# pipe, print PIN_BLK=<N>, and sleep forever.
+
+cat > "${PIN_SRC}" <<'PINEOF'
+#define _GNU_SOURCE
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/uio.h>
+
+static unsigned long memory_block_size(void)
+{
+ char buf[64];
+ ssize_t n;
+ int fd;
+
+ fd = open("/sys/devices/system/memory/block_size_bytes", O_RDONLY);
+ if (fd < 0)
+ return 0;
+ n = read(fd, buf, sizeof(buf) - 1);
+ close(fd);
+ if (n <= 0)
+ return 0;
+ buf[n] = '\0';
+ return strtoul(buf, NULL, 16);
+}
+
+static unsigned long vaddr_to_block(int pagemap_fd, char *vaddr,
+ long page_size, unsigned long blk_size)
+{
+ unsigned long vpn = (unsigned long)vaddr / page_size;
+ uint64_t ent;
+
+ if (pread(pagemap_fd, &ent, sizeof(ent), vpn * 8) != sizeof(ent))
+ return -1UL;
+ if (!(ent & (1ULL << 63)))
+ return -1UL;
+ return (ent & ((1ULL << 55) - 1)) * page_size / blk_size;
+}
+
+int main(int argc, char **argv)
+{
+ long page_size = sysconf(_SC_PAGESIZE);
+ unsigned long blk_size = memory_block_size();
+ unsigned long off, blk = 0;
+ char *area, *page = NULL;
+ int pagemap_fd, pipefd[2], i;
+
+ if (argc < 2 || !blk_size) {
+ fprintf(stderr, "usage: pin_park <memory block>...\n");
+ return 1;
+ }
+
+ area = mmap(NULL, blk_size, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE, -1, 0);
+ if (area == MAP_FAILED) {
+ perror("mmap");
+ return 1;
+ }
+ memset(area, 0x42, blk_size);
+
+ pagemap_fd = open("/proc/self/pagemap", O_RDONLY);
+ if (pagemap_fd < 0) {
+ perror("pagemap");
+ return 1;
+ }
+
+ for (off = 0; off < blk_size && !page; off += page_size) {
+ blk = vaddr_to_block(pagemap_fd, area + off, page_size,
+ blk_size);
+ for (i = 1; i < argc; i++) {
+ if (blk == strtoul(argv[i], NULL, 10)) {
+ page = area + off;
+ break;
+ }
+ }
+ }
+ close(pagemap_fd);
+
+ if (!page) {
+ printf("PIN_NONE\n");
+ fflush(stdout);
+ return 2;
+ }
+
+ if (pipe(pipefd)) {
+ perror("pipe");
+ return 1;
+ }
+
+ struct iovec iov = { .iov_base = page, .iov_len = page_size };
+
+ if (vmsplice(pipefd[1], &iov, 1, 0) != page_size) {
+ perror("vmsplice");
+ return 1;
+ }
+
+ printf("PIN_BLK=%lu\n", blk);
+ fflush(stdout);
+ pause();
+ return 0;
+}
+PINEOF
+
+if ! cc -O2 -o "${PIN_BIN}" "${PIN_SRC}" 2>>"${LOG}"; then
+ skip_all_tests "cannot build the pin helper"
+fi
+
+# -- guest script (runs as init inside the VM) --------------------------------
+
+cat > "${GUEST_SCRIPT}" <<PROLOGUE
+#!/bin/bash
+readonly MAX_PASSES=${MAX_PASSES}
+readonly HANG_HOLD=${HANG_HOLD}
+readonly RESCUE_TIMEOUT=${RESCUE_TIMEOUT}
+readonly PIN_PARK="${PIN_BIN}"
+PROLOGUE
+
+cat >> "${GUEST_SCRIPT}" <<'GUESTEOF'
+set -u
+
+readonly PARAM=/sys/module/memory_hotplug/parameters/offline_migrate_max_passes
+readonly MEM=/sys/devices/system/memory
+
+skip() { echo "VMTEST_SKIP: $*"; echo "VMTEST_DONE"; exit 0; }
+
+block_state() {
+ cat "${MEM}/memory${pinned_blk}/state" 2>/dev/null || echo GONE
+}
+
+[ -f "${PARAM}" ] || skip "kernel lacks offline_migrate_max_passes"
+
+# 1. Online the DIMM's blocks as ZONE_MOVABLE.
+dimm_blocks=""
+for s in "${MEM}"/memory*/state; do
+ [ "$(cat "${s}" 2>/dev/null)" = offline ] || continue
+ if echo online_movable > "${s}" 2>/dev/null; then
+ b=${s%/state}
+ dimm_blocks="${dimm_blocks} ${b##*memory}"
+ fi
+done
+echo "# DIMM memory blocks:${dimm_blocks:- none}"
+[ -n "${dimm_blocks}" ] || skip "no offline memory blocks (pc-dimm missing?)"
+
+# 2. Pin one page inside the DIMM.
+"${PIN_PARK}" ${dimm_blocks} > /tmp/pin.out 2>&1 &
+pin_pid=$!
+for _ in $(seq 1 10); do
+ grep -q "PIN_" /tmp/pin.out 2>/dev/null && break
+ sleep 1
+done
+pinned_blk=$(sed -n 's/^PIN_BLK=//p' /tmp/pin.out)
+[ -n "${pinned_blk}" ] || skip "pin failed: $(cat /tmp/pin.out 2>/dev/null)"
+echo "# pinned one page in block memory${pinned_blk}"
+
+# 3. Eject the DIMM with the retry limit disabled (default = unbounded).
+echo 0 > "${PARAM}"
+dmesg -c > /dev/null 2>&1 || true
+
+ejdev=""
+for dev in /sys/bus/acpi/devices/PNP0C80:*; do
+ [ -e "${dev}/eject" ] && { ejdev="${dev}"; break; }
+done
+[ -n "${ejdev}" ] || skip "no ejectable ACPI memory device (PNP0C80)"
+echo "# ejecting ${ejdev}"
+echo 1 > "${ejdev}/eject" &
+
+# 4. Observe the hang: the block must stay in "going-offline".
+sleep 3
+stuck=0
+if [ "$(block_state)" = going-offline ]; then
+ echo "# block memory${pinned_blk} going-offline, holding ${HANG_HOLD}s"
+ sleep "${HANG_HOLD}"
+ if [ "$(block_state)" = going-offline ]; then
+ stuck=1
+ echo 1 > /proc/sys/kernel/sysrq 2>/dev/null || true
+ echo l > /proc/sysrq-trigger 2>/dev/null || true
+ sleep 1
+ dmesg | grep -B2 -A12 "offline_pages" | tail -20 \
+ | sed 's/^/# /'
+ fi
+fi
+echo "VMTEST_STUCK=${stuck}"
+
+# 5. Rescue: arm the retry limit at runtime and wait for bailout.
+echo "${MAX_PASSES}" > "${PARAM}"
+echo "# armed offline_migrate_max_passes=$(cat "${PARAM}")"
+
+rescued=0
+for _ in $(seq 1 "${RESCUE_TIMEOUT}"); do
+ if dmesg | grep -q "giving up after"; then
+ rescued=1
+ break
+ fi
+ sleep 1
+done
+dmesg | grep "giving up after" | tail -2 | sed 's/^/# /'
+echo "VMTEST_RESCUED=${rescued}"
+
+sleep 2
+echo "VMTEST_BLOCK_STATE=$(block_state)"
+
+kill "${pin_pid}" 2>/dev/null
+echo "VMTEST_DONE"
+GUESTEOF
+
+# -- launch VM ----------------------------------------------------------------
+
+( cd "${KERNEL_CHECKOUT}" && exec vng --force-9p --no-virtme-ng-init \
+ --qemu-opt=-m --qemu-opt="2G,slots=4,maxmem=8G" \
+ --qemu-opt=-object \
+ --qemu-opt="memory-backend-ram,id=mem0,size=${DIMM_SIZE}" \
+ --qemu-opt=-device --qemu-opt="pc-dimm,id=dimm0,memdev=mem0" \
+ bash "${GUEST_SCRIPT}" ) > "${LOG}" 2>&1 &
+VNG_PID=$!
+
+for _ in $(seq 1 "${BOOT_TIMEOUT}"); do
+ grep -q "VMTEST_DONE" "${LOG}" 2>/dev/null && break
+ kill -0 "${VNG_PID}" 2>/dev/null || break
+ sleep 1
+done
+
+if ! grep -q "VMTEST_DONE" "${LOG}" 2>/dev/null; then
+ dump_log_tail
+ skip_all_tests "VM did not finish within ${BOOT_TIMEOUT}s"
+fi
+
+kill "${VNG_PID}" 2>/dev/null
+wait "${VNG_PID}" 2>/dev/null
+VNG_PID=""
+
+# -- report results -----------------------------------------------------------
+
+skip_reason="$(grep "^VMTEST_SKIP: " "${LOG}" | tail -1 | tr -d '\r')"
+if [ -n "${skip_reason}" ]; then
+ skip_all_tests "${skip_reason#VMTEST_SKIP: }"
+fi
+
+grep "^#" "${LOG}" | tr -d '\r' | while IFS= read -r line; do
+ ktap_print_msg "${line#\# }"
+done
+
+stuck="$(guest_result VMTEST_STUCK)"
+rescued="$(guest_result VMTEST_RESCUED)"
+blk_state="$(guest_result VMTEST_BLOCK_STATE)"
+
+if [ "${blk_state:-GONE}" = "GONE" ]; then
+ skip_all_tests "DIMM was ejected despite the pin (pin did not hold)"
+fi
+
+if [ "${stuck:-0}" = 1 ]; then
+ ktap_test_pass "ACPI eject kworker hangs unbounded in offline_pages()"
+else
+ dump_log_tail
+ ktap_test_fail "ACPI eject kworker hangs unbounded in offline_pages()"
+fi
+
+if [ "${rescued:-0}" = 1 ]; then
+ ktap_test_pass "stuck offline rescued by writing offline_migrate_max_passes"
+else
+ dump_log_tail
+ ktap_test_fail "stuck offline rescued by writing offline_migrate_max_passes"
+fi
+
+if [ "${blk_state}" = "online" ]; then
+ ktap_test_pass "memory block online and usable after the bailout"
+else
+ ktap_test_fail "memory block online and usable after the bailout (state=${blk_state})"
+fi
+
+ktap_finished
|
| 3/2 | 2026/07/23 02:27 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 8169 output: 21 thoughts: 154 Thoughts: **Analyzing the Memory Hotplug Patch** Okay, so I've got this patch here, and it's introducing a new kernel parameter: `memory_hotplug.offline_migrate_max_passes`. Essentially, it's designed to put a cap on the migration passes during memory offlining. That's a good thing, potentially preventing runaway migrations in certain scenarios. The core of the change lies within `mm/memory_hotplug.c` – that's where the heart of memory hotplug functionality resides, so it makes perfect sense. I need to dive into that code and confirm that the modification is sound, doesn't introduce any regressions, and handles all edge cases correctly. My initial thought is to examine the `offline_pages` function since that is where the description implies the changes are centered. I need to make sure this new parameter interacts smoothly with the existing memory offlining logic. Beyond the code itself, I see that a new selftest, `tools/testing/selftests/mm/vmtest_memory_hotplug.sh`, has been added. That's fantastic. I'll need to review that test thoroughly to ensure it covers the intended behavior, including the new parameter's effect on migration limits. I'll need to check the scope of the test to ensure all functionality is covered. Finally, the documentation updates are crucial. Both `Documentation/admin-guide/kernel-parameters.txt` and `Documentation/admin-guide/mm/memory-hotplug.rst` are being updated. I'll need to review those updates to verify the new parameter is clearly explained, its implications are accurately described, and the documentation is consistent with the code. It is extremely important that the documentation accurately reflects the behavior of the patch. |
| 4/2 | 2026/07/23 02:27 | tool | grepper |
0mArgs:{
"Expression": "offline_migrate_max_passes"
}Results: {
"Output": "Documentation/admin-guide/kernel-parameters.txt=95=Kernel parameters\n--\nDocumentation/admin-guide/kernel-parameters.txt-3982-\nDocumentation/admin-guide/kernel-parameters.txt:3983:\tmemory_hotplug.offline_migrate_max_passes=\nDocumentation/admin-guide/kernel-parameters.txt-3984-\t\t\t[KNL] Maximum number of migration passes\n--\nDocumentation/admin-guide/mm/memory-hotplug.rst=226=Further, memory offlining might retry for a long time (or even forever), until\nDocumentation/admin-guide/mm/memory-hotplug.rst:227:aborted by the user. The ``memory_hotplug.offline_migrate_max_passes``\nDocumentation/admin-guide/mm/memory-hotplug.rst-228-parameter can be used to bound the number of retry passes, making an offline\n--\nDocumentation/admin-guide/mm/memory-hotplug.rst=432=The following module parameters are currently defined:\n--\nDocumentation/admin-guide/mm/memory-hotplug.rst-552-\t\t\t\t Parameter availability depends on CONFIG_NUMA.\nDocumentation/admin-guide/mm/memory-hotplug.rst:553:``offline_migrate_max_passes``\t read-write: Maximum number of migration\nDocumentation/admin-guide/mm/memory-hotplug.rst-554-\t\t\t\t passes for a single memory offline\n--\nmm/memory_hotplug.c=1774=bool mhp_range_allowed(u64 start, u64 size, bool need_mapping)\n--\nmm/memory_hotplug.c-1788-/* Max offline_pages() migration passes before -EBUSY; 0 = retry forever. */\nmm/memory_hotplug.c:1789:static unsigned int offline_migrate_max_passes __read_mostly;\nmm/memory_hotplug.c:1790:module_param(offline_migrate_max_passes, uint, 0644);\nmm/memory_hotplug.c:1791:MODULE_PARM_DESC(offline_migrate_max_passes,\nmm/memory_hotplug.c-1792-\t\"Max migration passes before memory offline gives up (0 = no limit)\");\n--\nmm/memory_hotplug.c=1961=int offline_pages(unsigned long start_pfn, unsigned long nr_pages,\n--\nmm/memory_hotplug.c-2083-\t\t\t */\nmm/memory_hotplug.c:2084:\t\t\tmax_passes = READ_ONCE(offline_migrate_max_passes);\nmm/memory_hotplug.c-2085-\t\t\tif (max_passes \u0026\u0026 pass++ \u003e= max_passes) {\n--\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh-3-#\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh:4:# Test memory_hotplug.offline_migrate_max_passes by reproducing the ACPI\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh-5-# memory hot-unplug hang in kworker context and verifying that the retry\n--\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh-19-# 5. Observe the hang (going-offline persists).\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh:20:# 6. Rescue: write offline_migrate_max_passes at runtime, verify bailout.\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh-21-#\n--\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh-23-# 1 ACPI eject kworker hangs unbounded in offline_pages()\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh:24:# 2 stuck offline rescued by writing offline_migrate_max_passes\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh-25-# 3 memory block online and usable after the bailout\n--\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh=218=set -u\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh-219-\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh:220:readonly PARAM=/sys/module/memory_hotplug/parameters/offline_migrate_max_passes\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh-221-readonly MEM=/sys/devices/system/memory\n--\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh=225=block_state() {\n--\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh-228-\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh:229:[ -f \"${PARAM}\" ] || skip \"kernel lacks offline_migrate_max_passes\"\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh-230-\n--\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh=284=echo \"${MAX_PASSES}\" \u003e \"${PARAM}\"\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh:285:echo \"# armed offline_migrate_max_passes=$(cat \"${PARAM}\")\"\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh-286-\n--\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh=356=if [ \"${rescued:-0}\" = 1 ]; then\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh:357:\tktap_test_pass \"stuck offline rescued by writing offline_migrate_max_passes\"\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh-358-else\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh-359-\tdump_log_tail\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh:360:\tktap_test_fail \"stuck offline rescued by writing offline_migrate_max_passes\"\ntools/testing/selftests/mm/vmtest_memory_hotplug.sh-361-fi\n"
} |
| 5/2 | 2026/07/23 02:27 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 10298 output: 20 thoughts: 98 Thoughts: **Analyzing the Memory Hotplug Patch** Okay, so this patch introduces a new module parameter, `offline_migrate_max_passes`, specifically within `memory_hotplug.c`. This is a pretty focused functional addition, impacting how the system handles offline pages. Given my expertise, I immediately key in on the `offline_pages` function as the prime candidate for fuzzing. That's where the core logic of this new parameter will come into play. The crucial configuration requirement here is `CONFIG_MEMORY_HOTREMOVE`, which is standard. Before diving deeper into the fuzzing strategy though, I want to take a look at `mm/memory_hotplug.c` itself. It’s always a good practice to quickly scan the file for other related configurations that might affect the behaviour of this patch. This will help identify possible edge cases and dependencies that should also be considered when designing the fuzzing campaign. This level of initial reconnaissance could significantly reduce the effort required down the line. |
| 6/2 | 2026/07/23 02:27 | tool | grepper |
0mArgs:{
"Expression": "CONFIG_MEMORY_HOTREMOVE"
}Results: {
"Output": "Documentation/admin-guide/mm/memory-hotplug.rst=339=The following files are currently defined:\n--\nDocumentation/admin-guide/mm/memory-hotplug.rst-380-\nDocumentation/admin-guide/mm/memory-hotplug.rst:381:\t\t Availability depends on the CONFIG_MEMORY_HOTREMOVE\nDocumentation/admin-guide/mm/memory-hotplug.rst-382-\t\t kernel configuration option.\n--\nDocumentation/admin-guide/mm/memory-hotplug.rst=432=The following module parameters are currently defined:\n--\nDocumentation/admin-guide/mm/memory-hotplug.rst-572-\t\t\t\t Parameter availability depends on\nDocumentation/admin-guide/mm/memory-hotplug.rst:573:\t\t\t\t CONFIG_MEMORY_HOTREMOVE.\nDocumentation/admin-guide/mm/memory-hotplug.rst-574-================================ ===============================================\n--\narch/arm64/configs/defconfig=133=CONFIG_MEMORY_HOTPLUG=y\narch/arm64/configs/defconfig:134:CONFIG_MEMORY_HOTREMOVE=y\narch/arm64/configs/defconfig-135-CONFIG_KSM=y\n--\narch/arm64/mm/mmu.c=2219=static int __init prevent_memory_remove_init(void)\n--\narch/arm64/mm/mmu.c-2222-\narch/arm64/mm/mmu.c:2223:\tif (!IS_ENABLED(CONFIG_MEMORY_HOTREMOVE))\narch/arm64/mm/mmu.c-2224-\t\treturn ret;\n--\narch/loongarch/configs/loongson32_defconfig=101=CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_AUTO=y\n--\narch/loongarch/configs/loongson32_defconfig-103-# CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_MOVABLE is not set\narch/loongarch/configs/loongson32_defconfig:104:CONFIG_MEMORY_HOTREMOVE=y\narch/loongarch/configs/loongson32_defconfig-105-CONFIG_KSM=y\n--\narch/loongarch/configs/loongson64_defconfig=116=CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_AUTO=y\n--\narch/loongarch/configs/loongson64_defconfig-118-# CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_MOVABLE is not set\narch/loongarch/configs/loongson64_defconfig:119:CONFIG_MEMORY_HOTREMOVE=y\narch/loongarch/configs/loongson64_defconfig-120-CONFIG_KSM=y\n--\narch/powerpc/configs/powernv_defconfig=58=CONFIG_MEMORY_HOTPLUG=y\narch/powerpc/configs/powernv_defconfig:59:CONFIG_MEMORY_HOTREMOVE=y\narch/powerpc/configs/powernv_defconfig-60-CONFIG_KSM=y\n--\narch/powerpc/configs/ppc64_defconfig=88=CONFIG_MEMORY_HOTPLUG=y\narch/powerpc/configs/ppc64_defconfig:89:CONFIG_MEMORY_HOTREMOVE=y\narch/powerpc/configs/ppc64_defconfig-90-CONFIG_KSM=y\n--\narch/powerpc/platforms/pseries/hotplug-memory.c=222=static int dlpar_online_lmb(struct drmem_lmb *lmb)\n--\narch/powerpc/platforms/pseries/hotplug-memory.c-226-\narch/powerpc/platforms/pseries/hotplug-memory.c:227:#ifdef CONFIG_MEMORY_HOTREMOVE\narch/powerpc/platforms/pseries/hotplug-memory.c-228-static int dlpar_offline_lmb(struct drmem_lmb *lmb)\n--\narch/powerpc/platforms/pseries/hotplug-memory.c=558=static int dlpar_memory_remove_by_ic(u32 lmbs_to_remove, u32 drc_index)\n--\narch/powerpc/platforms/pseries/hotplug-memory.c-561-}\narch/powerpc/platforms/pseries/hotplug-memory.c:562:#endif /* CONFIG_MEMORY_HOTREMOVE */\narch/powerpc/platforms/pseries/hotplug-memory.c-563-\n--\narch/s390/configs/debug_defconfig=105=CONFIG_MEMORY_HOTPLUG=y\narch/s390/configs/debug_defconfig:106:CONFIG_MEMORY_HOTREMOVE=y\narch/s390/configs/debug_defconfig-107-CONFIG_KSM=y\n--\narch/s390/configs/defconfig=98=CONFIG_MEMORY_HOTPLUG=y\narch/s390/configs/defconfig:99:CONFIG_MEMORY_HOTREMOVE=y\narch/s390/configs/defconfig-100-CONFIG_KSM=y\n--\narch/x86/boot/compressed/acpi.c=157=acpi_physical_address get_rsdp_addr(void)\n--\narch/x86/boot/compressed/acpi.c-171-\narch/x86/boot/compressed/acpi.c:172:#if defined(CONFIG_RANDOMIZE_BASE) \u0026\u0026 defined(CONFIG_MEMORY_HOTREMOVE)\narch/x86/boot/compressed/acpi.c-173-/*\n--\narch/x86/boot/compressed/acpi.c=275=int count_immovable_mem_regions(void)\n--\narch/x86/boot/compressed/acpi.c-321-}\narch/x86/boot/compressed/acpi.c:322:#endif /* CONFIG_RANDOMIZE_BASE \u0026\u0026 CONFIG_MEMORY_HOTREMOVE */\n--\narch/x86/boot/compressed/kaslr.c=596=static bool process_mem_region(struct mem_vector *region,\n--\narch/x86/boot/compressed/kaslr.c-614-\narch/x86/boot/compressed/kaslr.c:615:#if defined(CONFIG_MEMORY_HOTREMOVE) \u0026\u0026 defined(CONFIG_ACPI)\narch/x86/boot/compressed/kaslr.c-616-\t/*\n--\narch/x86/boot/compressed/misc.h=171=static inline acpi_physical_address get_rsdp_addr(void) { return 0; }\n--\narch/x86/boot/compressed/misc.h-173-\narch/x86/boot/compressed/misc.h:174:#if defined(CONFIG_RANDOMIZE_BASE) \u0026\u0026 defined(CONFIG_MEMORY_HOTREMOVE) \u0026\u0026 defined(CONFIG_ACPI)\narch/x86/boot/compressed/misc.h-175-extern struct mem_vector immovable_mem[MAX_NUMNODES*2];\n--\ndrivers/base/memory.c=167=static ssize_t phys_index_show(struct device *dev,\n--\ndrivers/base/memory.c-176- * Legacy interface that we cannot remove. Always indicate \"removable\"\ndrivers/base/memory.c:177: * with CONFIG_MEMORY_HOTREMOVE - bad heuristic.\ndrivers/base/memory.c-178- */\ndrivers/base/memory.c=179=static ssize_t removable_show(struct device *dev, struct device_attribute *attr,\n--\ndrivers/base/memory.c-181-{\ndrivers/base/memory.c:182:\treturn sysfs_emit(buf, \"%d\\n\", (int)IS_ENABLED(CONFIG_MEMORY_HOTREMOVE));\ndrivers/base/memory.c-183-}\n--\ndrivers/base/memory.c=450=static ssize_t phys_device_show(struct device *dev,\n--\ndrivers/base/memory.c-459-\ndrivers/base/memory.c:460:#ifdef CONFIG_MEMORY_HOTREMOVE\ndrivers/base/memory.c-461-static int print_allowed_zone(char *buf, int len, int nid,\n--\ndrivers/base/memory.c=671=static struct attribute *memory_memblk_attrs[] = {\n--\ndrivers/base/memory.c-675-\t\u0026dev_attr_removable.attr,\ndrivers/base/memory.c:676:#ifdef CONFIG_MEMORY_HOTREMOVE\ndrivers/base/memory.c-677-\t\u0026dev_attr_valid_zones.attr,\n--\ndrivers/dax/kmem.c=163=static int dax_kmem_init_resources(struct dev_dax *dev_dax,\n--\ndrivers/dax/kmem.c-207-\ndrivers/dax/kmem.c:208:#ifdef CONFIG_MEMORY_HOTREMOVE\ndrivers/dax/kmem.c-209-/**\n--\ndrivers/dax/kmem.c=268=static int dax_kmem_do_hotremove(struct dev_dax *dev_dax,\n--\ndrivers/dax/kmem.c-272-}\ndrivers/dax/kmem.c:273:#endif /* CONFIG_MEMORY_HOTREMOVE */\ndrivers/dax/kmem.c-274-\n--\ndrivers/dax/kmem.c=383=static int dev_dax_kmem_probe(struct dev_dax *dev_dax)\n--\ndrivers/dax/kmem.c-480-\ndrivers/dax/kmem.c:481:#ifdef CONFIG_MEMORY_HOTREMOVE\ndrivers/dax/kmem.c-482-/*\n--\ndrivers/dax/kmem.c=549=static void dev_dax_kmem_remove(struct dev_dax *dev_dax)\n--\ndrivers/dax/kmem.c-559-}\ndrivers/dax/kmem.c:560:#endif /* CONFIG_MEMORY_HOTREMOVE */\ndrivers/dax/kmem.c-561-\n--\ninclude/linux/ioport.h=391=extern void __release_region(struct resource *, resource_size_t,\ninclude/linux/ioport.h-392-\t\t\t\tresource_size_t);\ninclude/linux/ioport.h:393:#ifdef CONFIG_MEMORY_HOTREMOVE\ninclude/linux/ioport.h-394-extern void release_mem_region_adjustable(resource_size_t, resource_size_t);\n--\ninclude/linux/memory_hotplug.h=260=static inline void pgdat_resize_init(struct pglist_data *pgdat) {}\n--\ninclude/linux/memory_hotplug.h-262-\ninclude/linux/memory_hotplug.h:263:#ifdef CONFIG_MEMORY_HOTREMOVE\ninclude/linux/memory_hotplug.h-264-\n--\ninclude/linux/memory_hotplug.h=290=static inline int offline_and_remove_memory_ranges(const struct range *ranges,\n--\ninclude/linux/memory_hotplug.h-294-}\ninclude/linux/memory_hotplug.h:295:#endif /* CONFIG_MEMORY_HOTREMOVE */\ninclude/linux/memory_hotplug.h-296-\n--\nkernel/configs/xen.config=15=CONFIG_MEMORY_HOTPLUG=y\nkernel/configs/xen.config:16:CONFIG_MEMORY_HOTREMOVE=y\nkernel/configs/xen.config-17-CONFIG_ZONE_DEVICE=y\n--\nkernel/resource.c=1446=EXPORT_SYMBOL(__release_region);\nkernel/resource.c-1447-\nkernel/resource.c:1448:#ifdef CONFIG_MEMORY_HOTREMOVE\nkernel/resource.c-1449-static void append_child_to_parent(struct resource *new_parent, struct resource *new_child)\n--\nkernel/resource.c=1507=void release_mem_region_adjustable(resource_size_t start, resource_size_t size)\n--\nkernel/resource.c-1596-}\nkernel/resource.c:1597:#endif\t/* CONFIG_MEMORY_HOTREMOVE */\nkernel/resource.c-1598-\n--\nmm/ksm.c=3311=void folio_migrate_ksm(struct folio *newfolio, struct folio *folio)\n--\nmm/ksm.c-3334-\nmm/ksm.c:3335:#ifdef CONFIG_MEMORY_HOTREMOVE\nmm/ksm.c-3336-static void wait_while_offlining(void)\n--\nmm/ksm.c=3459=static void wait_while_offlining(void)\n--\nmm/ksm.c-3461-}\nmm/ksm.c:3462:#endif /* CONFIG_MEMORY_HOTREMOVE */\nmm/ksm.c-3463-\n--\nmm/ksm.c=4019=static int __init ksm_init(void)\n--\nmm/ksm.c-4051-\nmm/ksm.c:4052:#ifdef CONFIG_MEMORY_HOTREMOVE\nmm/ksm.c-4053-\t/* There is no significance to this priority 100 */\n--\nmm/memory_hotplug.c=1774=bool mhp_range_allowed(u64 start, u64 size, bool need_mapping)\n--\nmm/memory_hotplug.c-1786-\nmm/memory_hotplug.c:1787:#ifdef CONFIG_MEMORY_HOTREMOVE\nmm/memory_hotplug.c-1788-/* Max offline_pages() migration passes before -EBUSY; 0 = retry forever. */\n--\nmm/memory_hotplug.c=2566=EXPORT_SYMBOL_GPL(offline_and_remove_memory_ranges);\nmm/memory_hotplug.c:2567:#endif /* CONFIG_MEMORY_HOTREMOVE */\n--\nmm/page_alloc.c=4429=static unsigned int zonelist_iter_begin(void)\nmm/page_alloc.c-4430-{\nmm/page_alloc.c:4431:\tif (IS_ENABLED(CONFIG_MEMORY_HOTREMOVE))\nmm/page_alloc.c-4432-\t\treturn read_seqbegin(\u0026zonelist_update_seq);\n--\nmm/page_alloc.c=4437=static unsigned int check_retry_zonelist(unsigned int seq)\nmm/page_alloc.c-4438-{\nmm/page_alloc.c:4439:\tif (IS_ENABLED(CONFIG_MEMORY_HOTREMOVE))\nmm/page_alloc.c-4440-\t\treturn read_seqretry(\u0026zonelist_update_seq, seq);\n--\nmm/page_alloc.c=7688=void zone_pcp_reset(struct zone *zone)\n--\nmm/page_alloc.c-7706-\nmm/page_alloc.c:7707:#ifdef CONFIG_MEMORY_HOTREMOVE\nmm/page_alloc.c-7708-/*\n--\ntools/testing/selftests/bpf/config.aarch64=90=CONFIG_MEMORY_HOTPLUG=y\ntools/testing/selftests/bpf/config.aarch64:91:CONFIG_MEMORY_HOTREMOVE=y\ntools/testing/selftests/bpf/config.aarch64-92-CONFIG_NAMESPACES=y\n--\ntools/testing/selftests/bpf/config.s390x=76=CONFIG_MEMORY_HOTPLUG=y\ntools/testing/selftests/bpf/config.s390x:77:CONFIG_MEMORY_HOTREMOVE=y\ntools/testing/selftests/bpf/config.s390x-78-CONFIG_NAMESPACES=y\n--\ntools/testing/selftests/dax/config=3=CONFIG_MEMORY_HOTPLUG=y\ntools/testing/selftests/dax/config:4:CONFIG_MEMORY_HOTREMOVE=y\n--\ntools/testing/selftests/memory-hotplug/config=3=CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m\ntools/testing/selftests/memory-hotplug/config:4:CONFIG_MEMORY_HOTREMOVE=y\n--\ntools/testing/selftests/mm/config=17=CONFIG_MEMORY_HOTPLUG=y\ntools/testing/selftests/mm/config:18:CONFIG_MEMORY_HOTREMOVE=y\ntools/testing/selftests/mm/config-19-CONFIG_ACPI_HOTPLUG_MEMORY=y\n--\ntools/testing/selftests/vsock/config=109=CONFIG_MEMORY_HOTPLUG=y\ntools/testing/selftests/vsock/config:110:CONFIG_MEMORY_HOTREMOVE=y\ntools/testing/selftests/vsock/config-111-CONFIG_ZONE_DEVICE=y\n"
} |
| 7/2 | 2026/07/23 02:27 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 14865 output: 92 thoughts: 244 Thoughts: **My Fuzzing Strategy: Targeting Memory Hot-Removal** Okay, so this patch is clearly focused on memory hot-removal, specifically within the `mm/memory_hotplug.c` file. The modifications are encapsulated by `#ifdef CONFIG_MEMORY_HOTREMOVE`, which is good, that gives me a clear entry point. Looking closer, it's the `offline_pages` function that's been modified. The fact that `offline_pages` is the target function and that it's reachable when memory is being offlined makes it a prime candidate for fuzzing. My strategy is to zero in on this function. I'll flag it as high-priority using `WorthFuzzing=true`. To ensure the fuzzer concentrates its efforts, I'll set `FocusSymbols=["offline_pages"]`. Also, the necessary configs are very obvious, `MEMORY_HOTREMOVE` and `MEMORY_HOTPLUG` must be enabled, so I'll set `EnableConfigs=["MEMORY_HOTREMOVE", "MEMORY_HOTPLUG"]`. The presence of `ACPI_HOTPLUG_MEMORY` in the selftest config is not interesting, since it's only there for the test, nothing to see there. Just to be absolutely certain, I've confirmed that `offline_pages` is indeed the only function directly modified by this patch, and it adds the `offline_migrate_max_passes` module parameter, which is useful to know. Now, I'll put this information into the `set-results` tool to get things rolling. |
| 8/2 | 2026/07/23 02:27 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"MEMORY_HOTPLUG",
"MEMORY_HOTREMOVE"
],
"FocusSymbols": [
"offline_pages"
],
"Reasoning": "The patch modifies the core memory hotplug logic in `offline_pages` to limit the number of migration passes during memory offlining. This is a functional change that can be reached when memory is offlined.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"MEMORY_HOTPLUG",
"MEMORY_HOTREMOVE"
],
"FocusSymbols": [
"offline_pages"
],
"Reasoning": "The patch modifies the core memory hotplug logic in `offline_pages` to limit the number of migration passes during memory offlining. This is a functional change that can be reached when memory is offlined.",
"WorthFuzzing": true
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|