ID Workflow Result Correct Bug Created Started Finished Revision
236e5b35 repro-c Reproduced: ✅ ❓ WARNING in __mod_zone_page_state 2026/08/27 19:16 2026/08/27 19:17 2026/08/27 19:48 bd6de8ec
Agent: prod-syz-agent-4
External Bug ID: ---

Inputs:
BaseBranch master
BaseCommit RC
BaseRepository git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
BugTitle WARNING in __mod_zone_page_state
CrashLogID 5116686769848320
CrashReportID 6400211171147776
KernelCommit 66498c75b4f8017f62d720d9b59675bdf3abce91
KernelConfig
Show (281286 bytes)
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 syzkaller Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Debian 14.2.0-19) 14.2.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=140200
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=24400
CONFIG_LD_IS_BFD=y
CONFIG_LD_VERSION=24400
CONFIG_LLD_VERSION=0
CONFIG_RUSTC_VERSION=109600
CONFIG_RUST_IS_AVAILABLE=y
CONFIG_RUSTC_LLVM_VERSION=220102
CONFIG_RUSTC_LLVM_MAJOR_VERSION=22
CONFIG_CC_CAN_LINK=y
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT=y
CONFIG_TOOLS_SUPPORT_RELR=y
CONFIG_CC_HAS_ASM_INLINE=y
CONFIG_CC_HAS_ASSUME=y
CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
CONFIG_LD_CAN_USE_KEEP_IN_OVERLAY=y
CONFIG_RUSTC_HAS_SPAN_FILE=y
CONFIG_RUSTC_HAS_UNNECESSARY_TRANSMUTES=y
CONFIG_RUSTC_HAS_FILE_WITH_NUL=y
CONFIG_RUSTC_HAS_FILE_AS_C_STR=y
CONFIG_PAHOLE_VERSION=130
CONFIG_CONSTRUCTORS=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_TABLE_SORT=y
CONFIG_THREAD_INFO_IN_TASK=y

#
# General setup
#
CONFIG_INIT_ENV_ARG_LIMIT=32
# CONFIG_COMPILE_TEST is not set
# CONFIG_WERROR is not set
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_BUILD_SALT=""
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_LZ4=y
CONFIG_HAVE_KERNEL_ZSTD=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
# CONFIG_KERNEL_LZ4 is not set
# CONFIG_KERNEL_ZSTD is not set
CONFIG_DEFAULT_INIT=""
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_SYSVIPC_COMPAT=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_WATCH_QUEUE=y
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_AUDIT=y
CONFIG_HAVE_ARCH_AUDITSYSCALL=y
CONFIG_AUDITSYSCALL=y

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_GENERIC_IRQ_MIGRATION=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_DOMAIN_HIERARCHY=y
CONFIG_GENERIC_MSI_IRQ=y
CONFIG_GENERIC_IRQ_MATRIX_ALLOCATOR=y
CONFIG_GENERIC_IRQ_RESERVATION_MODE=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
# CONFIG_GENERIC_IRQ_DEBUGFS is not set
# end of IRQ subsystem

CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_INIT=y
CONFIG_ARCH_WANTS_CLOCKSOURCE_READ_INLINE=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST_IDLE=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CLOCKEVENTS_COUPLED=y
CONFIG_GENERIC_CLOCKEVENTS_COUPLED_INLINE=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_HRTIMER_REARM_DEFERRED=y
CONFIG_HAVE_POSIX_CPU_TIMERS_TASK_WORK=y
CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y
CONFIG_CONTEXT_TRACKING=y
CONFIG_CONTEXT_TRACKING_IDLE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
CONFIG_NO_HZ_IDLE=y
# CONFIG_NO_HZ_FULL is not set
CONFIG_CONTEXT_TRACKING_USER=y
# CONFIG_CONTEXT_TRACKING_USER_FORCE is not set
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_POSIX_AUX_CLOCKS=y
# end of Timers subsystem

CONFIG_BPF=y
CONFIG_HAVE_EBPF_JIT=y
CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y

#
# BPF subsystem
#
CONFIG_BPF_SYSCALL=y
CONFIG_BPF_JIT=y
# CONFIG_BPF_JIT_ALWAYS_ON is not set
CONFIG_BPF_JIT_DEFAULT_ON=y
# CONFIG_BPF_UNPRIV_DEFAULT_OFF is not set
CONFIG_BPF_PRELOAD=y
CONFIG_BPF_PRELOAD_UMD=y
CONFIG_BPF_LSM=y
# end of BPF subsystem

CONFIG_PREEMPT_BUILD=y
CONFIG_ARCH_HAS_PREEMPT_LAZY=y
CONFIG_PREEMPT=y
# CONFIG_PREEMPT_LAZY is not set
# CONFIG_PREEMPT_RT is not set
CONFIG_PREEMPT_COUNT=y
CONFIG_HAS_SEPARATE_PREEMPT_RESCHED_BITS=y
CONFIG_PREEMPTION=y
CONFIG_PREEMPT_DYNAMIC=y
CONFIG_SCHED_CORE=y

#
# CPU/Task time and stats accounting
#
CONFIG_VIRT_CPU_ACCOUNTING=y
# CONFIG_TICK_CPU_ACCOUNTING is not set
CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_SCHED_AVG_IRQ=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_PSI=y
# CONFIG_PSI_DEFAULT_DISABLED is not set
# end of CPU/Task time and stats accounting

CONFIG_CPU_ISOLATION=y

#
# RCU Subsystem
#
CONFIG_TREE_RCU=y
CONFIG_PREEMPT_RCU=y
# CONFIG_RCU_EXPERT is not set
CONFIG_TREE_SRCU=y
CONFIG_TASKS_RCU_GENERIC=y
CONFIG_NEED_TASKS_RCU=y
CONFIG_TASKS_RCU=y
CONFIG_TASKS_TRACE_RCU=y
CONFIG_RCU_STALL_COMMON=y
CONFIG_RCU_NEED_SEGCBLIST=y
# end of RCU Subsystem

CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
# CONFIG_IKHEADERS is not set
CONFIG_LOG_BUF_SHIFT=18
CONFIG_LOG_CPU_MAX_BUF_SHIFT=12
# CONFIG_PRINTK_INDEX is not set
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y

#
# Scheduler features
#
# CONFIG_UCLAMP_TASK is not set
# CONFIG_SCHED_PROXY_EXEC is not set
# end of Scheduler features

CONFIG_ARCH_HAS_PTE_PROTNONE=y
CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y
CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y
CONFIG_CC_HAS_INT128=y
CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
CONFIG_CC_MS_EXTENSIONS="-fms-extensions"
CONFIG_GCC10_NO_ARRAY_BOUNDS=y
CONFIG_CC_NO_ARRAY_BOUNDS=y
CONFIG_GCC_NO_STRINGOP_OVERFLOW=y
CONFIG_CC_NO_STRINGOP_OVERFLOW=y
CONFIG_ARCH_SUPPORTS_INT128=y
CONFIG_NUMA_BALANCING=y
CONFIG_SCHED_CACHE=y
CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y
CONFIG_SLAB_OBJ_EXT=y
CONFIG_CGROUPS=y
CONFIG_PAGE_COUNTER=y
# CONFIG_CGROUP_FAVOR_DYNMODS is not set
CONFIG_MEMCG=y
CONFIG_MEMCG_V1=y
CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_WRITEBACK=y
CONFIG_CGROUP_SCHED=y
CONFIG_GROUP_SCHED_WEIGHT=y
CONFIG_GROUP_SCHED_BANDWIDTH=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_CFS_BANDWIDTH=y
# CONFIG_RT_GROUP_SCHED is not set
CONFIG_SCHED_MM_CID=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_RDMA=y
# CONFIG_CGROUP_DMEM is not set
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
# CONFIG_CPUSETS_V1 is not set
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
# CONFIG_CGROUP_BPF is not set
CONFIG_CGROUP_MISC=y
CONFIG_CGROUP_DEBUG=y
CONFIG_SOCK_CGROUP_DATA=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_TIME_NS=y
CONFIG_TIME_NS_VDSO=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_CHECKPOINT_RESTORE=y
# CONFIG_SCHED_AUTOGROUP is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y
CONFIG_RD_ZSTD=y
# CONFIG_BOOT_CONFIG is not set
CONFIG_CMDLINE_LOG_WRAP_IDEAL_LEN=1021
CONFIG_INITRAMFS_PRESERVE_MTIME=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_LD_ORPHAN_WARN=y
CONFIG_LD_ORPHAN_WARN_LEVEL="warn"
CONFIG_HAVE_UID16=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_SYSFS_SYSCALL=y
CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_EXPERT=y
CONFIG_UID16=y
CONFIG_MULTIUSER=y
CONFIG_SGETMASK_SYSCALL=y
CONFIG_FHANDLE=y
CONFIG_POSIX_TIMERS=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_PCSPKR_PLATFORM=y
# CONFIG_BASE_SMALL is not set
CONFIG_FUTEX=y
CONFIG_FUTEX_PI=y
CONFIG_FUTEX_PRIVATE_HASH=y
CONFIG_FUTEX_MPOL=y
CONFIG_HAVE_FUTEX_ROBUST_UNLOCK=y
CONFIG_FUTEX_ROBUST_UNLOCK=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_IO_URING=y
CONFIG_IO_URING_MOCK_FILE=y
CONFIG_ADVISE_SYSCALLS=y
CONFIG_MEMBARRIER=y
CONFIG_KCMP=y
CONFIG_RSEQ=y
CONFIG_RSEQ_SLICE_EXTENSION=y
# CONFIG_RSEQ_STATS is not set
# CONFIG_RSEQ_DEBUG_DEFAULT_ENABLE is not set
CONFIG_CACHESTAT_SYSCALL=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_SELFTEST is not set
CONFIG_KALLSYMS_ALL=y
CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y
CONFIG_ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_GUEST_PERF_EVENTS=y
CONFIG_PERF_GUEST_MEDIATED_PMU=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
# end of Kernel Performance Events And Counters

CONFIG_SYSTEM_DATA_VERIFICATION=y
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y

#
# Kexec and crash features
#
CONFIG_CRASH_RESERVE=y
CONFIG_VMCORE_INFO=y
CONFIG_KEXEC_CORE=y
CONFIG_KEXEC=y
# CONFIG_KEXEC_FILE is not set
# CONFIG_KEXEC_JUMP is not set
CONFIG_CRASH_DUMP=y
CONFIG_CRASH_HOTPLUG=y
CONFIG_CRASH_MAX_MEMORY_RANGES=8192
# end of Kexec and crash features

#
# Live Update and Kexec HandOver
#
# CONFIG_KEXEC_HANDOVER is not set
# end of Live Update and Kexec HandOver
# end of General setup

CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_MMU=y
CONFIG_ARCH_MMAP_RND_BITS_MIN=28
CONFIG_ARCH_MMAP_RND_BITS_MAX=32
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_CSUM=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_AUDIT_ARCH=y
CONFIG_KASAN_SHADOW_OFFSET=0xdffffc0000000000
CONFIG_HAVE_INTEL_TXT=y
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_PGTABLE_LEVELS=5

#
# Processor type and features
#
CONFIG_SMP=y
CONFIG_X86_X2APIC=y
# CONFIG_X86_POSTED_MSI is not set
CONFIG_X86_MPPARSE=y
# CONFIG_X86_CPU_RESCTRL is not set
CONFIG_X86_FRED=y
CONFIG_X86_EXTENDED_PLATFORM=y
# CONFIG_X86_NUMACHIP is not set
# CONFIG_X86_VSMP is not set
# CONFIG_X86_INTEL_MID is not set
# CONFIG_X86_GOLDFISH is not set
# CONFIG_X86_INTEL_LPSS is not set
# CONFIG_X86_AMD_PLATFORM_DEVICE is not set
CONFIG_IOSF_MBI=y
# CONFIG_IOSF_MBI_DEBUG is not set
CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_HYPERVISOR_GUEST=y
CONFIG_PARAVIRT=y
CONFIG_PARAVIRT_SPINLOCKS=y
CONFIG_X86_HV_CALLBACK_VECTOR=y
# CONFIG_XEN is not set
CONFIG_KVM_GUEST=y
CONFIG_ARCH_CPUIDLE_HALTPOLL=y
CONFIG_PVH=y
# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
CONFIG_PARAVIRT_CLOCK=y
# CONFIG_JAILHOUSE_GUEST is not set
# CONFIG_ACRN_GUEST is not set
# CONFIG_BHYVE_GUEST is not set
CONFIG_CC_HAS_MARCH_NATIVE=y
# CONFIG_X86_NATIVE_CPU is not set
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_TSC=y
CONFIG_X86_HAVE_PAE=y
CONFIG_X86_CX8=y
CONFIG_X86_CMOV=y
CONFIG_X86_MINIMUM_CPU_FAMILY=64
CONFIG_X86_DEBUGCTLMSR=y
CONFIG_IA32_FEAT_CTL=y
CONFIG_X86_VMX_FEATURE_NAMES=y
CONFIG_PROCESSOR_SELECT=y
CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
# CONFIG_CPU_SUP_HYGON is not set
# CONFIG_CPU_SUP_CENTAUR is not set
# CONFIG_CPU_SUP_ZHAOXIN is not set
CONFIG_BROADCAST_TLB_FLUSH=y
CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
CONFIG_DMI=y
# CONFIG_GART_IOMMU is not set
CONFIG_BOOT_VESA_SUPPORT=y
# CONFIG_MAXSMP is not set
CONFIG_NR_CPUS_RANGE_BEGIN=2
CONFIG_NR_CPUS_RANGE_END=512
CONFIG_NR_CPUS_DEFAULT=64
CONFIG_NR_CPUS=8
CONFIG_SCHED_MC_PRIO=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_ACPI_MADT_WAKEUP=y
CONFIG_X86_IO_APIC=y
CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
CONFIG_X86_MCE=y
# CONFIG_X86_MCELOG_LEGACY is not set
CONFIG_X86_MCE_INTEL=y
CONFIG_X86_MCE_AMD=y
CONFIG_X86_MCE_THRESHOLD=y
# CONFIG_X86_MCE_INJECT is not set

#
# Performance monitoring
#
CONFIG_PERF_EVENTS_INTEL_UNCORE=y
CONFIG_PERF_EVENTS_INTEL_RAPL=y
CONFIG_PERF_EVENTS_INTEL_CSTATE=y
# CONFIG_PERF_EVENTS_AMD_POWER is not set
CONFIG_PERF_EVENTS_AMD_UNCORE=y
# CONFIG_PERF_EVENTS_AMD_BRS is not set
# end of Performance monitoring

CONFIG_X86_16BIT=y
CONFIG_X86_ESPFIX64=y
CONFIG_X86_VSYSCALL_EMULATION=y
CONFIG_X86_IOPL_IOPERM=y
CONFIG_MICROCODE=y
# CONFIG_MICROCODE_LATE_LOADING is not set
# CONFIG_MICROCODE_DBG is not set
CONFIG_X86_MSR=y
CONFIG_X86_CPUID=y
CONFIG_X86_DIRECT_GBPAGES=y
# CONFIG_X86_CPA_STATISTICS is not set
CONFIG_NUMA=y
CONFIG_AMD_NUMA=y
CONFIG_X86_64_ACPI_NUMA=y
CONFIG_NODES_SHIFT=6
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
# CONFIG_ARCH_MEMORY_PROBE is not set
CONFIG_ARCH_PROC_KCORE_TEXT=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
# CONFIG_X86_PMEM_LEGACY is not set
# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
CONFIG_MTRR=y
# CONFIG_MTRR_SANITIZER is not set
CONFIG_X86_PAT=y
CONFIG_X86_UMIP=y
CONFIG_CC_HAS_IBT=y
CONFIG_X86_CET=y
CONFIG_X86_KERNEL_IBT=y
CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=y
CONFIG_ARCH_PKEY_BITS=4
# CONFIG_X86_INTEL_TSX_MODE_OFF is not set
CONFIG_X86_INTEL_TSX_MODE_ON=y
# CONFIG_X86_INTEL_TSX_MODE_AUTO is not set
CONFIG_X86_SGX=y
CONFIG_X86_USER_SHADOW_STACK=y
# CONFIG_INTEL_TDX_HOST is not set
# CONFIG_EFI is not set
CONFIG_HZ_100=y
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=100
CONFIG_SCHED_HRTICK=y
CONFIG_ARCH_SUPPORTS_KEXEC=y
CONFIG_ARCH_SUPPORTS_KEXEC_FILE=y
CONFIG_ARCH_SUPPORTS_KEXEC_PURGATORY=y
CONFIG_ARCH_SUPPORTS_KEXEC_SIG=y
CONFIG_ARCH_SUPPORTS_KEXEC_SIG_FORCE=y
CONFIG_ARCH_SUPPORTS_KEXEC_BZIMAGE_VERIFY_SIG=y
CONFIG_ARCH_SUPPORTS_KEXEC_JUMP=y
CONFIG_ARCH_SUPPORTS_KEXEC_HANDOVER=y
CONFIG_ARCH_SUPPORTS_CRASH_DUMP=y
CONFIG_ARCH_DEFAULT_CRASH_DUMP=y
CONFIG_ARCH_SUPPORTS_CRASH_HOTPLUG=y
CONFIG_ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION=y
CONFIG_PHYSICAL_START=0x1000000
# CONFIG_RELOCATABLE is not set
CONFIG_PHYSICAL_ALIGN=0x200000
CONFIG_HOTPLUG_CPU=y
# CONFIG_COMPAT_VDSO is not set
CONFIG_LEGACY_VSYSCALL_XONLY=y
# CONFIG_LEGACY_VSYSCALL_NONE is not set
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="earlyprintk=serial net.ifnames=0 sysctl.kernel.hung_task_all_cpu_backtrace=1 ima_policy=tcb nf-conntrack-ftp.ports=20000 nf-conntrack-tftp.ports=20000 nf-conntrack-sip.ports=20000 nf-conntrack-irc.ports=20000 nf-conntrack-sane.ports=20000 binder.debug_mask=0 rcupdate.rcu_expedited=1 rcupdate.rcu_cpu_stall_cputime=1 no_hash_pointers page_owner=on sysctl.vm.nr_hugepages=4 sysctl.vm.nr_overcommit_hugepages=4 secretmem.enable=1 sysctl.max_rcu_stall_to_panic=1 msr.allow_writes=off coredump_filter=0xffff root=/dev/sda console=ttyS0 vsyscall=native numa=fake=2 kvm-intel.nested=1 spec_store_bypass_disable=prctl nopcid vivid.n_devs=64 vivid.multiplanar=1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2 netrom.nr_ndevs=32 rose.rose_ndevs=32 smp.csd_lock_timeout=100000 watchdog_thresh=55 workqueue.watchdog_thresh=140 sysctl.net.core.netdev_unregister_timeout_secs=140 dummy_hcd.num=32 max_loop=32 nbds_max=32 comedi.comedi_num_legacy_minors=4 panic_on_warn=1"
# CONFIG_CMDLINE_OVERRIDE is not set
CONFIG_MODIFY_LDT_SYSCALL=y
# CONFIG_STRICT_SIGALTSTACK_SIZE is not set
CONFIG_HAVE_LIVEPATCH=y
CONFIG_HAVE_KLP_BUILD=y
CONFIG_X86_BUS_LOCK_DETECT=y
# end of Processor type and features

CONFIG_CC_HAS_NAMED_AS=y
CONFIG_CC_HAS_NAMED_AS_FIXED_SANITIZERS=y
CONFIG_USE_X86_SEG_SUPPORT=y
CONFIG_CC_HAS_SLS=y
CONFIG_CC_HAS_RETURN_THUNK=y
CONFIG_CC_HAS_ENTRY_PADDING=y
CONFIG_FUNCTION_PADDING_CFI=11
CONFIG_FUNCTION_PADDING_BYTES=16
CONFIG_CALL_PADDING=y
CONFIG_HAVE_CALL_THUNKS=y
CONFIG_CALL_THUNKS=y
CONFIG_CPU_MITIGATIONS=y
CONFIG_MITIGATION_PAGE_TABLE_ISOLATION=y
CONFIG_MITIGATION_RETPOLINE=y
CONFIG_MITIGATION_RETHUNK=y
CONFIG_MITIGATION_UNRET_ENTRY=y
CONFIG_MITIGATION_CALL_DEPTH_TRACKING=y
# CONFIG_CALL_THUNKS_DEBUG is not set
CONFIG_MITIGATION_IBPB_ENTRY=y
CONFIG_MITIGATION_IBRS_ENTRY=y
CONFIG_MITIGATION_SRSO=y
# CONFIG_MITIGATION_SLS is not set
CONFIG_MITIGATION_GDS=y
CONFIG_MITIGATION_RFDS=y
CONFIG_MITIGATION_SPECTRE_BHI=y
CONFIG_MITIGATION_MDS=y
CONFIG_MITIGATION_TAA=y
CONFIG_MITIGATION_MMIO_STALE_DATA=y
CONFIG_MITIGATION_L1TF=y
CONFIG_MITIGATION_RETBLEED=y
CONFIG_MITIGATION_SPECTRE_V1=y
CONFIG_MITIGATION_SPECTRE_V2=y
CONFIG_MITIGATION_SRBDS=y
CONFIG_MITIGATION_SSB=y
CONFIG_MITIGATION_ITS=y
CONFIG_MITIGATION_TSA=y
# CONFIG_MITIGATION_VMSCAPE is not set
CONFIG_ARCH_HAS_ADD_PAGES=y

#
# Power management and ACPI options
#
CONFIG_ARCH_HIBERNATION_HEADER=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
# CONFIG_SUSPEND_SKIP_SYNC is not set
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_HIBERNATION=y
CONFIG_HIBERNATION_SNAPSHOT_DEV=y
CONFIG_HIBERNATION_COMP_LZO=y
# CONFIG_HIBERNATION_COMP_LZ4 is not set
CONFIG_HIBERNATION_DEF_COMP="lzo"
CONFIG_PM_STD_PARTITION=""
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
# CONFIG_PM_AUTOSLEEP is not set
# CONFIG_PM_USERSPACE_AUTOSLEEP is not set
# CONFIG_PM_WAKELOCKS is not set
# CONFIG_PM_QOS_CPU_SYSTEM_WAKEUP is not set
CONFIG_PM=y
CONFIG_PM_DEBUG=y
# CONFIG_PM_ADVANCED_DEBUG is not set
# CONFIG_PM_TEST_SUSPEND is not set
CONFIG_PM_SLEEP_DEBUG=y
# CONFIG_DPM_WATCHDOG is not set
CONFIG_PM_TRACE=y
CONFIG_PM_TRACE_RTC=y
CONFIG_PM_CLK=y
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
# CONFIG_ENERGY_MODEL is not set
CONFIG_ARCH_SUPPORTS_ACPI=y
CONFIG_ACPI=y
CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y
CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y
CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y
CONFIG_ACPI_THERMAL_LIB=y
# CONFIG_ACPI_DEBUGGER is not set
CONFIG_ACPI_SPCR_TABLE=y
# CONFIG_ACPI_FPDT is not set
CONFIG_ACPI_LPIT=y
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y
CONFIG_ACPI_EC=y
# CONFIG_ACPI_EC_DEBUGFS is not set
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_VIDEO=y
CONFIG_ACPI_FAN=y
# CONFIG_ACPI_TAD is not set
CONFIG_ACPI_DOCK=y
CONFIG_ACPI_CPU_FREQ_PSS=y
CONFIG_ACPI_PROCESSOR_CSTATE=y
CONFIG_ACPI_PROCESSOR_IDLE=y
CONFIG_ACPI_CPPC_LIB=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_HOTPLUG_CPU=y
# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set
CONFIG_ACPI_THERMAL=y
CONFIG_ACPI_PLATFORM_PROFILE=y
CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y
CONFIG_ACPI_TABLE_UPGRADE=y
CONFIG_ACPI_DEBUG=y
# CONFIG_ACPI_PCI_SLOT is not set
CONFIG_ACPI_CONTAINER=y
# CONFIG_ACPI_HOTPLUG_MEMORY is not set
CONFIG_ACPI_HOTPLUG_IOAPIC=y
# CONFIG_ACPI_SBS is not set
# CONFIG_ACPI_HED is not set
# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set
CONFIG_ACPI_NHLT=y
CONFIG_ACPI_NFIT=y
# CONFIG_NFIT_SECURITY_DEBUG is not set
CONFIG_ACPI_NUMA=y
# CONFIG_ACPI_HMAT is not set
CONFIG_HAVE_ACPI_APEI=y
CONFIG_HAVE_ACPI_APEI_NMI=y
# CONFIG_ACPI_APEI is not set
# CONFIG_ACPI_DPTF is not set
# CONFIG_ACPI_EXTLOG is not set
# CONFIG_ACPI_CONFIGFS is not set
# CONFIG_ACPI_PFRUT is not set
CONFIG_ACPI_PCC=y
# CONFIG_ACPI_FFH is not set
CONFIG_ACPI_MRRM=y
CONFIG_PMIC_OPREGION=y
CONFIG_BXT_WC_PMIC_OPREGION=y
# CONFIG_CHT_WC_PMIC_OPREGION is not set
CONFIG_X86_PM_TIMER=y

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_COMMON=y
# CONFIG_CPU_FREQ_STAT is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y

#
# CPU frequency scaling drivers
#
# CONFIG_CPUFREQ_DT is not set
# CONFIG_CPUFREQ_DT_PLATDEV is not set
CONFIG_X86_INTEL_PSTATE=y
# CONFIG_X86_PCC_CPUFREQ is not set
CONFIG_X86_AMD_PSTATE=y
CONFIG_X86_AMD_PSTATE_DEFAULT_MODE=3
# CONFIG_X86_AMD_PSTATE_UT is not set
CONFIG_X86_ACPI_CPUFREQ=y
CONFIG_X86_ACPI_CPUFREQ_CPB=y
# CONFIG_X86_POWERNOW_K8 is not set
# CONFIG_X86_AMD_FREQ_SENSITIVITY is not set
# CONFIG_X86_SPEEDSTEP_CENTRINO is not set
# CONFIG_X86_P4_CLOCKMOD is not set

#
# shared options
#
CONFIG_CPUFREQ_ARCH_CUR_FREQ=y
# end of CPU Frequency scaling

#
# CPU Idle
#
CONFIG_CPU_IDLE=y
# CONFIG_CPU_IDLE_GOV_LADDER is not set
CONFIG_CPU_IDLE_GOV_MENU=y
# CONFIG_CPU_IDLE_GOV_TEO is not set
CONFIG_CPU_IDLE_GOV_HALTPOLL=y
CONFIG_HALTPOLL_CPUIDLE=y
# end of CPU Idle

CONFIG_INTEL_IDLE=y
# end of Power management and ACPI options

#
# Bus options (PCI etc.)
#
CONFIG_PCI_DIRECT=y
CONFIG_PCI_MMCONFIG=y
CONFIG_MMCONF_FAM10H=y
CONFIG_ISA_BUS=y
CONFIG_ISA_DMA_API=y
CONFIG_AMD_NB=y
CONFIG_AMD_NODE=y
# end of Bus options (PCI etc.)

#
# Binary Emulations
#
CONFIG_IA32_EMULATION=y
# CONFIG_IA32_EMULATION_DEFAULT_DISABLED is not set
CONFIG_X86_X32_ABI=y
CONFIG_COMPAT_32=y
CONFIG_COMPAT=y
CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
# end of Binary Emulations

CONFIG_KVM_COMMON=y
CONFIG_HAVE_KVM_PFNCACHE=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_IRQ_ROUTING=y
CONFIG_HAVE_KVM_DIRTY_RING=y
CONFIG_HAVE_KVM_DIRTY_RING_TSO=y
CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_HAVE_KVM_MSI=y
CONFIG_HAVE_KVM_READONLY_MEM=y
CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
CONFIG_KVM_VFIO=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_KVM_GENERIC_PRE_FAULT_MEMORY=y
CONFIG_KVM_COMPAT=y
CONFIG_HAVE_KVM_IRQ_BYPASS=y
CONFIG_HAVE_KVM_NO_POLL=y
CONFIG_VIRT_XFER_TO_GUEST_WORK=y
CONFIG_HAVE_KVM_PM_NOTIFIER=y
CONFIG_KVM_GENERIC_HARDWARE_ENABLING=y
CONFIG_KVM_ELIDE_TLB_FLUSH_IF_YOUNG=y
CONFIG_KVM_MMU_LOCKLESS_AGING=y
CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES=y
CONFIG_KVM_GUEST_MEMFD=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM_X86=y
CONFIG_KVM=y
CONFIG_KVM_SW_PROTECTED_VM=y
CONFIG_KVM_INTEL=y
# CONFIG_KVM_INTEL_PROVE_VE is not set
CONFIG_X86_SGX_KVM=y
CONFIG_KVM_AMD=y
CONFIG_KVM_IOAPIC=y
CONFIG_KVM_SMM=y
CONFIG_KVM_HYPERV=y
CONFIG_KVM_XEN=y
CONFIG_KVM_PROVE_MMU=y
CONFIG_KVM_MAX_NR_VCPUS=1024
CONFIG_X86_REQUIRED_FEATURE_ALWAYS=y
CONFIG_X86_REQUIRED_FEATURE_NOPL=y
CONFIG_X86_REQUIRED_FEATURE_CX8=y
CONFIG_X86_REQUIRED_FEATURE_CMOV=y
CONFIG_X86_REQUIRED_FEATURE_CPUID=y
CONFIG_X86_REQUIRED_FEATURE_FPU=y
CONFIG_X86_REQUIRED_FEATURE_PAE=y
CONFIG_X86_REQUIRED_FEATURE_PSE=y
CONFIG_X86_REQUIRED_FEATURE_PGE=y
CONFIG_X86_REQUIRED_FEATURE_MSR=y
CONFIG_X86_REQUIRED_FEATURE_FXSR=y
CONFIG_X86_REQUIRED_FEATURE_XMM=y
CONFIG_X86_REQUIRED_FEATURE_XMM2=y
CONFIG_X86_REQUIRED_FEATURE_LM=y
CONFIG_X86_DISABLED_FEATURE_VME=y
CONFIG_X86_DISABLED_FEATURE_K6_MTRR=y
CONFIG_X86_DISABLED_FEATURE_CYRIX_ARR=y
CONFIG_X86_DISABLED_FEATURE_CENTAUR_MCR=y
CONFIG_X86_DISABLED_FEATURE_LAM=y
CONFIG_X86_DISABLED_FEATURE_XENPV=y
CONFIG_X86_DISABLED_FEATURE_TDX_GUEST=y
CONFIG_X86_DISABLED_FEATURE_SEV_SNP=y
CONFIG_AS_WRUSS=y
CONFIG_ARCH_CONFIGURES_CPU_MITIGATIONS=y

#
# General architecture-dependent options
#
CONFIG_HOTPLUG_SMT=y
CONFIG_ARCH_SUPPORTS_SCHED_SMT=y
CONFIG_ARCH_SUPPORTS_SCHED_CLUSTER=y
CONFIG_ARCH_SUPPORTS_SCHED_MC=y
CONFIG_SCHED_SMT=y
CONFIG_SCHED_CLUSTER=y
CONFIG_SCHED_MC=y
CONFIG_HOTPLUG_CORE_SYNC=y
CONFIG_HOTPLUG_CORE_SYNC_DEAD=y
CONFIG_HOTPLUG_CORE_SYNC_FULL=y
CONFIG_HOTPLUG_SPLIT_STARTUP=y
CONFIG_HOTPLUG_PARALLEL=y
CONFIG_GENERIC_IRQ_ENTRY=y
CONFIG_GENERIC_SYSCALL=y
CONFIG_GENERIC_ENTRY=y
CONFIG_ARCH_SUPPORTS_SYSCALL_USER_DISPATCH=y
CONFIG_SYSCALL_USER_DISPATCH=y
# CONFIG_KPROBES is not set
CONFIG_JUMP_LABEL=y
# CONFIG_STATIC_KEYS_SELFTEST is not set
# CONFIG_STATIC_CALL_SELFTEST is not set
CONFIG_UPROBES=y
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_ARCH_USE_BUILTIN_BSWAP=y
CONFIG_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_OPTPROBES=y
CONFIG_HAVE_KPROBES_ON_FTRACE=y
CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y
CONFIG_HAVE_FUNCTION_ERROR_INJECTION=y
CONFIG_HAVE_NMI=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_CONTIGUOUS=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_ARCH_HAS_FORTIFY_SOURCE=y
CONFIG_ARCH_HAS_SET_MEMORY=y
CONFIG_ARCH_HAS_SET_DIRECT_MAP=y
CONFIG_ARCH_HAS_CPU_FINALIZE_INIT=y
CONFIG_ARCH_HAS_DELAY_TIMER=y
CONFIG_ARCH_HAS_CPU_PASID=y
CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y
CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y
CONFIG_ARCH_WANTS_NO_INSTR=y
CONFIG_ARCH_MEMORY_ORDER_TSO=y
CONFIG_HAVE_ASM_MODVERSIONS=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_RSEQ=y
CONFIG_HAVE_RUST=y
CONFIG_HAVE_FUNCTION_ARG_ACCESS_API=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_PERF_EVENTS_NMI=y
CONFIG_HAVE_HARDLOCKUP_DETECTOR_PERF=y
CONFIG_UNWIND_USER=y
CONFIG_HAVE_UNWIND_USER_FP=y
CONFIG_HAVE_PERF_REGS=y
CONFIG_HAVE_PERF_USER_STACK_DUMP=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y
CONFIG_MMU_GATHER_TABLE_FREE=y
CONFIG_MMU_GATHER_RCU_TABLE_FREE=y
CONFIG_MMU_GATHER_MERGE_VMAS=y
CONFIG_ARCH_WANT_IRQS_OFF_ACTIVATE_MM=y
CONFIG_MMU_LAZY_TLB_REFCOUNT=y
CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
CONFIG_ARCH_HAVE_EXTRA_ELF_NOTES=y
CONFIG_ARCH_HAS_NMI_SAFE_THIS_CPU_OPS=y
CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
CONFIG_HAVE_CMPXCHG_LOCAL=y
CONFIG_HAVE_CMPXCHG_DOUBLE=y
CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
CONFIG_HAVE_ARCH_SECCOMP=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_SECCOMP=y
CONFIG_SECCOMP_FILTER=y
# CONFIG_SECCOMP_CACHE_DEBUG is not set
CONFIG_HAVE_ARCH_KSTACK_ERASE=y
CONFIG_HAVE_STACKPROTECTOR=y
CONFIG_STACKPROTECTOR=y
CONFIG_STACKPROTECTOR_STRONG=y
CONFIG_ARCH_SUPPORTS_LTO_CLANG=y
CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN=y
CONFIG_LTO_NONE=y
CONFIG_ARCH_SUPPORTS_CFI=y
CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES=y
CONFIG_HAVE_CONTEXT_TRACKING_USER=y
CONFIG_HAVE_CONTEXT_TRACKING_USER_OFFSTACK=y
CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_PV_STEAL_CLOCK_GEN=y
CONFIG_HAVE_MOVE_PUD=y
CONFIG_HAVE_MOVE_PMD=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y
CONFIG_HAVE_ARCH_HUGE_VMAP=y
CONFIG_HAVE_ARCH_HUGE_VMALLOC=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
CONFIG_ARCH_WANT_PMD_MKWRITE=y
CONFIG_HAVE_ARCH_SOFT_DIRTY=y
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_ARCH_HAS_EXECMEM_ROX=y
CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK=y
CONFIG_SOFTIRQ_ON_OWN_STACK=y
CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
CONFIG_HAVE_EXIT_THREAD=y
CONFIG_ARCH_MMAP_RND_BITS=28
CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y
CONFIG_ARCH_MMAP_RND_COMPAT_BITS=8
CONFIG_HAVE_ARCH_COMPAT_MMAP_BASES=y
CONFIG_HAVE_PAGE_SIZE_4KB=y
CONFIG_PAGE_SIZE_4KB=y
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
CONFIG_PAGE_SHIFT=12
CONFIG_HAVE_OBJTOOL=y
CONFIG_HAVE_JUMP_LABEL_HACK=y
CONFIG_HAVE_NOINSTR_HACK=y
CONFIG_HAVE_NOINSTR_VALIDATION=y
CONFIG_HAVE_UACCESS_VALIDATION=y
CONFIG_HAVE_STACK_VALIDATION=y
CONFIG_HAVE_RELIABLE_STACKTRACE=y
CONFIG_OLD_SIGSUSPEND3=y
CONFIG_COMPAT_OLD_SIGACTION=y
CONFIG_COMPAT_32BIT_TIME=y
CONFIG_ARCH_SUPPORTS_RT=y
CONFIG_HAVE_ARCH_VMAP_STACK=y
CONFIG_VMAP_STACK=y
CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET=y
CONFIG_RANDOMIZE_KSTACK_OFFSET=y
# CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT is not set
CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y
CONFIG_STRICT_KERNEL_RWX=y
CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
CONFIG_STRICT_MODULE_RWX=y
CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y
# CONFIG_LOCK_EVENT_COUNTS is not set
CONFIG_ARCH_HAS_MEM_ENCRYPT=y
CONFIG_HAVE_STATIC_CALL=y
CONFIG_HAVE_STATIC_CALL_INLINE=y
CONFIG_HAVE_PREEMPT_DYNAMIC=y
CONFIG_HAVE_PREEMPT_DYNAMIC_CALL=y
CONFIG_ARCH_WANT_LD_ORPHAN_WARN=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK=y
CONFIG_ARCH_HAS_ELFCORE_COMPAT=y
CONFIG_ARCH_HAS_PARANOID_L1D_FLUSH=y
CONFIG_DYNAMIC_SIGFRAME=y
CONFIG_HAVE_ARCH_NODE_DEV_GROUP=y
CONFIG_ARCH_HAS_HW_PTE_YOUNG=y
CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG=y
CONFIG_ARCH_HAS_KERNEL_FPU_SUPPORT=y
CONFIG_HAVE_GENERIC_TIF_BITS=y

#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
# end of GCOV-based kernel profiling

CONFIG_HAVE_GCC_PLUGINS=y
CONFIG_FUNCTION_ALIGNMENT_4B=y
CONFIG_FUNCTION_ALIGNMENT_16B=y
CONFIG_FUNCTION_ALIGNMENT=16
CONFIG_CC_HAS_MIN_FUNCTION_ALIGNMENT=y
CONFIG_CC_HAS_SANE_FUNCTION_ALIGNMENT=y
CONFIG_ARCH_HAS_CPU_ATTACK_VECTORS=y
# end of General architecture-dependent options

CONFIG_RT_MUTEXES=y
CONFIG_MODULE_SIG_FORMAT=y
CONFIG_MODULES=y
# CONFIG_MODULE_DEBUG is not set
# CONFIG_MODULE_FORCE_LOAD is not set
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
# CONFIG_MODULE_UNLOAD_TAINT_TRACKING is not set
CONFIG_MODVERSIONS=y
# CONFIG_GENKSYMS is not set
CONFIG_GENDWARFKSYMS=y
CONFIG_ASM_MODVERSIONS=y
# CONFIG_EXTENDED_MODVERSIONS is not set
# CONFIG_BASIC_MODVERSIONS is not set
CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_MODULE_SIG=y
# CONFIG_MODULE_SIG_FORCE is not set
# CONFIG_MODULE_SIG_ALL is not set
CONFIG_MODULE_SIG_SHA256=y
# CONFIG_MODULE_SIG_SHA384 is not set
# CONFIG_MODULE_SIG_SHA512 is not set
# CONFIG_MODULE_SIG_SHA3_256 is not set
# CONFIG_MODULE_SIG_SHA3_384 is not set
# CONFIG_MODULE_SIG_SHA3_512 is not set
CONFIG_MODULE_SIG_HASH="sha256"
# CONFIG_MODULE_COMPRESS is not set
# CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is not set
CONFIG_MODPROBE_PATH="/sbin/modprobe"
# CONFIG_TRIM_UNUSED_KSYMS is not set
CONFIG_MODULES_TREE_LOOKUP=y
CONFIG_BLOCK=y
CONFIG_BLOCK_LEGACY_AUTOLOAD=y
CONFIG_BLK_RQ_ALLOC_TIME=y
CONFIG_BLK_CGROUP_RWSTAT=y
CONFIG_BLK_CGROUP_PUNT_BIO=y
CONFIG_BLK_DEV_BSG_COMMON=y
CONFIG_BLK_ICQ=y
CONFIG_BLK_DEV_BSGLIB=y
CONFIG_BLK_DEV_INTEGRITY=y
# CONFIG_BLK_DEV_WRITE_MOUNTED is not set
CONFIG_BLK_DEV_ZONED=y
CONFIG_BLK_DEV_THROTTLING=y
CONFIG_BLK_WBT=y
CONFIG_BLK_WBT_MQ=y
CONFIG_BLK_CGROUP_IOLATENCY=y
# CONFIG_BLK_CGROUP_FC_APPID is not set
CONFIG_BLK_CGROUP_IOCOST=y
CONFIG_BLK_CGROUP_IOPRIO=y
CONFIG_BLK_DEBUG_FS=y
# CONFIG_BLK_SED_OPAL is not set
CONFIG_BLK_INLINE_ENCRYPTION=y
CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK=y

#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
CONFIG_ACORN_PARTITION=y
CONFIG_ACORN_PARTITION_CUMANA=y
CONFIG_ACORN_PARTITION_EESOX=y
CONFIG_ACORN_PARTITION_ICS=y
CONFIG_ACORN_PARTITION_ADFS=y
CONFIG_ACORN_PARTITION_POWERTEC=y
CONFIG_ACORN_PARTITION_RISCIX=y
CONFIG_AIX_PARTITION=y
CONFIG_OSF_PARTITION=y
CONFIG_AMIGA_PARTITION=y
CONFIG_ATARI_PARTITION=y
CONFIG_MAC_PARTITION=y
CONFIG_MSDOS_PARTITION=y
CONFIG_BSD_DISKLABEL=y
CONFIG_MINIX_SUBPARTITION=y
CONFIG_SOLARIS_X86_PARTITION=y
CONFIG_UNIXWARE_DISKLABEL=y
CONFIG_LDM_PARTITION=y
# CONFIG_LDM_DEBUG is not set
CONFIG_SGI_PARTITION=y
CONFIG_ULTRIX_PARTITION=y
CONFIG_SUN_PARTITION=y
CONFIG_KARMA_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_SYSV68_PARTITION=y
CONFIG_CMDLINE_PARTITION=y
# CONFIG_OF_PARTITION is not set
# end of Partition Types

CONFIG_BLK_PM=y
CONFIG_BLOCK_HOLDER_DEPRECATED=y
CONFIG_BLK_MQ_STACKING=y
# CONFIG_BLK_ERROR_INJECTION is not set

#
# IO Schedulers
#
CONFIG_MQ_IOSCHED_DEADLINE=y
CONFIG_MQ_IOSCHED_KYBER=y
CONFIG_IOSCHED_BFQ=y
CONFIG_BFQ_GROUP_IOSCHED=y
CONFIG_BFQ_CGROUP_DEBUG=y
# end of IO Schedulers

CONFIG_PREEMPT_NOTIFIERS=y
CONFIG_PADATA=y
CONFIG_ASN1=y
CONFIG_UNINLINE_SPIN_UNLOCK=y
CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
CONFIG_MUTEX_SPIN_ON_OWNER=y
CONFIG_RWSEM_SPIN_ON_OWNER=y
CONFIG_LOCK_SPIN_ON_OWNER=y
CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
CONFIG_QUEUED_SPINLOCKS=y
# CONFIG_QUEUED_SPINLOCKS_TRACE_CONTENDED_RELEASE is not set
CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
CONFIG_QUEUED_RWLOCKS=y
CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE=y
CONFIG_ARCH_HAS_SYNC_CORE_BEFORE_USERMODE=y
CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y
CONFIG_FREEZER=y

#
# Executable file formats
#
CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
CONFIG_ELFCORE=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
CONFIG_BINFMT_SCRIPT=y
CONFIG_BINFMT_MISC=y
CONFIG_COREDUMP=y
# end of Executable file formats

#
# Memory Management options
#
CONFIG_SWAP=y
CONFIG_ZSWAP=y
CONFIG_ZSWAP_DEFAULT_ON=y
CONFIG_ZSWAP_SHRINKER_DEFAULT_ON=y
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_DEFLATE is not set
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZO is not set
CONFIG_ZSWAP_COMPRESSOR_DEFAULT_842=y
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4 is not set
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4HC is not set
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_ZSTD is not set
CONFIG_ZSWAP_COMPRESSOR_DEFAULT="842"
CONFIG_ZSMALLOC=y

#
# Zsmalloc allocator options
#

#
# Zsmalloc is a common backend allocator for zswap & zram
#
# CONFIG_ZSMALLOC_STAT is not set
CONFIG_ZSMALLOC_CHAIN_SIZE=8
# end of Zsmalloc allocator options

#
# Slab allocator options
#
CONFIG_SLUB=y
CONFIG_KVFREE_RCU_BATCHED=y
# CONFIG_SLUB_TINY is not set
CONFIG_SLAB_MERGE_DEFAULT=y
# CONFIG_SLAB_FREELIST_RANDOM is not set
# CONFIG_SLAB_FREELIST_HARDENED is not set
# CONFIG_SLAB_BUCKETS is not set
# CONFIG_SLUB_STATS is not set
# CONFIG_KMALLOC_PARTITION_CACHES is not set
# end of Slab allocator options

# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SPARSEMEM=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_VMEMMAP=y
CONFIG_SPARSEMEM_VMEMMAP_PREINIT=y
CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP=y
CONFIG_ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP=y
CONFIG_ARCH_WANT_HUGETLB_VMEMMAP_PREINIT=y
CONFIG_HAVE_GUP_FAST=y
CONFIG_NUMA_KEEP_MEMINFO=y
CONFIG_MEMORY_ISOLATION=y
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTPLUG=y
# CONFIG_MHP_DEFAULT_ONLINE_TYPE_OFFLINE is not set
CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_AUTO=y
# CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_KERNEL is not set
# CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_MOVABLE is not set
CONFIG_MEMORY_HOTREMOVE=y
CONFIG_MHP_MEMMAP_ON_MEMORY=y
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
CONFIG_SPLIT_PTE_PTLOCKS=y
CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y
CONFIG_SPLIT_PMD_PTLOCKS=y
CONFIG_BALLOON=y
# CONFIG_BALLOON_MIGRATION is not set
CONFIG_COMPACTION=y
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
CONFIG_PAGE_REPORTING=y
CONFIG_NUMA_MIGRATION=y
CONFIG_MIGRATION=y
CONFIG_DEVICE_MIGRATION=y
CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y
CONFIG_ARCH_HAS_PMD_SOFTLEAVES=y
CONFIG_CONTIG_ALLOC=y
CONFIG_PCP_BATCH_SCALE_MAX=5
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_MMU_NOTIFIER=y
CONFIG_KSM=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
# CONFIG_MEMORY_FAILURE is not set
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
CONFIG_ARCH_WANTS_THP_SWAP=y
# CONFIG_PERSISTENT_HUGE_ZERO_FOLIO is not set
CONFIG_MM_ID=y
CONFIG_TRANSPARENT_HUGEPAGE=y
# CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS is not set
CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y
# CONFIG_TRANSPARENT_HUGEPAGE_NEVER is not set
# CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_NEVER is not set
# CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_ALWAYS is not set
# CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_WITHIN_SIZE is not set
CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_ADVISE=y
# CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_NEVER is not set
# CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_ALWAYS is not set
# CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_WITHIN_SIZE is not set
CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_ADVISE=y
CONFIG_THP_SWAP=y
# CONFIG_NO_PAGE_MAPCOUNT is not set
CONFIG_PAGE_MAPCOUNT=y
CONFIG_PGTABLE_HAS_HUGE_LEAVES=y
CONFIG_HAVE_GIGANTIC_FOLIOS=y
CONFIG_ASYNC_KERNEL_PGTABLE_FREE=y
CONFIG_ARCH_SUPPORTS_HUGE_PFNMAP=y
CONFIG_ARCH_SUPPORTS_PMD_PFNMAP=y
CONFIG_ARCH_SUPPORTS_PUD_PFNMAP=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_USE_PERCPU_NUMA_NODE_ID=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_CMA=y
# CONFIG_CMA_DEBUGFS is not set
# CONFIG_CMA_SYSFS is not set
CONFIG_CMA_AREAS=20
CONFIG_PAGE_BLOCK_MAX_ORDER=10
CONFIG_MEM_SOFT_DIRTY=y
CONFIG_GENERIC_EARLY_IOREMAP=y
# CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set
CONFIG_PAGE_IDLE_FLAG=y
# CONFIG_IDLE_PAGE_TRACKING is not set
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_ARCH_HAS_CURRENT_STACK_POINTER=y
CONFIG_ARCH_HAS_ZONE_DMA_SET=y
CONFIG_ZONE_DMA=y
CONFIG_ZONE_DMA32=y
CONFIG_ZONE_DEVICE=y
CONFIG_HMM_MIRROR=y
CONFIG_GET_FREE_REGION=y
CONFIG_DEVICE_PRIVATE=y
CONFIG_VMAP_PFN=y
CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y
CONFIG_ARCH_HAS_PKEYS=y
CONFIG_ARCH_USES_PG_ARCH_2=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_PERCPU_STATS=y
# CONFIG_GUP_TEST is not set
# CONFIG_DMAPOOL_TEST is not set
CONFIG_ARCH_HAS_PTE_SPECIAL=y
CONFIG_MAPPING_DIRTY_HELPERS=y
CONFIG_KMAP_LOCAL=y
CONFIG_MEMFD_CREATE=y
CONFIG_SECRETMEM=y
CONFIG_ANON_VMA_NAME=y
CONFIG_HAVE_ARCH_USERFAULTFD_WP=y
CONFIG_HAVE_ARCH_USERFAULTFD_MINOR=y
CONFIG_USERFAULTFD_RWP=y
CONFIG_USERFAULTFD=y
# CONFIG_PTE_MARKER_UFFD_WP is not set
CONFIG_LRU_GEN=y
CONFIG_LRU_GEN_ENABLED=y
# CONFIG_LRU_GEN_STATS is not set
CONFIG_LRU_GEN_WALKS_MMU=y
CONFIG_ARCH_SUPPORTS_PER_VMA_LOCK=y
CONFIG_PER_VMA_LOCK=y
CONFIG_LOCK_MM_AND_FIND_VMA=y
CONFIG_IOMMU_MM_DATA=y
CONFIG_EXECMEM=y
CONFIG_NUMA_MEMBLKS=y
CONFIG_NUMA_EMU=y
CONFIG_ARCH_HAS_USER_SHADOW_STACK=y
CONFIG_PT_RECLAIM=y

#
# Data Access Monitoring
#
CONFIG_DAMON=y
# CONFIG_DAMON_DEBUG_SANITY is not set
CONFIG_DAMON_VADDR=y
CONFIG_DAMON_PADDR=y
# CONFIG_DAMON_SYSFS is not set
CONFIG_DAMON_RECLAIM=y
# CONFIG_DAMON_LRU_SORT is not set
# CONFIG_DAMON_STAT is not set
# end of Data Access Monitoring
# end of Memory Management options

CONFIG_NET=y
CONFIG_WANT_COMPAT_NETLINK_MESSAGES=y
CONFIG_COMPAT_NETLINK_MESSAGES=y
CONFIG_NET_INGRESS=y
CONFIG_NET_EGRESS=y
CONFIG_NET_XGRESS=y
CONFIG_NET_REDIRECT=y
CONFIG_SKB_DECRYPTED=y
CONFIG_SKB_EXTENSIONS=y
CONFIG_NET_DEVMEM=y
CONFIG_NET_SHAPER=y
CONFIG_NET_CRC32C=y

#
# Networking options
#
CONFIG_PACKET=y
CONFIG_PACKET_DIAG=y
CONFIG_INET_PSP=y
CONFIG_UNIX=y
CONFIG_AF_UNIX_OOB=y
CONFIG_UNIX_DIAG=y
CONFIG_TLS=y
CONFIG_TLS_DEVICE=y
CONFIG_XFRM=y
CONFIG_XFRM_OFFLOAD=y
CONFIG_XFRM_ALGO=y
CONFIG_XFRM_USER=y
CONFIG_XFRM_USER_COMPAT=y
CONFIG_XFRM_INTERFACE=y
CONFIG_XFRM_SUB_POLICY=y
CONFIG_XFRM_MIGRATE=y
CONFIG_XFRM_STATISTICS=y
CONFIG_XFRM_AH=y
CONFIG_XFRM_ESP=y
CONFIG_XFRM_IPCOMP=y
CONFIG_NET_KEY=y
CONFIG_NET_KEY_MIGRATE=y
CONFIG_XFRM_IPTFS=y
CONFIG_XFRM_ESPINTCP=y
CONFIG_SMC=y
CONFIG_SMC_DIAG=y
# CONFIG_SMC_HS_CTRL_BPF is not set
CONFIG_DIBS=y
CONFIG_DIBS_LO=y
CONFIG_XDP_SOCKETS=y
CONFIG_XDP_SOCKETS_DIAG=y
CONFIG_NET_HANDSHAKE=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_FIB_TRIE_STATS=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_ROUTE_CLASSID=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y
CONFIG_NET_IPIP=y
CONFIG_NET_IPGRE_DEMUX=y
CONFIG_NET_IP_TUNNEL=y
CONFIG_NET_IPGRE=y
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IP_MROUTE_COMMON=y
CONFIG_IP_MROUTE=y
CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
CONFIG_SYN_COOKIES=y
CONFIG_NET_IPVTI=y
CONFIG_NET_UDP_TUNNEL=y
CONFIG_NET_FOU=y
CONFIG_NET_FOU_IP_TUNNELS=y
CONFIG_INET_AH=y
CONFIG_INET_ESP=y
CONFIG_INET_ESP_OFFLOAD=y
CONFIG_INET_ESPINTCP=y
CONFIG_INET_IPCOMP=y
CONFIG_INET_TABLE_PERTURB_ORDER=16
CONFIG_INET_XFRM_TUNNEL=y
CONFIG_INET_TUNNEL=y
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
CONFIG_INET_UDP_DIAG=y
CONFIG_INET_RAW_DIAG=y
CONFIG_INET_DIAG_DESTROY=y
CONFIG_TCP_CONG_ADVANCED=y
CONFIG_TCP_CONG_BIC=y
CONFIG_TCP_CONG_CUBIC=y
CONFIG_TCP_CONG_WESTWOOD=y
CONFIG_TCP_CONG_HTCP=y
CONFIG_TCP_CONG_HSTCP=y
CONFIG_TCP_CONG_HYBLA=y
CONFIG_TCP_CONG_VEGAS=y
CONFIG_TCP_CONG_NV=y
CONFIG_TCP_CONG_SCALABLE=y
CONFIG_TCP_CONG_LP=y
CONFIG_TCP_CONG_VENO=y
CONFIG_TCP_CONG_YEAH=y
CONFIG_TCP_CONG_ILLINOIS=y
CONFIG_TCP_CONG_DCTCP=y
CONFIG_TCP_CONG_CDG=y
CONFIG_TCP_CONG_BBR=y
# CONFIG_DEFAULT_BIC is not set
CONFIG_DEFAULT_CUBIC=y
# CONFIG_DEFAULT_HTCP is not set
# CONFIG_DEFAULT_HYBLA is not set
# CONFIG_DEFAULT_VEGAS is not set
# CONFIG_DEFAULT_VENO is not set
# CONFIG_DEFAULT_WESTWOOD is not set
# CONFIG_DEFAULT_DCTCP is not set
# CONFIG_DEFAULT_CDG is not set
# CONFIG_DEFAULT_BBR is not set
# CONFIG_DEFAULT_RENO is not set
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_AO is not set
CONFIG_TCP_MD5SIG=y
CONFIG_IPV6=y
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_IPV6_ROUTE_INFO=y
CONFIG_IPV6_OPTIMISTIC_DAD=y
CONFIG_INET6_AH=y
CONFIG_INET6_ESP=y
CONFIG_INET6_ESP_OFFLOAD=y
CONFIG_INET6_ESPINTCP=y
CONFIG_INET6_IPCOMP=y
CONFIG_IPV6_MIP6=y
CONFIG_IPV6_ILA=y
CONFIG_INET6_XFRM_TUNNEL=y
CONFIG_INET6_TUNNEL=y
CONFIG_IPV6_VTI=y
CONFIG_IPV6_SIT=y
CONFIG_IPV6_SIT_6RD=y
CONFIG_IPV6_NDISC_NODETYPE=y
CONFIG_IPV6_TUNNEL=y
CONFIG_IPV6_GRE=y
CONFIG_IPV6_FOU=y
CONFIG_IPV6_FOU_TUNNEL=y
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
CONFIG_IPV6_SEG6_LWTUNNEL=y
CONFIG_IPV6_SEG6_HMAC=y
CONFIG_IPV6_SEG6_BPF=y
CONFIG_IPV6_RPL_LWTUNNEL=y
# CONFIG_IPV6_IOAM6_LWTUNNEL is not set
CONFIG_NETLABEL=y
CONFIG_MPTCP=y
CONFIG_INET_MPTCP_DIAG=y
CONFIG_MPTCP_IPV6=y
CONFIG_NETWORK_SECMARK=y
CONFIG_NET_PTP_CLASSIFY=y
# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
CONFIG_NETFILTER=y
CONFIG_NETFILTER_ADVANCED=y
CONFIG_BRIDGE_NETFILTER=y

#
# Core Netfilter Configuration
#
CONFIG_NETFILTER_INGRESS=y
CONFIG_NETFILTER_EGRESS=y
CONFIG_NETFILTER_SKIP_EGRESS=y
CONFIG_NETFILTER_NETLINK=y
CONFIG_NETFILTER_FAMILY_BRIDGE=y
CONFIG_NETFILTER_FAMILY_ARP=y
CONFIG_NETFILTER_BPF_LINK=y
# CONFIG_NETFILTER_NETLINK_HOOK is not set
CONFIG_NETFILTER_NETLINK_ACCT=y
CONFIG_NETFILTER_NETLINK_QUEUE=y
CONFIG_NETFILTER_NETLINK_LOG=y
CONFIG_NETFILTER_NETLINK_OSF=y
CONFIG_NF_CONNTRACK=y
CONFIG_NF_LOG_SYSLOG=y
CONFIG_NETFILTER_CONNCOUNT=y
CONFIG_NF_CONNTRACK_MARK=y
CONFIG_NF_CONNTRACK_SECMARK=y
CONFIG_NF_CONNTRACK_ZONES=y
# CONFIG_NF_CONNTRACK_PROCFS is not set
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CONNTRACK_TIMEOUT=y
CONFIG_NF_CONNTRACK_TIMESTAMP=y
CONFIG_NF_CONNTRACK_LABELS=y
CONFIG_NF_CONNTRACK_OVS=y
CONFIG_NF_CT_PROTO_GRE=y
CONFIG_NF_CT_PROTO_SCTP=y
CONFIG_NF_CONNTRACK_AMANDA=y
CONFIG_NF_CONNTRACK_FTP=y
CONFIG_NF_CONNTRACK_H323=y
CONFIG_NF_CONNTRACK_IRC=y
CONFIG_NF_CONNTRACK_BROADCAST=y
CONFIG_NF_CONNTRACK_NETBIOS_NS=y
CONFIG_NF_CONNTRACK_SNMP=y
CONFIG_NF_CONNTRACK_PPTP=y
CONFIG_NF_CONNTRACK_SANE=y
CONFIG_NF_CONNTRACK_SIP=y
CONFIG_NF_CONNTRACK_TFTP=y
CONFIG_NF_CT_NETLINK=y
CONFIG_NF_CT_NETLINK_TIMEOUT=y
CONFIG_NF_CT_NETLINK_HELPER=y
CONFIG_NETFILTER_NETLINK_GLUE_CT=y
CONFIG_NF_NAT=y
CONFIG_NF_NAT_AMANDA=y
CONFIG_NF_NAT_FTP=y
CONFIG_NF_NAT_IRC=y
CONFIG_NF_NAT_SIP=y
CONFIG_NF_NAT_TFTP=y
CONFIG_NF_NAT_REDIRECT=y
CONFIG_NF_NAT_MASQUERADE=y
CONFIG_NF_NAT_OVS=y
CONFIG_NETFILTER_SYNPROXY=y
CONFIG_NF_TABLES=y
CONFIG_NF_TABLES_INET=y
CONFIG_NF_TABLES_NETDEV=y
CONFIG_NFT_NUMGEN=y
CONFIG_NFT_CT=y
CONFIG_NFT_EXTHDR_DCCP=y
CONFIG_NFT_FLOW_OFFLOAD=y
CONFIG_NFT_CONNLIMIT=y
CONFIG_NFT_LOG=y
CONFIG_NFT_LIMIT=y
CONFIG_NFT_MASQ=y
CONFIG_NFT_REDIR=y
CONFIG_NFT_NAT=y
CONFIG_NFT_TUNNEL=y
CONFIG_NFT_QUEUE=y
CONFIG_NFT_QUOTA=y
CONFIG_NFT_REJECT=y
CONFIG_NFT_REJECT_INET=y
CONFIG_NFT_COMPAT=y
CONFIG_NFT_HASH=y
CONFIG_NFT_FIB=y
CONFIG_NFT_FIB_INET=y
CONFIG_NFT_XFRM=y
CONFIG_NFT_SOCKET=y
CONFIG_NFT_OSF=y
CONFIG_NFT_TPROXY=y
CONFIG_NFT_SYNPROXY=y
CONFIG_NF_DUP_NETDEV=y
CONFIG_NFT_DUP_NETDEV=y
CONFIG_NFT_FWD_NETDEV=y
CONFIG_NFT_FIB_NETDEV=y
CONFIG_NFT_REJECT_NETDEV=y
CONFIG_NF_FLOW_TABLE_INET=y
CONFIG_NF_FLOW_TABLE=y
# CONFIG_NF_FLOW_TABLE_PROCFS is not set
CONFIG_NETFILTER_XTABLES=y
CONFIG_NETFILTER_XTABLES_COMPAT=y
CONFIG_NETFILTER_XTABLES_LEGACY=y

#
# Xtables combined modules
#
CONFIG_NETFILTER_XT_MARK=y
CONFIG_NETFILTER_XT_CONNMARK=y
CONFIG_NETFILTER_XT_SET=y

#
# Xtables targets
#
CONFIG_NETFILTER_XT_TARGET_AUDIT=y
CONFIG_NETFILTER_XT_TARGET_CHECKSUM=y
CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
CONFIG_NETFILTER_XT_TARGET_CT=y
CONFIG_NETFILTER_XT_TARGET_DSCP=y
CONFIG_NETFILTER_XT_TARGET_HL=y
CONFIG_NETFILTER_XT_TARGET_HMARK=y
CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
CONFIG_NETFILTER_XT_TARGET_LED=y
CONFIG_NETFILTER_XT_TARGET_LOG=y
CONFIG_NETFILTER_XT_TARGET_MARK=y
CONFIG_NETFILTER_XT_NAT=y
CONFIG_NETFILTER_XT_TARGET_NETMAP=y
CONFIG_NETFILTER_XT_TARGET_NFLOG=y
CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
CONFIG_NETFILTER_XT_TARGET_NOTRACK=y
CONFIG_NETFILTER_XT_TARGET_RATEEST=y
CONFIG_NETFILTER_XT_TARGET_REDIRECT=y
CONFIG_NETFILTER_XT_TARGET_MASQUERADE=y
CONFIG_NETFILTER_XT_TARGET_TEE=y
CONFIG_NETFILTER_XT_TARGET_TPROXY=y
CONFIG_NETFILTER_XT_TARGET_TRACE=y
CONFIG_NETFILTER_XT_TARGET_SECMARK=y
CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=y

#
# Xtables matches
#
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y
CONFIG_NETFILTER_XT_MATCH_BPF=y
CONFIG_NETFILTER_XT_MATCH_CGROUP=y
CONFIG_NETFILTER_XT_MATCH_CLUSTER=y
CONFIG_NETFILTER_XT_MATCH_COMMENT=y
CONFIG_NETFILTER_XT_MATCH_CONNBYTES=y
CONFIG_NETFILTER_XT_MATCH_CONNLABEL=y
CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=y
CONFIG_NETFILTER_XT_MATCH_CONNMARK=y
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
CONFIG_NETFILTER_XT_MATCH_CPU=y
CONFIG_NETFILTER_XT_MATCH_DCCP=y
CONFIG_NETFILTER_XT_MATCH_DEVGROUP=y
CONFIG_NETFILTER_XT_MATCH_DSCP=y
CONFIG_NETFILTER_XT_MATCH_ECN=y
CONFIG_NETFILTER_XT_MATCH_ESP=y
CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=y
CONFIG_NETFILTER_XT_MATCH_HELPER=y
CONFIG_NETFILTER_XT_MATCH_HL=y
CONFIG_NETFILTER_XT_MATCH_IPCOMP=y
CONFIG_NETFILTER_XT_MATCH_IPRANGE=y
CONFIG_NETFILTER_XT_MATCH_IPVS=y
CONFIG_NETFILTER_XT_MATCH_L2TP=y
CONFIG_NETFILTER_XT_MATCH_LENGTH=y
CONFIG_NETFILTER_XT_MATCH_LIMIT=y
CONFIG_NETFILTER_XT_MATCH_MAC=y
CONFIG_NETFILTER_XT_MATCH_MARK=y
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
CONFIG_NETFILTER_XT_MATCH_NFACCT=y
CONFIG_NETFILTER_XT_MATCH_OSF=y
CONFIG_NETFILTER_XT_MATCH_OWNER=y
CONFIG_NETFILTER_XT_MATCH_POLICY=y
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=y
CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y
CONFIG_NETFILTER_XT_MATCH_QUOTA=y
CONFIG_NETFILTER_XT_MATCH_RATEEST=y
CONFIG_NETFILTER_XT_MATCH_REALM=y
CONFIG_NETFILTER_XT_MATCH_RECENT=y
CONFIG_NETFILTER_XT_MATCH_SCTP=y
CONFIG_NETFILTER_XT_MATCH_SOCKET=y
CONFIG_NETFILTER_XT_MATCH_STATE=y
CONFIG_NETFILTER_XT_MATCH_STATISTIC=y
CONFIG_NETFILTER_XT_MATCH_STRING=y
CONFIG_NETFILTER_XT_MATCH_TCPMSS=y
CONFIG_NETFILTER_XT_MATCH_TIME=y
CONFIG_NETFILTER_XT_MATCH_U32=y
# end of Core Netfilter Configuration

CONFIG_IP_SET=y
CONFIG_IP_SET_MAX=256
CONFIG_IP_SET_BITMAP_IP=y
CONFIG_IP_SET_BITMAP_IPMAC=y
CONFIG_IP_SET_BITMAP_PORT=y
CONFIG_IP_SET_HASH_IP=y
CONFIG_IP_SET_HASH_IPMARK=y
CONFIG_IP_SET_HASH_IPPORT=y
CONFIG_IP_SET_HASH_IPPORTIP=y
CONFIG_IP_SET_HASH_IPPORTNET=y
CONFIG_IP_SET_HASH_IPMAC=y
CONFIG_IP_SET_HASH_MAC=y
CONFIG_IP_SET_HASH_NETPORTNET=y
CONFIG_IP_SET_HASH_NET=y
CONFIG_IP_SET_HASH_NETNET=y
CONFIG_IP_SET_HASH_NETPORT=y
CONFIG_IP_SET_HASH_NETIFACE=y
CONFIG_IP_SET_LIST_SET=y
CONFIG_IP_VS=y
CONFIG_IP_VS_IPV6=y
# CONFIG_IP_VS_DEBUG is not set
CONFIG_IP_VS_TAB_BITS=12

#
# IPVS transport protocol load balancing support
#
CONFIG_IP_VS_PROTO_TCP=y
CONFIG_IP_VS_PROTO_UDP=y
CONFIG_IP_VS_PROTO_AH_ESP=y
CONFIG_IP_VS_PROTO_ESP=y
CONFIG_IP_VS_PROTO_AH=y
CONFIG_IP_VS_PROTO_SCTP=y

#
# IPVS scheduler
#
CONFIG_IP_VS_RR=y
CONFIG_IP_VS_WRR=y
CONFIG_IP_VS_LC=y
CONFIG_IP_VS_WLC=y
CONFIG_IP_VS_FO=y
CONFIG_IP_VS_OVF=y
CONFIG_IP_VS_LBLC=y
CONFIG_IP_VS_LBLCR=y
CONFIG_IP_VS_DH=y
CONFIG_IP_VS_SH=y
CONFIG_IP_VS_MH=y
CONFIG_IP_VS_SED=y
CONFIG_IP_VS_NQ=y
CONFIG_IP_VS_TWOS=y

#
# IPVS SH scheduler
#
CONFIG_IP_VS_SH_TAB_BITS=8

#
# IPVS MH scheduler
#
CONFIG_IP_VS_MH_TAB_INDEX=12

#
# IPVS application helper
#
CONFIG_IP_VS_FTP=y
CONFIG_IP_VS_NFCT=y
CONFIG_IP_VS_PE_SIP=y

#
# IP: Netfilter Configuration
#
CONFIG_NF_DEFRAG_IPV4=y
CONFIG_IP_NF_IPTABLES_LEGACY=y
CONFIG_NF_SOCKET_IPV4=y
CONFIG_NF_TPROXY_IPV4=y
CONFIG_NF_TABLES_IPV4=y
CONFIG_NFT_REJECT_IPV4=y
CONFIG_NFT_DUP_IPV4=y
CONFIG_NFT_FIB_IPV4=y
CONFIG_NF_TABLES_ARP=y
CONFIG_NF_DUP_IPV4=y
CONFIG_NF_LOG_ARP=y
CONFIG_NF_LOG_IPV4=y
CONFIG_NF_REJECT_IPV4=y
CONFIG_NF_NAT_SNMP_BASIC=y
CONFIG_NF_NAT_PPTP=y
CONFIG_NF_NAT_H323=y
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_MATCH_AH=y
CONFIG_IP_NF_MATCH_ECN=y
CONFIG_IP_NF_MATCH_RPFILTER=y
CONFIG_IP_NF_MATCH_TTL=y
CONFIG_IP_NF_FILTER=y
CONFIG_IP_NF_TARGET_REJECT=y
CONFIG_IP_NF_TARGET_SYNPROXY=y
CONFIG_IP_NF_NAT=y
CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_IP_NF_TARGET_NETMAP=y
CONFIG_IP_NF_TARGET_REDIRECT=y
CONFIG_IP_NF_MANGLE=y
CONFIG_IP_NF_TARGET_ECN=y
CONFIG_IP_NF_TARGET_TTL=y
CONFIG_IP_NF_RAW=y
CONFIG_IP_NF_SECURITY=y
CONFIG_IP_NF_ARPTABLES=y
CONFIG_NFT_COMPAT_ARP=y
CONFIG_IP_NF_ARPFILTER=y
CONFIG_IP_NF_ARP_MANGLE=y
# end of IP: Netfilter Configuration

#
# IPv6: Netfilter Configuration
#
CONFIG_IP6_NF_IPTABLES_LEGACY=y
CONFIG_NF_SOCKET_IPV6=y
CONFIG_NF_TPROXY_IPV6=y
CONFIG_NF_TABLES_IPV6=y
CONFIG_NFT_REJECT_IPV6=y
CONFIG_NFT_DUP_IPV6=y
CONFIG_NFT_FIB_IPV6=y
CONFIG_NF_DUP_IPV6=y
CONFIG_NF_REJECT_IPV6=y
CONFIG_NF_LOG_IPV6=y
CONFIG_IP6_NF_IPTABLES=y
CONFIG_IP6_NF_MATCH_AH=y
CONFIG_IP6_NF_MATCH_EUI64=y
CONFIG_IP6_NF_MATCH_FRAG=y
CONFIG_IP6_NF_MATCH_OPTS=y
CONFIG_IP6_NF_MATCH_HL=y
CONFIG_IP6_NF_MATCH_IPV6HEADER=y
CONFIG_IP6_NF_MATCH_MH=y
CONFIG_IP6_NF_MATCH_RPFILTER=y
CONFIG_IP6_NF_MATCH_RT=y
CONFIG_IP6_NF_MATCH_SRH=y
CONFIG_IP6_NF_TARGET_HL=y
CONFIG_IP6_NF_FILTER=y
CONFIG_IP6_NF_TARGET_REJECT=y
CONFIG_IP6_NF_TARGET_SYNPROXY=y
CONFIG_IP6_NF_MANGLE=y
CONFIG_IP6_NF_RAW=y
CONFIG_IP6_NF_SECURITY=y
CONFIG_IP6_NF_NAT=y
CONFIG_IP6_NF_TARGET_MASQUERADE=y
CONFIG_IP6_NF_TARGET_NPT=y
# end of IPv6: Netfilter Configuration

CONFIG_NF_DEFRAG_IPV6=y
CONFIG_NF_TABLES_BRIDGE=y
CONFIG_NFT_BRIDGE_META=y
CONFIG_NFT_BRIDGE_REJECT=y
CONFIG_NF_CONNTRACK_BRIDGE=y
CONFIG_BRIDGE_NF_EBTABLES_LEGACY=y
CONFIG_BRIDGE_NF_EBTABLES=y
CONFIG_BRIDGE_EBT_BROUTE=y
CONFIG_BRIDGE_EBT_T_FILTER=y
CONFIG_BRIDGE_EBT_T_NAT=y
CONFIG_BRIDGE_EBT_802_3=y
CONFIG_BRIDGE_EBT_AMONG=y
CONFIG_BRIDGE_EBT_ARP=y
CONFIG_BRIDGE_EBT_IP=y
CONFIG_BRIDGE_EBT_IP6=y
CONFIG_BRIDGE_EBT_LIMIT=y
CONFIG_BRIDGE_EBT_MARK=y
CONFIG_BRIDGE_EBT_PKTTYPE=y
CONFIG_BRIDGE_EBT_STP=y
CONFIG_BRIDGE_EBT_VLAN=y
CONFIG_BRIDGE_EBT_ARPREPLY=y
CONFIG_BRIDGE_EBT_DNAT=y
CONFIG_BRIDGE_EBT_MARK_T=y
CONFIG_BRIDGE_EBT_REDIRECT=y
CONFIG_BRIDGE_EBT_SNAT=y
CONFIG_BRIDGE_EBT_LOG=y
CONFIG_BRIDGE_EBT_NFLOG=y
CONFIG_IP_SCTP=y
# CONFIG_SCTP_DBG_OBJCNT is not set
CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA256=y
# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE is not set
CONFIG_INET_SCTP_DIAG=y
CONFIG_RDS=y
CONFIG_RDS_RDMA=y
CONFIG_RDS_TCP=y
# CONFIG_RDS_DEBUG is not set
CONFIG_TIPC=y
CONFIG_TIPC_MEDIA_IB=y
CONFIG_TIPC_MEDIA_UDP=y
CONFIG_TIPC_CRYPTO=y
CONFIG_TIPC_DIAG=y
CONFIG_ATM=y
CONFIG_ATM_BR2684=y
# CONFIG_ATM_BR2684_IPFILTER is not set
CONFIG_L2TP=y
# CONFIG_L2TP_DEBUGFS is not set
CONFIG_L2TP_V3=y
CONFIG_L2TP_IP=y
CONFIG_L2TP_ETH=y
CONFIG_STP=y
CONFIG_GARP=y
CONFIG_MRP=y
CONFIG_BRIDGE=y
CONFIG_BRIDGE_IGMP_SNOOPING=y
CONFIG_BRIDGE_VLAN_FILTERING=y
CONFIG_BRIDGE_MRP=y
CONFIG_BRIDGE_CFM=y
CONFIG_NET_DSA=y
# CONFIG_NET_DSA_TAG_NONE is not set
# CONFIG_NET_DSA_TAG_AR9331 is not set
CONFIG_NET_DSA_TAG_BRCM_COMMON=y
CONFIG_NET_DSA_TAG_BRCM=y
# CONFIG_NET_DSA_TAG_BRCM_LEGACY is not set
# CONFIG_NET_DSA_TAG_BRCM_LEGACY_FCS is not set
CONFIG_NET_DSA_TAG_BRCM_PREPEND=y
# CONFIG_NET_DSA_TAG_HELLCREEK is not set
# CONFIG_NET_DSA_TAG_GSWIP is not set
# CONFIG_NET_DSA_TAG_DSA is not set
# CONFIG_NET_DSA_TAG_EDSA is not set
# CONFIG_NET_DSA_TAG_MT7628 is not set
CONFIG_NET_DSA_TAG_MTK=y
# CONFIG_NET_DSA_TAG_MXL_862XX is not set
# CONFIG_NET_DSA_TAG_MXL_GSW1XX is not set
# CONFIG_NET_DSA_TAG_KSZ is not set
# CONFIG_NET_DSA_TAG_NETC is not set
# CONFIG_NET_DSA_TAG_OCELOT is not set
# CONFIG_NET_DSA_TAG_OCELOT_8021Q is not set
CONFIG_NET_DSA_TAG_QCA=y
CONFIG_NET_DSA_TAG_RTL4_A=y
# CONFIG_NET_DSA_TAG_RTL8_4 is not set
# CONFIG_NET_DSA_TAG_RZN1_A5PSW is not set
# CONFIG_NET_DSA_TAG_LAN9303 is not set
# CONFIG_NET_DSA_TAG_SJA1105 is not set
# CONFIG_NET_DSA_TAG_TRAILER is not set
# CONFIG_NET_DSA_TAG_VSC73XX_8021Q is not set
# CONFIG_NET_DSA_TAG_XRS700X is not set
# CONFIG_NET_DSA_TAG_YT921X is not set
CONFIG_VLAN_8021Q=y
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_LLC=y
CONFIG_LLC2=y
CONFIG_X25=y
CONFIG_LAPB=y
CONFIG_PHONET=y
CONFIG_6LOWPAN=y
# CONFIG_6LOWPAN_DEBUGFS is not set
CONFIG_6LOWPAN_NHC=y
CONFIG_6LOWPAN_NHC_DEST=y
CONFIG_6LOWPAN_NHC_FRAGMENT=y
CONFIG_6LOWPAN_NHC_HOP=y
CONFIG_6LOWPAN_NHC_IPV6=y
CONFIG_6LOWPAN_NHC_MOBILITY=y
CONFIG_6LOWPAN_NHC_ROUTING=y
CONFIG_6LOWPAN_NHC_UDP=y
CONFIG_6LOWPAN_GHC_EXT_HDR_HOP=y
CONFIG_6LOWPAN_GHC_UDP=y
CONFIG_6LOWPAN_GHC_ICMPV6=y
CONFIG_6LOWPAN_GHC_EXT_HDR_DEST=y
CONFIG_6LOWPAN_GHC_EXT_HDR_FRAG=y
CONFIG_6LOWPAN_GHC_EXT_HDR_ROUTE=y
CONFIG_IEEE802154=y
CONFIG_IEEE802154_NL802154_EXPERIMENTAL=y
CONFIG_IEEE802154_SOCKET=y
CONFIG_IEEE802154_6LOWPAN=y
CONFIG_MAC802154=y
CONFIG_NET_SCHED=y

#
# Queueing/Scheduling
#
CONFIG_NET_SCH_HTB=y
CONFIG_NET_SCH_HFSC=y
CONFIG_NET_SCH_PRIO=y
CONFIG_NET_SCH_MULTIQ=y
CONFIG_NET_SCH_RED=y
CONFIG_NET_SCH_SFB=y
CONFIG_NET_SCH_SFQ=y
CONFIG_NET_SCH_TEQL=y
CONFIG_NET_SCH_TBF=y
CONFIG_NET_SCH_CBS=y
CONFIG_NET_SCH_ETF=y
CONFIG_NET_SCH_MQPRIO_LIB=y
CONFIG_NET_SCH_TAPRIO=y
CONFIG_NET_SCH_GRED=y
CONFIG_NET_SCH_NETEM=y
CONFIG_NET_SCH_DRR=y
CONFIG_NET_SCH_MQPRIO=y
CONFIG_NET_SCH_SKBPRIO=y
CONFIG_NET_SCH_CHOKE=y
CONFIG_NET_SCH_QFQ=y
CONFIG_NET_SCH_CODEL=y
CONFIG_NET_SCH_FQ_CODEL=y
CONFIG_NET_SCH_CAKE=y
CONFIG_NET_SCH_FQ=y
CONFIG_NET_SCH_HHF=y
CONFIG_NET_SCH_PIE=y
CONFIG_NET_SCH_FQ_PIE=y
CONFIG_NET_SCH_INGRESS=y
CONFIG_NET_SCH_PLUG=y
CONFIG_NET_SCH_ETS=y
# CONFIG_NET_SCH_DUALPI2 is not set
CONFIG_NET_SCH_DEFAULT=y
# CONFIG_DEFAULT_FQ is not set
CONFIG_DEFAULT_CODEL=y
# CONFIG_DEFAULT_FQ_CODEL is not set
# CONFIG_DEFAULT_FQ_PIE is not set
# CONFIG_DEFAULT_SFQ is not set
# CONFIG_DEFAULT_PFIFO_FAST is not set
CONFIG_DEFAULT_NET_SCH="pfifo_fast"

#
# Classification
#
CONFIG_NET_CLS=y
CONFIG_NET_CLS_BASIC=y
CONFIG_NET_CLS_ROUTE4=y
CONFIG_NET_CLS_FW=y
CONFIG_NET_CLS_U32=y
CONFIG_CLS_U32_PERF=y
CONFIG_CLS_U32_MARK=y
CONFIG_NET_CLS_FLOW=y
CONFIG_NET_CLS_CGROUP=y
CONFIG_NET_CLS_BPF=y
CONFIG_NET_CLS_FLOWER=y
CONFIG_NET_CLS_MATCHALL=y
CONFIG_NET_EMATCH=y
CONFIG_NET_EMATCH_STACK=32
CONFIG_NET_EMATCH_CMP=y
CONFIG_NET_EMATCH_NBYTE=y
CONFIG_NET_EMATCH_U32=y
CONFIG_NET_EMATCH_META=y
CONFIG_NET_EMATCH_TEXT=y
CONFIG_NET_EMATCH_CANID=y
CONFIG_NET_EMATCH_IPSET=y
CONFIG_NET_EMATCH_IPT=y
CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_POLICE=y
CONFIG_NET_ACT_GACT=y
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=y
CONFIG_NET_ACT_SAMPLE=y
CONFIG_NET_ACT_NAT=y
CONFIG_NET_ACT_PEDIT=y
CONFIG_NET_ACT_SIMP=y
CONFIG_NET_ACT_SKBEDIT=y
CONFIG_NET_ACT_CSUM=y
CONFIG_NET_ACT_MPLS=y
CONFIG_NET_ACT_VLAN=y
CONFIG_NET_ACT_BPF=y
CONFIG_NET_ACT_CONNMARK=y
CONFIG_NET_ACT_CTINFO=y
CONFIG_NET_ACT_SKBMOD=y
CONFIG_NET_ACT_IFE=y
CONFIG_NET_ACT_TUNNEL_KEY=y
CONFIG_NET_ACT_CT=y
CONFIG_NET_ACT_GATE=y
CONFIG_NET_IFE_SKBMARK=y
CONFIG_NET_IFE_SKBPRIO=y
CONFIG_NET_IFE_SKBTCINDEX=y
CONFIG_NET_TC_SKB_EXT=y
CONFIG_NET_SCH_FIFO=y
CONFIG_DCB=y
CONFIG_DNS_RESOLVER=y
CONFIG_BATMAN_ADV=y
CONFIG_BATMAN_ADV_BATMAN_V=y
CONFIG_BATMAN_ADV_BLA=y
CONFIG_BATMAN_ADV_DAT=y
CONFIG_BATMAN_ADV_MCAST=y
# CONFIG_BATMAN_ADV_DEBUG is not set
# CONFIG_BATMAN_ADV_TRACING is not set
CONFIG_OPENVSWITCH=y
CONFIG_VSOCKETS=y
CONFIG_VSOCKETS_DIAG=y
CONFIG_VSOCKETS_LOOPBACK=y
# CONFIG_VMWARE_VMCI_VSOCKETS is not set
CONFIG_VIRTIO_VSOCKETS=y
CONFIG_VIRTIO_VSOCKETS_COMMON=y
CONFIG_NETLINK_DIAG=y
CONFIG_MPLS=y
CONFIG_NET_MPLS_GSO=y
CONFIG_MPLS_ROUTING=y
CONFIG_MPLS_IPTUNNEL=y
CONFIG_NET_NSH=y
CONFIG_HSR=y
CONFIG_NET_SWITCHDEV=y
CONFIG_NET_L3_MASTER_DEV=y
CONFIG_QRTR=y
CONFIG_QRTR_TUN=y
# CONFIG_QRTR_MHI is not set
CONFIG_NET_NCSI=y
# CONFIG_NCSI_OEM_CMD_GET_MAC is not set
# CONFIG_NCSI_OEM_CMD_KEEP_PHY is not set
# CONFIG_PCPU_DEV_REFCNT is not set
CONFIG_MAX_SKB_FRAGS=17
CONFIG_RPS=y
CONFIG_RFS_ACCEL=y
CONFIG_SOCK_RX_QUEUE_MAPPING=y
CONFIG_XPS=y
CONFIG_CGROUP_NET_PRIO=y
CONFIG_CGROUP_NET_CLASSID=y
CONFIG_NET_RX_BUSY_POLL=y
CONFIG_BQL=y
CONFIG_NET_FLOW_LIMIT=y

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
CONFIG_NET_DROP_MONITOR=y
# end of Network testing
# end of Networking options

CONFIG_CAN=y
CONFIG_CAN_RAW=y
CONFIG_CAN_BCM=y
CONFIG_CAN_GW=y
CONFIG_CAN_J1939=y
CONFIG_CAN_ISOTP=y
CONFIG_BT=y
CONFIG_BT_BREDR=y
CONFIG_BT_RFCOMM=y
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=y
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=y
CONFIG_BT_LE=y
CONFIG_BT_LE_L2CAP_ECRED=y
CONFIG_BT_6LOWPAN=y
CONFIG_BT_LEDS=y
CONFIG_BT_MSFTEXT=y
# CONFIG_BT_AOSPEXT is not set
# CONFIG_BT_DEBUGFS is not set
# CONFIG_BT_SELFTEST is not set

#
# Bluetooth device drivers
#
CONFIG_BT_INTEL=y
CONFIG_BT_BCM=y
CONFIG_BT_RTL=y
CONFIG_BT_QCA=y
CONFIG_BT_MTK=y
CONFIG_BT_HCIBTUSB=y
CONFIG_BT_HCIBTUSB_AUTOSUSPEND=y
CONFIG_BT_HCIBTUSB_POLL_SYNC=y
CONFIG_BT_HCIBTUSB_BCM=y
CONFIG_BT_HCIBTUSB_MTK=y
CONFIG_BT_HCIBTUSB_RTL=y
# CONFIG_BT_HCIBTSDIO is not set
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_SERDEV=y
CONFIG_BT_HCIUART_H4=y
# CONFIG_BT_HCIUART_NOKIA is not set
CONFIG_BT_HCIUART_BCSP=y
# CONFIG_BT_HCIUART_ATH3K is not set
CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIUART_3WIRE=y
# CONFIG_BT_HCIUART_INTEL is not set
# CONFIG_BT_HCIUART_BCM is not set
# CONFIG_BT_HCIUART_RTL is not set
CONFIG_BT_HCIUART_QCA=y
CONFIG_BT_HCIUART_AG6XX=y
CONFIG_BT_HCIUART_MRVL=y
# CONFIG_BT_HCIUART_AML is not set
CONFIG_BT_HCIBCM203X=y
# CONFIG_BT_HCIBCM4377 is not set
CONFIG_BT_HCIBPA10X=y
CONFIG_BT_HCIBFUSB=y
CONFIG_BT_HCIVHCI=y
CONFIG_BT_MRVL=y
CONFIG_BT_MRVL_SDIO=y
CONFIG_BT_ATH3K=y
CONFIG_BT_MTKSDIO=y
CONFIG_BT_MTKUART=y
# CONFIG_BT_VIRTIO is not set
# CONFIG_BT_NXPUART is not set
# CONFIG_BT_INTEL_PCIE is not set
# end of Bluetooth device drivers

CONFIG_AF_RXRPC=y
CONFIG_AF_RXRPC_IPV6=y
# CONFIG_AF_RXRPC_INJECT_LOSS is not set
# CONFIG_AF_RXRPC_INJECT_RX_DELAY is not set
# CONFIG_AF_RXRPC_DEBUG is not set
CONFIG_RXKAD=y
# CONFIG_RXGK is not set
# CONFIG_RXPERF is not set
CONFIG_AF_KCM=y
CONFIG_STREAM_PARSER=y
CONFIG_MCTP=y
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_CFG80211=y
# CONFIG_NL80211_TESTMODE is not set
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_CERTIFICATION_ONUS is not set
CONFIG_CFG80211_REQUIRE_SIGNED_REGDB=y
CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS=y
CONFIG_CFG80211_DEFAULT_PS=y
CONFIG_CFG80211_DEBUGFS=y
CONFIG_CFG80211_CRDA_SUPPORT=y
CONFIG_CFG80211_WEXT=y
CONFIG_MAC80211=y
CONFIG_MAC80211_HAS_RC=y
CONFIG_MAC80211_RC_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
CONFIG_MAC80211_MESH=y
CONFIG_MAC80211_LEDS=y
CONFIG_MAC80211_DEBUGFS=y
# CONFIG_MAC80211_MESSAGE_TRACING is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
CONFIG_MAC80211_STA_HASH_MAX_SIZE=0
CONFIG_RFKILL=y
CONFIG_RFKILL_LEDS=y
CONFIG_RFKILL_INPUT=y
# CONFIG_RFKILL_GPIO is not set
CONFIG_NET_9P=y
CONFIG_NET_9P_FD=y
CONFIG_NET_9P_VIRTIO=y
# CONFIG_NET_9P_USBG is not set
CONFIG_NET_9P_RDMA=y
# CONFIG_NET_9P_DEBUG is not set
CONFIG_CEPH_LIB=y
# CONFIG_CEPH_LIB_PRETTYDEBUG is not set
CONFIG_CEPH_LIB_USE_DNS_RESOLVER=y
CONFIG_NFC=y
CONFIG_NFC_DIGITAL=y
CONFIG_NFC_NCI=y
# CONFIG_NFC_NCI_SPI is not set
CONFIG_NFC_NCI_UART=y
CONFIG_NFC_HCI=y
CONFIG_NFC_SHDLC=y

#
# Near Field Communication (NFC) devices
#
# CONFIG_NFC_TRF7970A is not set
# CONFIG_NFC_MEI_PHY is not set
CONFIG_NFC_SIM=y
CONFIG_NFC_PORT100=y
CONFIG_NFC_VIRTUAL_NCI=y
CONFIG_NFC_FDP=y
# CONFIG_NFC_FDP_I2C is not set
# CONFIG_NFC_PN544_I2C is not set
CONFIG_NFC_PN533=y
CONFIG_NFC_PN533_USB=y
# CONFIG_NFC_PN533_I2C is not set
# CONFIG_NFC_PN532_UART is not set
# CONFIG_NFC_MICROREAD_I2C is not set
CONFIG_NFC_MRVL=y
CONFIG_NFC_MRVL_USB=y
# CONFIG_NFC_MRVL_UART is not set
# CONFIG_NFC_MRVL_I2C is not set
# CONFIG_NFC_ST21NFCA_I2C is not set
# CONFIG_NFC_ST_NCI_I2C is not set
# CONFIG_NFC_ST_NCI_SPI is not set
# CONFIG_NFC_NXP_NCI is not set
# CONFIG_NFC_S3FWRN5_I2C is not set
# CONFIG_NFC_S3FWRN82_UART is not set
# CONFIG_NFC_ST95HF is not set
# end of Near Field Communication (NFC) devices

CONFIG_PSAMPLE=y
CONFIG_NET_IFE=y
CONFIG_LWTUNNEL=y
CONFIG_LWTUNNEL_BPF=y
CONFIG_DST_CACHE=y
CONFIG_GRO_CELLS=y
CONFIG_SOCK_VALIDATE_XMIT=y
CONFIG_NET_SELFTESTS=y
CONFIG_NET_SOCK_MSG=y
CONFIG_NET_DEVLINK=y
CONFIG_PAGE_POOL=y
# CONFIG_PAGE_POOL_STATS is not set
CONFIG_FAILOVER=y
CONFIG_ETHTOOL_NETLINK=y

#
# Device Drivers
#
CONFIG_HAVE_PCI=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=y
CONFIG_PCIEAER=y
# CONFIG_PCIEAER_INJECT is not set
# CONFIG_PCIE_ECRC is not set
CONFIG_PCIEASPM=y
CONFIG_PCIEASPM_DEFAULT=y
# CONFIG_PCIEASPM_POWERSAVE is not set
# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set
# CONFIG_PCIEASPM_PERFORMANCE is not set
CONFIG_PCIE_PME=y
# CONFIG_PCIE_DPC is not set
# CONFIG_PCIE_PTM is not set
CONFIG_PCI_MSI=y
CONFIG_PCI_QUIRKS=y
# CONFIG_PCI_DEBUG is not set
# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set
# CONFIG_PCI_STUB is not set
# CONFIG_PCI_PF_STUB is not set
CONFIG_PCI_ATS=y
# CONFIG_PCI_TSM is not set
# CONFIG_PCI_DOE is not set
CONFIG_PCI_ECAM=y
CONFIG_PCI_LOCKLESS_CONFIG=y
CONFIG_PCI_IOV=y
# CONFIG_PCI_NPEM is not set
CONFIG_PCI_PRI=y
CONFIG_PCI_PASID=y
# CONFIG_PCIE_TPH is not set
# CONFIG_PCI_P2PDMA is not set
CONFIG_PCI_LABEL=y
# CONFIG_PCI_DYNAMIC_OF_NODES is not set
CONFIG_VGA_ARB=y
CONFIG_VGA_ARB_MAX_GPUS=16
CONFIG_HOTPLUG_PCI=y
# CONFIG_HOTPLUG_PCI_ACPI is not set
# CONFIG_HOTPLUG_PCI_CPCI is not set
# CONFIG_HOTPLUG_PCI_OCTEONEP is not set
# CONFIG_HOTPLUG_PCI_SHPC is not set

#
# PCI controller drivers
#
CONFIG_PCI_HOST_COMMON=y
# CONFIG_PCI_FTPCI100 is not set
CONFIG_PCI_HOST_GENERIC=y
# CONFIG_VMD is not set
# CONFIG_PCIE_XILINX is not set

#
# Cadence-based PCIe controllers
#
# CONFIG_PCIE_CADENCE_PLAT_HOST is not set
# CONFIG_PCIE_CADENCE_PLAT_EP is not set
# end of Cadence-based PCIe controllers

#
# DesignWare-based PCIe controllers
#
# CONFIG_PCI_MESON is not set
# CONFIG_PCIE_INTEL_GW is not set
# CONFIG_PCIE_DW_PLAT_HOST is not set
# CONFIG_PCIE_DW_PLAT_EP is not set
# end of DesignWare-based PCIe controllers

#
# Mobiveil-based PCIe controllers
#
# end of Mobiveil-based PCIe controllers

#
# PLDA-based PCIe controllers
#
# CONFIG_PCIE_MICROCHIP_HOST is not set
# end of PLDA-based PCIe controllers
# end of PCI controller drivers

#
# PCI Endpoint
#
CONFIG_PCI_ENDPOINT=y
# CONFIG_PCI_ENDPOINT_CONFIGFS is not set
# CONFIG_PCI_ENDPOINT_MSI_DOORBELL is not set
# CONFIG_PCI_EPF_TEST is not set
# CONFIG_PCI_EPF_NTB is not set
# end of PCI Endpoint

#
# PCI switch controller drivers
#
# CONFIG_PCI_SW_SWITCHTEC is not set
# end of PCI switch controller drivers

# CONFIG_PCI_PWRCTRL_GENERIC is not set
# CONFIG_PCI_PWRCTRL_TC9563 is not set
# CONFIG_CXL_BUS is not set
CONFIG_PCCARD=y
CONFIG_PCMCIA=y
CONFIG_PCMCIA_LOAD_CIS=y
CONFIG_CARDBUS=y

#
# PC-card bridges
#
CONFIG_YENTA=y
CONFIG_YENTA_O2=y
CONFIG_YENTA_RICOH=y
CONFIG_YENTA_TI=y
CONFIG_YENTA_ENE_TUNE=y
CONFIG_YENTA_TOSHIBA=y
# CONFIG_PD6729 is not set
CONFIG_PCCARD_NONSTATIC=y
# CONFIG_RAPIDIO is not set
# CONFIG_PC104 is not set

#
# Generic Driver Options
#
CONFIG_AUXILIARY_BUS=y
CONFIG_UEVENT_HELPER=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_DEVTMPFS_SAFE is not set
CONFIG_DRIVER_DEFERRED_PROBE_TIMEOUT=10
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y

#
# Firmware loader
#
CONFIG_FW_LOADER=y
# CONFIG_FW_LOADER_DEBUG is not set
CONFIG_FW_LOADER_PAGED_BUF=y
CONFIG_FW_LOADER_SYSFS=y
CONFIG_EXTRA_FIRMWARE=""
CONFIG_FW_LOADER_USER_HELPER=y
CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
CONFIG_FW_LOADER_COMPRESS=y
# CONFIG_FW_LOADER_COMPRESS_XZ is not set
# CONFIG_FW_LOADER_COMPRESS_ZSTD is not set
CONFIG_FW_CACHE=y
# CONFIG_FW_UPLOAD is not set
# end of Firmware loader

CONFIG_WANT_DEV_COREDUMP=y
CONFIG_ALLOW_DEV_COREDUMP=y
CONFIG_DEV_COREDUMP=y
# CONFIG_DEBUG_DRIVER is not set
CONFIG_DEBUG_DEVRES=y
# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set
# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set
CONFIG_GENERIC_CPU_DEVICES=y
CONFIG_GENERIC_CPU_AUTOPROBE=y
CONFIG_GENERIC_CPU_VULNERABILITIES=y
CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=y
CONFIG_REGMAP_SPI=y
CONFIG_REGMAP_MMIO=y
CONFIG_REGMAP_IRQ=y
CONFIG_DMA_SHARED_BUFFER=y
# CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT is not set
# end of Generic Driver Options

#
# Bus devices
#
# CONFIG_MOXTET is not set
CONFIG_MHI_BUS=y
# CONFIG_MHI_BUS_DEBUG is not set
# CONFIG_MHI_BUS_PCI_GENERIC is not set
# CONFIG_MHI_BUS_EP is not set
# end of Bus devices

CONFIG_CONNECTOR=y
CONFIG_PROC_EVENTS=y

#
# Firmware Drivers
#

#
# ARM System Control and Management Interface Protocol
#
# end of ARM System Control and Management Interface Protocol

# CONFIG_EDD is not set
CONFIG_FIRMWARE_MEMMAP=y
CONFIG_DMIID=y
# CONFIG_DMI_SYSFS is not set
CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
# CONFIG_ISCSI_IBFT is not set
# CONFIG_FW_CFG_SYSFS is not set
CONFIG_SYSFB=y
# CONFIG_SYSFB_SIMPLEFB is not set
CONFIG_GOOGLE_FIRMWARE=y
# CONFIG_GOOGLE_SMI is not set
# CONFIG_GOOGLE_CBMEM is not set
CONFIG_GOOGLE_COREBOOT_TABLE=y
CONFIG_GOOGLE_MEMCONSOLE=y
# CONFIG_GOOGLE_MEMCONSOLE_X86_LEGACY is not set
# CONFIG_GOOGLE_FRAMEBUFFER_COREBOOT is not set
CONFIG_GOOGLE_MEMCONSOLE_COREBOOT=y
CONFIG_GOOGLE_VPD=y

#
# Qualcomm firmware drivers
#
# CONFIG_QCOM_PAS is not set
# CONFIG_QCOM_PAS_TEE is not set
# CONFIG_QCOM_SCM is not set
# end of Qualcomm firmware drivers

#
# Tegra firmware driver
#
# end of Tegra firmware driver
# end of Firmware Drivers

# CONFIG_FWCTL is not set
CONFIG_GNSS=y
# CONFIG_GNSS_MTK_SERIAL is not set
# CONFIG_GNSS_SIRF_SERIAL is not set
# CONFIG_GNSS_UBX_SERIAL is not set
CONFIG_GNSS_USB=y
CONFIG_MTD=y
# CONFIG_MTD_TESTS is not set

#
# Partition parsers
#
# CONFIG_MTD_CMDLINE_PARTS is not set
# CONFIG_MTD_OF_PARTS is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# end of Partition parsers

#
# User Modules And Translation Layers
#
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y

#
# Note that in some cases UBI block is preferred. See MTD_UBI_BLOCK.
#
CONFIG_FTL=y
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set
# CONFIG_RFD_FTL is not set
# CONFIG_SSFDC is not set
# CONFIG_SM_FTL is not set
# CONFIG_MTD_OOPS is not set
# CONFIG_MTD_SWAP is not set
# CONFIG_MTD_PARTITIONED_MASTER is not set

#
# RAM/ROM/Flash chip drivers
#
# CONFIG_MTD_CFI is not set
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
# end of RAM/ROM/Flash chip drivers

#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_PLATRAM is not set
# end of Mapping drivers for chip access

#
# Self-contained MTD device drivers
#
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_DATAFLASH is not set
# CONFIG_MTD_MCHP23K256 is not set
# CONFIG_MTD_MCHP48L640 is not set
# CONFIG_MTD_SST25L is not set
CONFIG_MTD_SLRAM=y
CONFIG_MTD_PHRAM=y
CONFIG_MTD_MTDRAM=y
CONFIG_MTDRAM_TOTAL_SIZE=128
CONFIG_MTDRAM_ERASE_SIZE=4
CONFIG_MTD_BLOCK2MTD=y
# CONFIG_MTD_INTEL_DG is not set

#
# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOCG3 is not set
# end of Self-contained MTD device drivers

#
# NAND
#
# CONFIG_MTD_ONENAND is not set
# CONFIG_MTD_RAW_NAND is not set
# CONFIG_MTD_SPI_NAND is not set

#
# ECC engine support
#
# CONFIG_MTD_NAND_ECC_SW_HAMMING is not set
# CONFIG_MTD_NAND_ECC_SW_BCH is not set
# CONFIG_MTD_NAND_ECC_MXIC is not set
# end of ECC engine support
# end of NAND

#
# LPDDR & LPDDR2 PCM memory drivers
#
# CONFIG_MTD_LPDDR is not set
# end of LPDDR & LPDDR2 PCM memory drivers

# CONFIG_MTD_SPI_NOR is not set
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_LIMIT=20
# CONFIG_MTD_UBI_FASTMAP is not set
# CONFIG_MTD_UBI_GLUEBI is not set
# CONFIG_MTD_UBI_BLOCK is not set
# CONFIG_MTD_UBI_FAULT_INJECTION is not set
# CONFIG_MTD_UBI_NVMEM is not set
# CONFIG_MTD_HYPERBUS is not set
CONFIG_DTC=y
CONFIG_OF=y
# CONFIG_OF_UNITTEST is not set
CONFIG_OF_FLATTREE=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_KOBJ=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_IRQ=y
CONFIG_OF_RESERVED_MEM=y
# CONFIG_OF_OVERLAY is not set
CONFIG_OF_NUMA=y
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
CONFIG_PARPORT=y
# CONFIG_PARPORT_PC is not set
# CONFIG_PARPORT_1284 is not set
CONFIG_PARPORT_NOT_PC=y
CONFIG_PNP=y
CONFIG_PNP_DEBUG_MESSAGES=y

#
# Protocols
#
CONFIG_PNPACPI=y
CONFIG_BLK_DEV=y
CONFIG_BLK_DEV_NULL_BLK=y
CONFIG_BLK_DEV_NULL_BLK_FAULT_INJECTION=y
# CONFIG_BLK_DEV_FD is not set
CONFIG_CDROM=y
# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
CONFIG_ZRAM=y
# CONFIG_ZRAM_BACKEND_LZ4 is not set
# CONFIG_ZRAM_BACKEND_LZ4HC is not set
# CONFIG_ZRAM_BACKEND_ZSTD is not set
# CONFIG_ZRAM_BACKEND_DEFLATE is not set
# CONFIG_ZRAM_BACKEND_842 is not set
CONFIG_ZRAM_BACKEND_FORCE_LZO=y
CONFIG_ZRAM_BACKEND_LZO=y
# CONFIG_ZRAM_DEF_COMP_LZORLE is not set
CONFIG_ZRAM_DEF_COMP_LZO=y
CONFIG_ZRAM_DEF_COMP="lzo"
# CONFIG_ZRAM_WRITEBACK is not set
# CONFIG_ZRAM_TRACK_ENTRY_ACTIME is not set
# CONFIG_ZRAM_MEMORY_TRACKING is not set
# CONFIG_ZRAM_MULTI_COMP is not set
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_LOOP_MIN_COUNT=16
# CONFIG_BLK_DEV_DRBD is not set
CONFIG_BLK_DEV_NBD=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_ATA_OVER_ETH=y
CONFIG_VIRTIO_BLK=y
# CONFIG_BLK_DEV_RBD is not set
CONFIG_BLK_DEV_UBLK=y
CONFIG_BLKDEV_UBLK_LEGACY_OPCODES=y
CONFIG_BLK_DEV_RNBD=y
CONFIG_BLK_DEV_RNBD_CLIENT=y
# CONFIG_BLK_DEV_ZONED_LOOP is not set

#
# NVME Support
#
CONFIG_NVME_CORE=y
CONFIG_BLK_DEV_NVME=y
CONFIG_NVME_MULTIPATH=y
# CONFIG_NVME_VERBOSE_ERRORS is not set
# CONFIG_NVME_HWMON is not set
CONFIG_NVME_FABRICS=y
CONFIG_NVME_RDMA=y
CONFIG_NVME_FC=y
CONFIG_NVME_TCP=y
# CONFIG_NVME_TCP_TLS is not set
# CONFIG_NVME_HOST_AUTH is not set
CONFIG_NVME_TARGET=y
# CONFIG_NVME_TARGET_DEBUGFS is not set
# CONFIG_NVME_TARGET_PASSTHRU is not set
CONFIG_NVME_TARGET_LOOP=y
CONFIG_NVME_TARGET_RDMA=y
CONFIG_NVME_TARGET_FC=y
CONFIG_NVME_TARGET_FCLOOP=y
CONFIG_NVME_TARGET_TCP=y
# CONFIG_NVME_TARGET_TCP_TLS is not set
# CONFIG_NVME_TARGET_AUTH is not set
# CONFIG_NVME_TARGET_PCI_EPF is not set
# end of NVME Support

#
# Misc devices
#
# CONFIG_AD525X_DPOT is not set
# CONFIG_DUMMY_IRQ is not set
# CONFIG_IBM_ASM is not set
# CONFIG_PHANTOM is not set
# CONFIG_RPMB is not set
# CONFIG_TI_FPC202 is not set
# CONFIG_TIFM_CORE is not set
# CONFIG_ICS932S401 is not set
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_HP_ILO is not set
# CONFIG_APDS9802ALS is not set
# CONFIG_ISL29003 is not set
# CONFIG_ISL29020 is not set
# CONFIG_SENSORS_TSL2550 is not set
# CONFIG_SENSORS_BH1770 is not set
# CONFIG_HMC6352 is not set
# CONFIG_DS1682 is not set
# CONFIG_VMWARE_BALLOON is not set
# CONFIG_LATTICE_ECP3_CONFIG is not set
# CONFIG_SRAM is not set
# CONFIG_DW_XDATA_PCIE is not set
# CONFIG_PCI_ENDPOINT_TEST is not set
# CONFIG_XILINX_SDFEC is not set
CONFIG_MISC_RTSX=y
# CONFIG_HISI_HIKEY_USB is not set
# CONFIG_OPEN_DICE is not set
# CONFIG_NTSYNC is not set
# CONFIG_VCPU_STALL_DETECTOR is not set
# CONFIG_NSM is not set
# CONFIG_C2PORT is not set

#
# EEPROM support
#
# CONFIG_EEPROM_AT24 is not set
# CONFIG_EEPROM_AT25 is not set
# CONFIG_EEPROM_MAX6875 is not set
CONFIG_EEPROM_93CX6=y
# CONFIG_EEPROM_93XX46 is not set
# CONFIG_EEPROM_IDT_89HPESX is not set
# CONFIG_EEPROM_EE1004 is not set
# CONFIG_EEPROM_M24LR is not set
# end of EEPROM support

# CONFIG_CB710_CORE is not set
# CONFIG_SENSORS_LIS3_I2C is not set
# CONFIG_ALTERA_STAPL is not set
CONFIG_INTEL_MEI=y
CONFIG_INTEL_MEI_ME=y
# CONFIG_INTEL_MEI_TXE is not set
# CONFIG_INTEL_MEI_GSC is not set
# CONFIG_INTEL_MEI_CSC is not set
# CONFIG_INTEL_MEI_VSC_HW is not set
# CONFIG_INTEL_MEI_HDCP is not set
# CONFIG_INTEL_MEI_PXP is not set
# CONFIG_INTEL_MEI_GSC_PROXY is not set
CONFIG_VMWARE_VMCI=y
# CONFIG_GENWQE is not set
# CONFIG_BCM_VK is not set
# CONFIG_MISC_ALCOR_PCI is not set
# CONFIG_MISC_RTSX_PCI is not set
CONFIG_MISC_RTSX_USB=y
# CONFIG_UACCE is not set
# CONFIG_PVPANIC is not set
# CONFIG_GP_PCI1XXXX is not set
# CONFIG_KEBA_CP500 is not set
# CONFIG_MISC_RP1 is not set
# end of Misc devices

#
# SCSI device support
#
CONFIG_SCSI_MOD=y
CONFIG_RAID_ATTRS=y
CONFIG_SCSI_COMMON=y
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
CONFIG_SCSI_NETLINK=y
CONFIG_SCSI_PROC_FS=y

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_ST=y
CONFIG_BLK_DEV_SR=y
CONFIG_CHR_DEV_SG=y
CONFIG_BLK_DEV_BSG=y
# CONFIG_CHR_DEV_SCH is not set
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_SCAN_ASYNC=y

#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=y
CONFIG_SCSI_FC_ATTRS=y
CONFIG_SCSI_ISCSI_ATTRS=y
CONFIG_SCSI_SAS_ATTRS=y
CONFIG_SCSI_SAS_LIBSAS=y
CONFIG_SCSI_SAS_ATA=y
# CONFIG_SCSI_SAS_HOST_SMP is not set
CONFIG_SCSI_SRP_ATTRS=y
# end of SCSI Transports

CONFIG_SCSI_LOWLEVEL=y
# CONFIG_ISCSI_TCP is not set
# CONFIG_ISCSI_BOOT_SYSFS is not set
# CONFIG_SCSI_CXGB3_ISCSI is not set
# CONFIG_SCSI_CXGB4_ISCSI is not set
# CONFIG_SCSI_BNX2_ISCSI is not set
# CONFIG_BE2ISCSI is not set
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
CONFIG_SCSI_HPSA=y
# CONFIG_SCSI_3W_9XXX is not set
# CONFIG_SCSI_3W_SAS is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AACRAID is not set
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_AIC94XX is not set
# CONFIG_SCSI_MVSAS is not set
# CONFIG_SCSI_MVUMI is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_ARCMSR is not set
# CONFIG_SCSI_ESAS2R is not set
# CONFIG_MEGARAID_NEWGEN is not set
# CONFIG_MEGARAID_LEGACY is not set
# CONFIG_MEGARAID_SAS is not set
# CONFIG_SCSI_MPT3SAS is not set
# CONFIG_SCSI_MPT2SAS is not set
# CONFIG_SCSI_MPI3MR is not set
# CONFIG_SCSI_SMARTPQI is not set
# CONFIG_SCSI_HPTIOP is not set
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_SCSI_MYRB is not set
# CONFIG_SCSI_MYRS is not set
# CONFIG_VMWARE_PVSCSI is not set
# CONFIG_LIBFC is not set
# CONFIG_SCSI_SNIC is not set
# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_FDOMAIN_PCI is not set
# CONFIG_SCSI_ISCI is not set
# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_STEX is not set
# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_IPR is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
# CONFIG_SCSI_QLA_FC is not set
# CONFIG_SCSI_QLA_ISCSI is not set
# CONFIG_SCSI_LPFC is not set
# CONFIG_SCSI_EFCT is not set
# CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_AM53C974 is not set
# CONFIG_SCSI_WD719X is not set
# CONFIG_SCSI_DEBUG is not set
# CONFIG_SCSI_PMCRAID is not set
# CONFIG_SCSI_PM8001 is not set
# CONFIG_SCSI_BFA_FC is not set
CONFIG_SCSI_VIRTIO=y
# CONFIG_SCSI_CHELSIO_FCOE is not set
# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
# CONFIG_SCSI_DH is not set
# end of SCSI device support

CONFIG_ATA=y
CONFIG_SATA_HOST=y
CONFIG_PATA_TIMINGS=y
CONFIG_ATA_VERBOSE_ERROR=y
CONFIG_ATA_FORCE=y
CONFIG_ATA_ACPI=y
# CONFIG_SATA_ZPODD is not set
CONFIG_SATA_PMP=y

#
# Controllers with non-SFF native interface
#
CONFIG_SATA_AHCI=y
CONFIG_SATA_MOBILE_LPM_POLICY=3
# CONFIG_SATA_AHCI_PLATFORM is not set
# CONFIG_AHCI_DWC is not set
# CONFIG_AHCI_CEVA is not set
# CONFIG_SATA_INIC162X is not set
# CONFIG_SATA_ACARD_AHCI is not set
# CONFIG_SATA_SIL24 is not set
CONFIG_ATA_SFF=y

#
# SFF controllers with custom DMA interface
#
# CONFIG_PDC_ADMA is not set
# CONFIG_SATA_QSTOR is not set
# CONFIG_SATA_SX4 is not set
CONFIG_ATA_BMDMA=y

#
# SATA SFF controllers with BMDMA
#
CONFIG_ATA_PIIX=y
# CONFIG_SATA_DWC is not set
# CONFIG_SATA_MV is not set
# CONFIG_SATA_NV is not set
# CONFIG_SATA_PROMISE is not set
# CONFIG_SATA_SIL is not set
# CONFIG_SATA_SIS is not set
# CONFIG_SATA_SVW is not set
# CONFIG_SATA_ULI is not set
# CONFIG_SATA_VIA is not set
# CONFIG_SATA_VITESSE is not set

#
# PATA SFF controllers with BMDMA
#
# CONFIG_PATA_ALI is not set
CONFIG_PATA_AMD=y
# CONFIG_PATA_ARTOP is not set
# CONFIG_PATA_ATIIXP is not set
# CONFIG_PATA_ATP867X is not set
# CONFIG_PATA_CMD64X is not set
# CONFIG_PATA_CYPRESS is not set
# CONFIG_PATA_EFAR is not set
# CONFIG_PATA_HPT366 is not set
# CONFIG_PATA_HPT37X is not set
# CONFIG_PATA_HPT3X2N is not set
# CONFIG_PATA_HPT3X3 is not set
# CONFIG_PATA_IT8213 is not set
# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_JMICRON is not set
# CONFIG_PATA_MARVELL is not set
# CONFIG_PATA_NETCELL is not set
# CONFIG_PATA_NINJA32 is not set
# CONFIG_PATA_NS87415 is not set
CONFIG_PATA_OLDPIIX=y
# CONFIG_PATA_OPTIDMA is not set
# CONFIG_PATA_PDC2027X is not set
# CONFIG_PATA_PDC_OLD is not set
# CONFIG_PATA_RADISYS is not set
# CONFIG_PATA_RDC is not set
CONFIG_PATA_SCH=y
# CONFIG_PATA_SERVERWORKS is not set
# CONFIG_PATA_SIL680 is not set
# CONFIG_PATA_SIS is not set
# CONFIG_PATA_TOSHIBA is not set
# CONFIG_PATA_TRIFLEX is not set
# CONFIG_PATA_VIA is not set
# CONFIG_PATA_WINBOND is not set

#
# PIO-only SFF controllers
#
# CONFIG_PATA_CMD640_PCI is not set
# CONFIG_PATA_MPIIX is not set
# CONFIG_PATA_NS87410 is not set
# CONFIG_PATA_OPTI is not set
# CONFIG_PATA_PCMCIA is not set
# CONFIG_PATA_OF_PLATFORM is not set
# CONFIG_PATA_RZ1000 is not set

#
# Generic fallback / legacy drivers
#
# CONFIG_PATA_ACPI is not set
CONFIG_ATA_GENERIC=y
# CONFIG_PATA_LEGACY is not set
CONFIG_MD=y
CONFIG_BLK_DEV_MD=y
CONFIG_MD_BITMAP=y
# CONFIG_MD_LLBITMAP is not set
CONFIG_MD_AUTODETECT=y
CONFIG_MD_BITMAP_FILE=y
# CONFIG_MD_LINEAR is not set
CONFIG_MD_RAID0=y
CONFIG_MD_RAID1=y
CONFIG_MD_RAID10=y
CONFIG_MD_RAID456=y
# CONFIG_MD_CLUSTER is not set
CONFIG_BCACHE=y
# CONFIG_BCACHE_DEBUG is not set
# CONFIG_BCACHE_ASYNC_REGISTRATION is not set
CONFIG_BLK_DEV_DM_BUILTIN=y
CONFIG_BLK_DEV_DM=y
# CONFIG_DM_DEBUG is not set
CONFIG_DM_BUFIO=y
# CONFIG_DM_DEBUG_BLOCK_MANAGER_LOCKING is not set
CONFIG_DM_BIO_PRISON=y
CONFIG_DM_PERSISTENT_DATA=y
# CONFIG_DM_UNSTRIPED is not set
CONFIG_DM_CRYPT=y
# CONFIG_DM_INLINECRYPT is not set
CONFIG_DM_SNAPSHOT=y
CONFIG_DM_THIN_PROVISIONING=y
CONFIG_DM_CACHE=y
CONFIG_DM_CACHE_SMQ=y
CONFIG_DM_WRITECACHE=y
# CONFIG_DM_EBS is not set
# CONFIG_DM_ERA is not set
CONFIG_DM_CLONE=y
CONFIG_DM_MIRROR=y
# CONFIG_DM_LOG_USERSPACE is not set
CONFIG_DM_RAID=y
CONFIG_DM_ZERO=y
CONFIG_DM_MULTIPATH=y
CONFIG_DM_MULTIPATH_QL=y
CONFIG_DM_MULTIPATH_ST=y
# CONFIG_DM_MULTIPATH_HST is not set
# CONFIG_DM_MULTIPATH_IOA is not set
# CONFIG_DM_DELAY is not set
# CONFIG_DM_DUST is not set
# CONFIG_DM_INIT is not set
CONFIG_DM_UEVENT=y
CONFIG_DM_FLAKEY=y
CONFIG_DM_VERITY=y
# CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG is not set
CONFIG_DM_VERITY_FEC=y
# CONFIG_DM_SWITCH is not set
# CONFIG_DM_LOG_WRITES is not set
CONFIG_DM_INTEGRITY=y
CONFIG_DM_ZONED=y
CONFIG_DM_AUDIT=y
# CONFIG_DM_VDO is not set
# CONFIG_DM_PCACHE is not set
CONFIG_TARGET_CORE=y
# CONFIG_TCM_IBLOCK is not set
# CONFIG_TCM_FILEIO is not set
# CONFIG_TCM_PSCSI is not set
# CONFIG_LOOPBACK_TARGET is not set
# CONFIG_ISCSI_TARGET is not set
# CONFIG_SBP_TARGET is not set
# CONFIG_REMOTE_TARGET is not set
# CONFIG_FUSION is not set

#
# IEEE 1394 (FireWire) support
#
CONFIG_FIREWIRE=y
CONFIG_FIREWIRE_OHCI=y
CONFIG_FIREWIRE_SBP2=y
CONFIG_FIREWIRE_NET=y
# CONFIG_FIREWIRE_NOSY is not set
# end of IEEE 1394 (FireWire) support

# CONFIG_MACINTOSH_DRIVERS is not set
CONFIG_NETDEVICES=y
CONFIG_MII=y
CONFIG_NET_CORE=y
CONFIG_BONDING=y
CONFIG_DUMMY=y
CONFIG_WIREGUARD=y
# CONFIG_WIREGUARD_DEBUG is not set
# CONFIG_OVPN is not set
CONFIG_EQUALIZER=y
CONFIG_NET_FC=y
CONFIG_IFB=y
CONFIG_NET_TEAM=y
CONFIG_NET_TEAM_MODE_BROADCAST=y
CONFIG_NET_TEAM_MODE_ROUNDROBIN=y
CONFIG_NET_TEAM_MODE_RANDOM=y
CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=y
CONFIG_NET_TEAM_MODE_LOADBALANCE=y
CONFIG_MACVLAN=y
CONFIG_MACVTAP=y
CONFIG_IPVLAN_L3S=y
CONFIG_IPVLAN=y
CONFIG_IPVTAP=y
CONFIG_VXLAN=y
CONFIG_GENEVE=y
CONFIG_BAREUDP=y
CONFIG_GTP=y
# CONFIG_PFCP is not set
# CONFIG_AMT is not set
CONFIG_MACSEC=y
CONFIG_NETCONSOLE=y
# CONFIG_NETCONSOLE_DYNAMIC is not set
# CONFIG_NETCONSOLE_EXTENDED_LOG is not set
CONFIG_NETPOLL=y
CONFIG_NET_POLL_CONTROLLER=y
CONFIG_TUN=y
CONFIG_TAP=y
CONFIG_TUN_VNET_CROSS_LE=y
CONFIG_VETH=y
CONFIG_VIRTIO_NET=y
CONFIG_NLMON=y
# CONFIG_NETKIT is not set
CONFIG_NET_VRF=y
CONFIG_VSOCKMON=y
# CONFIG_MHI_NET is not set
# CONFIG_ARCNET is not set
CONFIG_ATM_DRIVERS=y
# CONFIG_ATM_SOLOS is not set

#
# Distributed Switch Architecture drivers
#
# CONFIG_B53 is not set
# CONFIG_NET_DSA_BCM_SF2 is not set
# CONFIG_NET_DSA_LOOP is not set
# CONFIG_NET_DSA_HIRSCHMANN_HELLCREEK is not set
# CONFIG_NET_DSA_LANTIQ_GSWIP is not set
# CONFIG_NET_DSA_MXL_GSW1XX is not set
# CONFIG_NET_DSA_MT7530 is not set
# CONFIG_NET_DSA_MV88E6060 is not set
# CONFIG_NET_DSA_MICROCHIP_KSZ_COMMON is not set
# CONFIG_NET_DSA_MV88E6XXX is not set
# CONFIG_NET_DSA_MXL862 is not set
# CONFIG_NET_DSA_AR9331 is not set
# CONFIG_NET_DSA_QCA8K is not set
# CONFIG_NET_DSA_SJA1105 is not set
# CONFIG_NET_DSA_XRS700X_I2C is not set
# CONFIG_NET_DSA_XRS700X_MDIO is not set
# CONFIG_NET_DSA_REALTEK is not set
# CONFIG_NET_DSA_KS8995 is not set
# CONFIG_NET_DSA_SMSC_LAN9303_I2C is not set
# CONFIG_NET_DSA_SMSC_LAN9303_MDIO is not set
# CONFIG_NET_DSA_VITESSE_VSC73XX_SPI is not set
# CONFIG_NET_DSA_VITESSE_VSC73XX_PLATFORM is not set
# CONFIG_NET_DSA_YT921X is not set
# end of Distributed Switch Architecture drivers

CONFIG_ETHERNET=y
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_NET_VENDOR_ADAPTEC is not set
# CONFIG_NET_VENDOR_AGERE is not set
# CONFIG_NET_VENDOR_ALACRITECH is not set
CONFIG_NET_VENDOR_ALIBABA=y
# CONFIG_ALIBABA_EEA is not set
# CONFIG_ALTERA_TSE is not set
CONFIG_NET_VENDOR_AMAZON=y
# CONFIG_ENA_ETHERNET is not set
# CONFIG_NET_VENDOR_AMD is not set
# CONFIG_NET_VENDOR_AQUANTIA is not set
# CONFIG_NET_VENDOR_ARC is not set
CONFIG_NET_VENDOR_ASIX=y
# CONFIG_SPI_AX88796C is not set
# CONFIG_NET_VENDOR_ATHEROS is not set
# CONFIG_CX_ECAT is not set
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CADENCE is not set
# CONFIG_NET_VENDOR_CAVIUM is not set
# CONFIG_NET_VENDOR_CHELSIO is not set
CONFIG_NET_VENDOR_CISCO=y
# CONFIG_ENIC is not set
# CONFIG_NET_VENDOR_CORTINA is not set
CONFIG_NET_VENDOR_DAVICOM=y
# CONFIG_DM9051 is not set
# CONFIG_NET_VENDOR_DEC is not set
# CONFIG_NET_VENDOR_DLINK is not set
# CONFIG_NET_VENDOR_EMULEX is not set
CONFIG_NET_VENDOR_ENGLEDER=y
# CONFIG_TSNEP is not set
# CONFIG_NET_VENDOR_EZCHIP is not set
CONFIG_NET_VENDOR_FUNGIBLE=y
# CONFIG_FUN_ETH is not set
CONFIG_NET_VENDOR_GOOGLE=y
CONFIG_GVE=y
CONFIG_NET_VENDOR_HISILICON=y
# CONFIG_HIBMCGE is not set
# CONFIG_NET_VENDOR_HUAWEI is not set
CONFIG_NET_VENDOR_I825XX=y
CONFIG_NET_VENDOR_INTEL=y
CONFIG_E100=y
CONFIG_E1000=y
CONFIG_E1000E=y
CONFIG_E1000E_HWTS=y
# CONFIG_IGB is not set
# CONFIG_IGBVF is not set
# CONFIG_IXGBE is not set
# CONFIG_IXGBEVF is not set
# CONFIG_I40E is not set
# CONFIG_I40EVF is not set
# CONFIG_ICE is not set
# CONFIG_FM10K is not set
# CONFIG_IGC is not set
# CONFIG_IDPF is not set
# CONFIG_IXD is not set
# CONFIG_JME is not set
# CONFIG_NET_VENDOR_ADI is not set
CONFIG_NET_VENDOR_LITEX=y
# CONFIG_LITEX_LITEETH is not set
# CONFIG_NET_VENDOR_MARVELL is not set
CONFIG_NET_VENDOR_MELLANOX=y
# CONFIG_MLX4_EN is not set
CONFIG_MLX4_CORE=y
# CONFIG_MLX4_DEBUG is not set
# CONFIG_MLX4_CORE_GEN2 is not set
# CONFIG_MLX5_CORE is not set
# CONFIG_MLXSW_CORE is not set
# CONFIG_MLXFW is not set
CONFIG_NET_VENDOR_META=y
# CONFIG_FBNIC is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MICROCHIP is not set
# CONFIG_NET_VENDOR_MICROSEMI is not set
CONFIG_NET_VENDOR_MICROSOFT=y
CONFIG_NET_VENDOR_MUCSE=y
# CONFIG_MGBE is not set
# CONFIG_NET_VENDOR_MYRI is not set
# CONFIG_FEALNX is not set
# CONFIG_NET_VENDOR_NI is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_NETRONOME is not set
# CONFIG_NET_VENDOR_NVIDIA is not set
# CONFIG_NET_VENDOR_OKI is not set
# CONFIG_ETHOC is not set
# CONFIG_NET_VENDOR_PENSANDO is not set
# CONFIG_NET_VENDOR_QLOGIC is not set
# CONFIG_NET_VENDOR_BROCADE is not set
# CONFIG_NET_VENDOR_QUALCOMM is not set
# CONFIG_NET_VENDOR_RDC is not set
# CONFIG_NET_VENDOR_REALTEK is not set
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SILAN is not set
# CONFIG_NET_VENDOR_SIS is not set
# CONFIG_NET_VENDOR_SOLARFLARE is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_SOCIONEXT is not set
# CONFIG_NET_VENDOR_STMICRO is not set
# CONFIG_NET_VENDOR_SUN is not set
# CONFIG_NET_VENDOR_SYNOPSYS is not set
# CONFIG_NET_VENDOR_TEHUTI is not set
# CONFIG_NET_VENDOR_TI is not set
CONFIG_NET_VENDOR_VERTEXCOM=y
# CONFIG_MSE102X is not set
# CONFIG_NET_VENDOR_VIA is not set
CONFIG_NET_VENDOR_WANGXUN=y
# CONFIG_NGBE is not set
# CONFIG_TXGBE is not set
# CONFIG_TXGBEVF is not set
# CONFIG_NGBEVF is not set
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_NET_VENDOR_XILINX is not set
# CONFIG_NET_VENDOR_XIRCOM is not set
CONFIG_NET_VENDOR_ZTE=y
# CONFIG_DINGHAI is not set
CONFIG_FDDI=y
# CONFIG_DEFXX is not set
# CONFIG_SKFP is not set
CONFIG_PHYLINK=y
CONFIG_PHYLIB=y
CONFIG_SWPHY=y
CONFIG_PHY_PACKAGE=y
# CONFIG_LED_TRIGGER_PHY is not set
CONFIG_PHYLIB_LEDS=y
CONFIG_FIXED_PHY=y
# CONFIG_SFP is not set

#
# MII PHY device drivers
#
# CONFIG_AS21XXX_PHY is not set
# CONFIG_AIR_AN8801_PHY is not set
# CONFIG_AIR_EN8811H_PHY is not set
# CONFIG_AMD_PHY is not set
# CONFIG_ADIN_PHY is not set
# CONFIG_ADIN1100_PHY is not set
# CONFIG_ADIN1140_PHY is not set
# CONFIG_AQUANTIA_PHY is not set
CONFIG_AX88796B_PHY=y
# CONFIG_BROADCOM_PHY is not set
# CONFIG_BCM54140_PHY is not set
# CONFIG_BCM7XXX_PHY is not set
# CONFIG_BCM84881_PHY is not set
# CONFIG_BCM87XX_PHY is not set
# CONFIG_CICADA_PHY is not set
# CONFIG_CORTINA_PHY is not set
# CONFIG_DAP8211R_PHY is not set
# CONFIG_DAVICOM_PHY is not set
# CONFIG_ICPLUS_PHY is not set
# CONFIG_LXT_PHY is not set
# CONFIG_INTEL_XWAY_PHY is not set
# CONFIG_LSI_ET1011C_PHY is not set
# CONFIG_MARVELL_PHY is not set
# CONFIG_MARVELL_10G_PHY is not set
# CONFIG_MARVELL_88Q2XXX_PHY is not set
# CONFIG_MARVELL_88X2222_PHY is not set
# CONFIG_MAXLINEAR_GPHY is not set
# CONFIG_MAXLINEAR_86110_PHY is not set
# CONFIG_MEDIATEK_GE_PHY is not set
# CONFIG_MICREL_PHY is not set
# CONFIG_MICROCHIP_T1S_PHY is not set
CONFIG_MICROCHIP_PHY=y
# CONFIG_MICROCHIP_T1_PHY is not set
# CONFIG_MICROSEMI_PHY is not set
# CONFIG_MOTORCOMM_PHY is not set
# CONFIG_NATIONAL_PHY is not set
# CONFIG_NXP_CBTX_PHY is not set
# CONFIG_NXP_C45_TJA11XX_PHY is not set
# CONFIG_NXP_TJA11XX_PHY is not set
# CONFIG_NCN26000_PHY is not set
# CONFIG_AT803X_PHY is not set
# CONFIG_QCA83XX_PHY is not set
# CONFIG_QCA808X_PHY is not set
# CONFIG_QCA807X_PHY is not set
# CONFIG_QSEMI_PHY is not set
CONFIG_REALTEK_PHY=y
# CONFIG_REALTEK_PHY_HWMON is not set
# CONFIG_RENESAS_PHY is not set
# CONFIG_ROCKCHIP_PHY is not set
CONFIG_SMSC_PHY=y
# CONFIG_STE10XP is not set
# CONFIG_TERANETICS_PHY is not set
# CONFIG_DP83822_PHY is not set
# CONFIG_DP83TC811_PHY is not set
# CONFIG_DP83848_PHY is not set
# CONFIG_DP83867_PHY is not set
# CONFIG_DP83869_PHY is not set
# CONFIG_DP83TD510_PHY is not set
# CONFIG_DP83TG720_PHY is not set
# CONFIG_VITESSE_PHY is not set
# CONFIG_XILINX_GMII2RGMII is not set
# CONFIG_PSE_CONTROLLER is not set
CONFIG_CAN_DEV=y
CONFIG_CAN_VCAN=y
CONFIG_CAN_VXCAN=y
CONFIG_CAN_NETLINK=y
CONFIG_CAN_CALC_BITTIMING=y
CONFIG_CAN_RX_OFFLOAD=y
# CONFIG_CAN_CAN327 is not set
# CONFIG_CAN_DUMMY is not set
# CONFIG_CAN_FLEXCAN is not set
# CONFIG_CAN_GRCAN is not set
# CONFIG_CAN_KVASER_PCIEFD is not set
CONFIG_CAN_SLCAN=y
# CONFIG_CAN_VIRTIO_CAN is not set
# CONFIG_CAN_C_CAN is not set
# CONFIG_CAN_CC770 is not set
# CONFIG_CAN_CTUCANFD_PCI is not set
# CONFIG_CAN_CTUCANFD_PLATFORM is not set
# CONFIG_CAN_ESD_402_PCI is not set
CONFIG_CAN_IFI_CANFD=y
# CONFIG_CAN_M_CAN is not set
# CONFIG_CAN_PEAK_PCIEFD is not set
# CONFIG_CAN_SJA1000 is not set
# CONFIG_CAN_SOFTING is not set

#
# CAN SPI interfaces
#
# CONFIG_CAN_HI311X is not set
# CONFIG_CAN_MCP251X is not set
# CONFIG_CAN_MCP251XFD is not set
# end of CAN SPI interfaces

#
# CAN USB interfaces
#
CONFIG_CAN_8DEV_USB=y
CONFIG_CAN_EMS_USB=y
CONFIG_CAN_ESD_USB=y
CONFIG_CAN_ETAS_ES58X=y
CONFIG_CAN_F81604=y
CONFIG_CAN_GS_USB=y
CONFIG_CAN_KVASER_USB=y
CONFIG_CAN_MCBA_USB=y
CONFIG_CAN_PEAK_USB=y
CONFIG_CAN_UCAN=y
# end of CAN USB interfaces

# CONFIG_CAN_DEBUG_DEVICES is not set

#
# MCTP Device Drivers
#
# CONFIG_MCTP_SERIAL is not set
# CONFIG_MCTP_TRANSPORT_I2C is not set
# CONFIG_MCTP_TRANSPORT_USBLIB is not set
# CONFIG_MCTP_TRANSPORT_USB is not set
# end of MCTP Device Drivers

#
# MDIO controller drivers
#
CONFIG_FWNODE_MDIO=y
CONFIG_OF_MDIO=y
CONFIG_ACPI_MDIO=y
# CONFIG_MDIO_BITBANG is not set
# CONFIG_MDIO_BCM_UNIMAC is not set
# CONFIG_MDIO_HISI_FEMAC is not set
CONFIG_MDIO_MVUSB=y
# CONFIG_MDIO_MSCC_MIIM is not set
# CONFIG_MDIO_OCTEON is not set
# CONFIG_MDIO_IPQ4019 is not set
# CONFIG_MDIO_IPQ8064 is not set
# CONFIG_MDIO_THUNDER is not set

#
# MDIO Multiplexers
#
# CONFIG_MDIO_BUS_MUX_GPIO is not set
# CONFIG_MDIO_BUS_MUX_MULTIPLEXER is not set
# CONFIG_MDIO_BUS_MUX_MMIOREG is not set
# end of MDIO Multiplexers
# end of MDIO controller drivers

#
# PCS device drivers
#
# CONFIG_PCS_XPCS is not set
# end of PCS device drivers

# CONFIG_PLIP is not set
CONFIG_PPP=y
CONFIG_PPP_BSDCOMP=y
CONFIG_PPP_DEFLATE=y
CONFIG_PPP_FILTER=y
CONFIG_PPP_MPPE=y
CONFIG_PPP_MULTILINK=y
CONFIG_PPPOATM=y
CONFIG_PPPOX=y
CONFIG_PPPOE=y
CONFIG_PPPOE_HASH_BITS_1=y
# CONFIG_PPPOE_HASH_BITS_2 is not set
# CONFIG_PPPOE_HASH_BITS_4 is not set
# CONFIG_PPPOE_HASH_BITS_8 is not set
CONFIG_PPPOE_HASH_BITS=1
CONFIG_PPTP=y
CONFIG_PPPOL2TP=y
CONFIG_PPP_ASYNC=y
CONFIG_PPP_SYNC_TTY=y
CONFIG_SLIP=y
CONFIG_SLHC=y
CONFIG_SLIP_COMPRESSED=y
CONFIG_SLIP_SMART=y
CONFIG_SLIP_MODE_SLIP6=y
CONFIG_USB_NET_DRIVERS=y
CONFIG_USB_CATC=y
CONFIG_USB_KAWETH=y
CONFIG_USB_PEGASUS=y
CONFIG_USB_RTL8150=y
CONFIG_USB_RTL8152=y
CONFIG_USB_LAN78XX=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_AX88179_178A=y
CONFIG_USB_NET_CDCETHER=y
CONFIG_USB_NET_CDC_EEM=y
CONFIG_USB_NET_CDC_NCM=y
CONFIG_USB_NET_HUAWEI_CDC_NCM=y
CONFIG_USB_NET_CDC_MBIM=y
CONFIG_USB_NET_DM9601=y
CONFIG_USB_NET_SR9700=y
CONFIG_USB_NET_SR9800=y
CONFIG_USB_NET_SMSC75XX=y
CONFIG_USB_NET_SMSC95XX=y
CONFIG_USB_NET_GL620A=y
CONFIG_USB_NET_NET1080=y
CONFIG_USB_NET_PLUSB=y
CONFIG_USB_NET_MCS7830=y
CONFIG_USB_NET_RNDIS_HOST=y
CONFIG_USB_NET_CDC_SUBSET_ENABLE=y
CONFIG_USB_NET_CDC_SUBSET=y
CONFIG_USB_ALI_M5632=y
CONFIG_USB_AN2720=y
CONFIG_USB_BELKIN=y
CONFIG_USB_ARMLINUX=y
CONFIG_USB_EPSON2888=y
CONFIG_USB_KC2190=y
CONFIG_USB_NET_ZAURUS=y
CONFIG_USB_NET_CX82310_ETH=y
CONFIG_USB_NET_KALMIA=y
CONFIG_USB_NET_QMI_WWAN=y
CONFIG_USB_HSO=y
CONFIG_USB_NET_INT51X1=y
CONFIG_USB_CDC_PHONET=y
CONFIG_USB_IPHETH=y
CONFIG_USB_SIERRA_NET=y
CONFIG_USB_VL600=y
CONFIG_USB_NET_CH9200=y
CONFIG_USB_NET_AQC111=y
CONFIG_USB_RTL8153_ECM=y
CONFIG_WLAN=y
CONFIG_WLAN_VENDOR_ADMTEK=y
# CONFIG_ADM8211 is not set
CONFIG_ATH_COMMON=y
CONFIG_WLAN_VENDOR_ATH=y
# CONFIG_ATH_DEBUG is not set
# CONFIG_ATH5K is not set
# CONFIG_ATH5K_PCI is not set
CONFIG_ATH9K_HW=y
CONFIG_ATH9K_COMMON=y
CONFIG_ATH9K_COMMON_DEBUG=y
CONFIG_ATH9K_BTCOEX_SUPPORT=y
CONFIG_ATH9K=y
CONFIG_ATH9K_PCI=y
CONFIG_ATH9K_AHB=y
CONFIG_ATH9K_DEBUGFS=y
# CONFIG_ATH9K_STATION_STATISTICS is not set
CONFIG_ATH9K_DYNACK=y
# CONFIG_ATH9K_WOW is not set
CONFIG_ATH9K_RFKILL=y
CONFIG_ATH9K_CHANNEL_CONTEXT=y
CONFIG_ATH9K_PCOEM=y
# CONFIG_ATH9K_PCI_NO_EEPROM is not set
CONFIG_ATH9K_HTC=y
CONFIG_ATH9K_HTC_DEBUGFS=y
# CONFIG_ATH9K_HWRNG is not set
CONFIG_ATH9K_COMMON_SPECTRAL=y
CONFIG_CARL9170=y
CONFIG_CARL9170_LEDS=y
# CONFIG_CARL9170_DEBUGFS is not set
CONFIG_CARL9170_WPC=y
CONFIG_CARL9170_HWRNG=y
CONFIG_ATH6KL=y
# CONFIG_ATH6KL_SDIO is not set
CONFIG_ATH6KL_USB=y
# CONFIG_ATH6KL_DEBUG is not set
# CONFIG_ATH6KL_TRACING is not set
CONFIG_AR5523=y
# CONFIG_WIL6210 is not set
CONFIG_ATH10K=y
CONFIG_ATH10K_CE=y
CONFIG_ATH10K_PCI=y
# CONFIG_ATH10K_AHB is not set
# CONFIG_ATH10K_SDIO is not set
CONFIG_ATH10K_USB=y
# CONFIG_ATH10K_DEBUG is not set
# CONFIG_ATH10K_DEBUGFS is not set
CONFIG_ATH10K_LEDS=y
# CONFIG_ATH10K_TRACING is not set
# CONFIG_WCN36XX is not set
CONFIG_ATH11K=y
# CONFIG_ATH11K_PCI is not set
# CONFIG_ATH11K_DEBUG is not set
# CONFIG_ATH11K_DEBUGFS is not set
# CONFIG_ATH11K_TRACING is not set
# CONFIG_ATH12K is not set
# CONFIG_WLAN_VENDOR_ATMEL is not set
# CONFIG_WLAN_VENDOR_BROADCOM is not set
# CONFIG_WLAN_VENDOR_INTEL is not set
# CONFIG_WLAN_VENDOR_INTERSIL is not set
# CONFIG_WLAN_VENDOR_MARVELL is not set
# CONFIG_WLAN_VENDOR_MEDIATEK is not set
# CONFIG_WLAN_VENDOR_MICROCHIP is not set
CONFIG_WLAN_VENDOR_MORSEMICRO=y
# CONFIG_MM81X_USB is not set
# CONFIG_MM81X_SDIO is not set
CONFIG_WLAN_VENDOR_NXP=y
# CONFIG_NXPWIFI_SDIO is not set
CONFIG_WLAN_VENDOR_PURELIFI=y
CONFIG_PLFXLC=y
# CONFIG_WLAN_VENDOR_RALINK is not set
# CONFIG_WLAN_VENDOR_REALTEK is not set
# CONFIG_WLAN_VENDOR_RSI is not set
CONFIG_WLAN_VENDOR_SILABS=y
# CONFIG_WFX is not set
# CONFIG_WLAN_VENDOR_ST is not set
# CONFIG_WLAN_VENDOR_TI is not set
# CONFIG_WLAN_VENDOR_ZYDAS is not set
# CONFIG_WLAN_VENDOR_QUANTENNA is not set
CONFIG_MAC80211_HWSIM=y
CONFIG_VIRT_WIFI=y
CONFIG_WAN=y
CONFIG_HDLC=y
CONFIG_HDLC_RAW=y
CONFIG_HDLC_RAW_ETH=y
CONFIG_HDLC_CISCO=y
CONFIG_HDLC_FR=y
CONFIG_HDLC_PPP=y
CONFIG_HDLC_X25=y
# CONFIG_FRAMER is not set
# CONFIG_PCI200SYN is not set
# CONFIG_WANXL is not set
# CONFIG_PC300TOO is not set
# CONFIG_FARSYNC is not set
CONFIG_LAPBETHER=y
CONFIG_IEEE802154_DRIVERS=y
# CONFIG_IEEE802154_FAKELB is not set
# CONFIG_IEEE802154_AT86RF230 is not set
# CONFIG_IEEE802154_MRF24J40 is not set
# CONFIG_IEEE802154_CC2520 is not set
CONFIG_IEEE802154_ATUSB=y
# CONFIG_IEEE802154_ADF7242 is not set
# CONFIG_IEEE802154_CA8210 is not set
# CONFIG_IEEE802154_MCR20A is not set
CONFIG_IEEE802154_HWSIM=y

#
# Wireless WAN
#
CONFIG_WWAN=y
# CONFIG_WWAN_DEBUGFS is not set
# CONFIG_WWAN_HWSIM is not set
CONFIG_MHI_WWAN_CTRL=y
# CONFIG_MHI_WWAN_MBIM is not set
# CONFIG_IOSM is not set
# CONFIG_MTK_T7XX is not set
# end of Wireless WAN

CONFIG_VMXNET3=y
# CONFIG_FUJITSU_ES is not set
CONFIG_USB4_NET=y
CONFIG_NETDEVSIM=y
CONFIG_NET_FAILOVER=y

#
# Input device support
#
CONFIG_INPUT=y
CONFIG_INPUT_LEDS=y
CONFIG_INPUT_FF_MEMLESS=y
CONFIG_INPUT_SPARSEKMAP=y
# CONFIG_INPUT_MATRIXKMAP is not set
CONFIG_INPUT_VIVALDIFMAP=y

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
CONFIG_INPUT_JOYDEV=y
CONFIG_INPUT_EVDEV=y

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_ADC is not set
# CONFIG_KEYBOARD_ADP5588 is not set
CONFIG_KEYBOARD_ATKBD=y
# CONFIG_KEYBOARD_QT1050 is not set
# CONFIG_KEYBOARD_QT1070 is not set
# CONFIG_KEYBOARD_QT2160 is not set
# CONFIG_KEYBOARD_DLINK_DIR685 is not set
# CONFIG_KEYBOARD_LKKBD is not set
# CONFIG_KEYBOARD_GPIO is not set
# CONFIG_KEYBOARD_GPIO_POLLED is not set
# CONFIG_KEYBOARD_TCA8418 is not set
# CONFIG_KEYBOARD_MATRIX is not set
# CONFIG_KEYBOARD_CHARLIEPLEX is not set
# CONFIG_KEYBOARD_LM8323 is not set
# CONFIG_KEYBOARD_LM8333 is not set
# CONFIG_KEYBOARD_MAX7359 is not set
# CONFIG_KEYBOARD_MPR121 is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_OPENCORES is not set
# CONFIG_KEYBOARD_PINEPHONE is not set
# CONFIG_KEYBOARD_SAMSUNG is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_OMAP4 is not set
# CONFIG_KEYBOARD_TM2_TOUCHKEY is not set
# CONFIG_KEYBOARD_TWL4030 is not set
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_CAP11XX is not set
# CONFIG_KEYBOARD_BCM is not set
# CONFIG_KEYBOARD_CYPRESS_SF is not set
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=y
CONFIG_MOUSE_PS2_ALPS=y
CONFIG_MOUSE_PS2_BYD=y
CONFIG_MOUSE_PS2_LOGIPS2PP=y
CONFIG_MOUSE_PS2_SYNAPTICS=y
CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y
CONFIG_MOUSE_PS2_CYPRESS=y
CONFIG_MOUSE_PS2_LIFEBOOK=y
CONFIG_MOUSE_PS2_TRACKPOINT=y
# CONFIG_MOUSE_PS2_ELANTECH is not set
# CONFIG_MOUSE_PS2_SENTELIC is not set
# CONFIG_MOUSE_PS2_TOUCHKIT is not set
CONFIG_MOUSE_PS2_FOCALTECH=y
# CONFIG_MOUSE_PS2_VMMOUSE is not set
CONFIG_MOUSE_PS2_SMBUS=y
# CONFIG_MOUSE_SERIAL is not set
CONFIG_MOUSE_APPLETOUCH=y
CONFIG_MOUSE_BCM5974=y
# CONFIG_MOUSE_CYAPA is not set
# CONFIG_MOUSE_ELAN_I2C is not set
# CONFIG_MOUSE_VSXXXAA is not set
# CONFIG_MOUSE_GPIO is not set
# CONFIG_MOUSE_SYNAPTICS_I2C is not set
CONFIG_MOUSE_SYNAPTICS_USB=y
CONFIG_INPUT_JOYSTICK=y
# CONFIG_JOYSTICK_ANALOG is not set
# CONFIG_JOYSTICK_A3D is not set
# CONFIG_JOYSTICK_ADC is not set
# CONFIG_JOYSTICK_ADI is not set
# CONFIG_JOYSTICK_COBRA is not set
# CONFIG_JOYSTICK_GF2K is not set
# CONFIG_JOYSTICK_GRIP is not set
# CONFIG_JOYSTICK_GRIP_MP is not set
# CONFIG_JOYSTICK_GUILLEMOT is not set
# CONFIG_JOYSTICK_INTERACT is not set
# CONFIG_JOYSTICK_SIDEWINDER is not set
# CONFIG_JOYSTICK_TMDC is not set
CONFIG_JOYSTICK_IFORCE=y
CONFIG_JOYSTICK_IFORCE_USB=y
# CONFIG_JOYSTICK_IFORCE_232 is not set
# CONFIG_JOYSTICK_WARRIOR is not set
# CONFIG_JOYSTICK_MAGELLAN is not set
# CONFIG_JOYSTICK_SPACEORB is not set
# CONFIG_JOYSTICK_SPACEBALL is not set
# CONFIG_JOYSTICK_STINGER is not set
# CONFIG_JOYSTICK_TWIDJOY is not set
# CONFIG_JOYSTICK_ZHENHUA is not set
# CONFIG_JOYSTICK_DB9 is not set
# CONFIG_JOYSTICK_GAMECON is not set
# CONFIG_JOYSTICK_TURBOGRAFX is not set
# CONFIG_JOYSTICK_AS5011 is not set
# CONFIG_JOYSTICK_JOYDUMP is not set
CONFIG_JOYSTICK_XPAD=y
CONFIG_JOYSTICK_XPAD_FF=y
CONFIG_JOYSTICK_XPAD_LEDS=y
# CONFIG_JOYSTICK_WALKERA0701 is not set
# CONFIG_JOYSTICK_PSXPAD_SPI is not set
CONFIG_JOYSTICK_PXRC=y
# CONFIG_JOYSTICK_QWIIC is not set
# CONFIG_JOYSTICK_FSIA6B is not set
# CONFIG_JOYSTICK_SENSEHAT is not set
# CONFIG_JOYSTICK_SEESAW is not set
CONFIG_INPUT_TABLET=y
CONFIG_TABLET_USB_ACECAD=y
CONFIG_TABLET_USB_AIPTEK=y
CONFIG_TABLET_USB_HANWANG=y
CONFIG_TABLET_USB_KBTAB=y
CONFIG_TABLET_USB_PEGASUS=y
# CONFIG_TABLET_SERIAL_WACOM4 is not set
CONFIG_INPUT_TOUCHSCREEN=y
# CONFIG_TOUCHSCREEN_ADS7846 is not set
# CONFIG_TOUCHSCREEN_AD7877 is not set
# CONFIG_TOUCHSCREEN_AD7879 is not set
# CONFIG_TOUCHSCREEN_ADC is not set
# CONFIG_TOUCHSCREEN_AR1021_I2C is not set
# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set
# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set
# CONFIG_TOUCHSCREEN_BU21013 is not set
# CONFIG_TOUCHSCREEN_BU21029 is not set
# CONFIG_TOUCHSCREEN_CHIPONE_ICN8318 is not set
# CONFIG_TOUCHSCREEN_CHIPONE_ICN8505 is not set
# CONFIG_TOUCHSCREEN_CY8CTMA140 is not set
# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set
# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set
# CONFIG_TOUCHSCREEN_CYTTSP5 is not set
# CONFIG_TOUCHSCREEN_DYNAPRO is not set
# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set
# CONFIG_TOUCHSCREEN_EETI is not set
# CONFIG_TOUCHSCREEN_EGALAX is not set
# CONFIG_TOUCHSCREEN_EGALAX_SERIAL is not set
# CONFIG_TOUCHSCREEN_EXC3000 is not set
# CONFIG_TOUCHSCREEN_FUJITSU is not set
# CONFIG_TOUCHSCREEN_GOODIX is not set
# CONFIG_TOUCHSCREEN_GOODIX_BERLIN_I2C is not set
# CONFIG_TOUCHSCREEN_GOODIX_BERLIN_SPI is not set
# CONFIG_TOUCHSCREEN_HIDEEP is not set
# CONFIG_TOUCHSCREEN_HIMAX_HX852X is not set
# CONFIG_TOUCHSCREEN_HYCON_HY46XX is not set
# CONFIG_TOUCHSCREEN_HYNITRON_CSTXXX is not set
# CONFIG_TOUCHSCREEN_HYNITRON_CST816X is not set
# CONFIG_TOUCHSCREEN_ILI210X is not set
# CONFIG_TOUCHSCREEN_ILITEK is not set
# CONFIG_TOUCHSCREEN_S6SY761 is not set
# CONFIG_TOUCHSCREEN_GUNZE is not set
# CONFIG_TOUCHSCREEN_EKTF2127 is not set
# CONFIG_TOUCHSCREEN_ELAN is not set
# CONFIG_TOUCHSCREEN_ELO is not set
# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
# CONFIG_TOUCHSCREEN_WACOM_I2C is not set
# CONFIG_TOUCHSCREEN_WACOM_W9000 is not set
# CONFIG_TOUCHSCREEN_MAX11801 is not set
# CONFIG_TOUCHSCREEN_MMS114 is not set
# CONFIG_TOUCHSCREEN_MELFAS_MIP4 is not set
# CONFIG_TOUCHSCREEN_MSG2638 is not set
# CONFIG_TOUCHSCREEN_MTOUCH is not set
# CONFIG_TOUCHSCREEN_NOVATEK_NVT_TS is not set
# CONFIG_TOUCHSCREEN_IMAGIS is not set
# CONFIG_TOUCHSCREEN_IMX6UL_TSC is not set
# CONFIG_TOUCHSCREEN_INEXIO is not set
# CONFIG_TOUCHSCREEN_PENMOUNT is not set
# CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set
# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
# CONFIG_TOUCHSCREEN_PIXCIR is not set
# CONFIG_TOUCHSCREEN_WDT87XX_I2C is not set
CONFIG_TOUCHSCREEN_USB_COMPOSITE=y
CONFIG_TOUCHSCREEN_USB_EGALAX=y
CONFIG_TOUCHSCREEN_USB_PANJIT=y
CONFIG_TOUCHSCREEN_USB_3M=y
CONFIG_TOUCHSCREEN_USB_ITM=y
CONFIG_TOUCHSCREEN_USB_ETURBO=y
CONFIG_TOUCHSCREEN_USB_GUNZE=y
CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y
CONFIG_TOUCHSCREEN_USB_IRTOUCH=y
CONFIG_TOUCHSCREEN_USB_IDEALTEK=y
CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y
CONFIG_TOUCHSCREEN_USB_GOTOP=y
CONFIG_TOUCHSCREEN_USB_JASTEC=y
CONFIG_TOUCHSCREEN_USB_ELO=y
CONFIG_TOUCHSCREEN_USB_E2I=y
CONFIG_TOUCHSCREEN_USB_ZYTRONIC=y
CONFIG_TOUCHSCREEN_USB_ETT_TC45USB=y
CONFIG_TOUCHSCREEN_USB_NEXIO=y
CONFIG_TOUCHSCREEN_USB_EASYTOUCH=y
# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
# CONFIG_TOUCHSCREEN_TSC_SERIO is not set
# CONFIG_TOUCHSCREEN_TSC2004 is not set
# CONFIG_TOUCHSCREEN_TSC2005 is not set
# CONFIG_TOUCHSCREEN_TSC2007 is not set
# CONFIG_TOUCHSCREEN_RM_TS is not set
# CONFIG_TOUCHSCREEN_SILEAD is not set
# CONFIG_TOUCHSCREEN_SIS_I2C is not set
# CONFIG_TOUCHSCREEN_ST1232 is not set
# CONFIG_TOUCHSCREEN_STMFTS is not set
CONFIG_TOUCHSCREEN_SUR40=y
# CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set
# CONFIG_TOUCHSCREEN_SX8654 is not set
# CONFIG_TOUCHSCREEN_TPS6507X is not set
# CONFIG_TOUCHSCREEN_ZET6223 is not set
# CONFIG_TOUCHSCREEN_ZFORCE is not set
# CONFIG_TOUCHSCREEN_COLIBRI_VF50 is not set
# CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set
# CONFIG_TOUCHSCREEN_IQS5XX is not set
# CONFIG_TOUCHSCREEN_IQS7211 is not set
# CONFIG_TOUCHSCREEN_ZINITIX is not set
# CONFIG_TOUCHSCREEN_HIMAX_HX83112B is not set
CONFIG_INPUT_MISC=y
# CONFIG_INPUT_AD714X is not set
# CONFIG_INPUT_ATMEL_CAPTOUCH is not set
# CONFIG_INPUT_AW86927 is not set
# CONFIG_INPUT_BMA150 is not set
# CONFIG_INPUT_E3X0_BUTTON is not set
# CONFIG_INPUT_PCSPKR is not set
# CONFIG_INPUT_MMA8450 is not set
# CONFIG_INPUT_APANEL is not set
# CONFIG_INPUT_GPIO_BEEPER is not set
# CONFIG_INPUT_GPIO_DECODER is not set
# CONFIG_INPUT_GPIO_VIBRA is not set
# CONFIG_INPUT_ATLAS_BTNS is not set
CONFIG_INPUT_ATI_REMOTE2=y
CONFIG_INPUT_KEYSPAN_REMOTE=y
# CONFIG_INPUT_KXTJ9 is not set
CONFIG_INPUT_POWERMATE=y
CONFIG_INPUT_YEALINK=y
CONFIG_INPUT_CM109=y
# CONFIG_INPUT_REGULATOR_HAPTIC is not set
# CONFIG_INPUT_RETU_PWRBUTTON is not set
# CONFIG_INPUT_TWL4030_PWRBUTTON is not set
# CONFIG_INPUT_TWL4030_VIBRA is not set
CONFIG_INPUT_UINPUT=y
# CONFIG_INPUT_PCF8574 is not set
# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
# CONFIG_INPUT_DA7280_HAPTICS is not set
# CONFIG_INPUT_ADXL34X is not set
# CONFIG_INPUT_IBM_PANEL is not set
CONFIG_INPUT_IMS_PCU=y
# CONFIG_INPUT_IQS269A is not set
# CONFIG_INPUT_IQS626A is not set
# CONFIG_INPUT_IQS7222 is not set
# CONFIG_INPUT_ISA1200_HAPTIC is not set
# CONFIG_INPUT_CMA3000 is not set
# CONFIG_INPUT_IDEAPAD_SLIDEBAR is not set
# CONFIG_INPUT_AMD_SFH_TABLETMODE is not set
# CONFIG_INPUT_DRV260X_HAPTICS is not set
# CONFIG_INPUT_DRV2665_HAPTICS is not set
# CONFIG_INPUT_DRV2667_HAPTICS is not set
CONFIG_RMI4_CORE=y
# CONFIG_RMI4_I2C is not set
# CONFIG_RMI4_SPI is not set
# CONFIG_RMI4_SMB is not set
CONFIG_RMI4_F03=y
CONFIG_RMI4_F03_SERIO=y
CONFIG_RMI4_2D_SENSOR=y
CONFIG_RMI4_F11=y
CONFIG_RMI4_F12=y
# CONFIG_RMI4_F1A is not set
# CONFIG_RMI4_F21 is not set
CONFIG_RMI4_F30=y
# CONFIG_RMI4_F34 is not set
CONFIG_RMI4_F3A=y
# CONFIG_RMI4_F54 is not set
# CONFIG_RMI4_F55 is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=y
CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
CONFIG_SERIO_I8042=y
CONFIG_SERIO_SERPORT=y
# CONFIG_SERIO_PARKBD is not set
# CONFIG_SERIO_PCIPS2 is not set
CONFIG_SERIO_LIBPS2=y
# CONFIG_SERIO_RAW is not set
# CONFIG_SERIO_ALTERA_PS2 is not set
# CONFIG_SERIO_PS2MULT is not set
# CONFIG_SERIO_ARC_PS2 is not set
# CONFIG_SERIO_APBPS2 is not set
# CONFIG_SERIO_GPIO_PS2 is not set
CONFIG_USERIO=y
# CONFIG_GAMEPORT is not set
# end of Hardware I/O ports
# end of Input device support

#
# Character devices
#
CONFIG_TTY=y
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_UNIX98_PTYS=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
CONFIG_LEGACY_TIOCSTI=y
CONFIG_LDISC_AUTOLOAD=y

#
# Serial drivers
#
CONFIG_SERIAL_EARLYCON=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_PNP=y
# CONFIG_SERIAL_8250_16550A_VARIANTS is not set
# CONFIG_SERIAL_8250_FINTEK is not set
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_DMA=y
CONFIG_SERIAL_8250_PCILIB=y
CONFIG_SERIAL_8250_PCI=y
# CONFIG_SERIAL_8250_EXAR is not set
# CONFIG_SERIAL_8250_CS is not set
CONFIG_SERIAL_8250_NR_UARTS=32
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y
CONFIG_SERIAL_8250_MANY_PORTS=y
# CONFIG_SERIAL_8250_PCI1XXXX is not set
# CONFIG_SERIAL_8250_DW is not set
# CONFIG_SERIAL_8250_RT288X is not set
CONFIG_SERIAL_8250_LPSS=y
CONFIG_SERIAL_8250_MID=y
CONFIG_SERIAL_8250_PERICOM=y
# CONFIG_SERIAL_8250_NI is not set
# CONFIG_SERIAL_OF_PLATFORM is not set
CONFIG_SERIAL_8250_DWLIB=y

#
# Non-8250 serial port support
#
# CONFIG_SERIAL_MAX3100 is not set
# CONFIG_SERIAL_MAX310X is not set
# CONFIG_SERIAL_UARTLITE is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_JSM is not set
# CONFIG_SERIAL_SIFIVE is not set
# CONFIG_SERIAL_LANTIQ is not set
# CONFIG_SERIAL_SCCNXP is not set
# CONFIG_SERIAL_SC16IS7XX is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_XILINX_PS_UART is not set
# CONFIG_SERIAL_ARC is not set
# CONFIG_SERIAL_RP2 is not set
# CONFIG_SERIAL_FSL_LPUART is not set
# CONFIG_SERIAL_FSL_LINFLEXUART is not set
# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set
# CONFIG_SERIAL_SPRD is not set
# end of Serial drivers

CONFIG_SERIAL_MCTRL_GPIO=y
CONFIG_SERIAL_NONSTANDARD=y
# CONFIG_MOXA_INTELLIO is not set
# CONFIG_MOXA_SMARTIO is not set
CONFIG_N_HDLC=y
# CONFIG_IPWIRELESS is not set
CONFIG_N_GSM=y
CONFIG_NOZOMI=y
CONFIG_NULL_TTY=y
CONFIG_HVC_DRIVER=y
CONFIG_SERIAL_DEV_BUS=y
CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
CONFIG_TTY_PRINTK=y
CONFIG_TTY_PRINTK_LEVEL=6
# CONFIG_PRINTER is not set
# CONFIG_PPDEV is not set
CONFIG_VIRTIO_CONSOLE=y
# CONFIG_IPMI_HANDLER is not set
# CONFIG_SSIF_IPMI_BMC is not set
# CONFIG_IPMB_DEVICE_INTERFACE is not set
CONFIG_HW_RANDOM=y
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
# CONFIG_HW_RANDOM_INTEL is not set
# CONFIG_HW_RANDOM_AMD is not set
# CONFIG_HW_RANDOM_BA431 is not set
# CONFIG_HW_RANDOM_VIA is not set
CONFIG_HW_RANDOM_VIRTIO=y
# CONFIG_HW_RANDOM_CCTRNG is not set
# CONFIG_HW_RANDOM_XIPHERA is not set
# CONFIG_DEVMEM is not set
CONFIG_NVRAM=y
# CONFIG_DEVPORT is not set
CONFIG_HPET=y
CONFIG_HPET_MMAP=y
CONFIG_HPET_MMAP_DEFAULT=y
# CONFIG_HANGCHECK_TIMER is not set
CONFIG_TCG_TPM=y
# CONFIG_TCG_TPM2_HMAC is not set
# CONFIG_HW_RANDOM_TPM is not set
CONFIG_TCG_TIS_CORE=y
CONFIG_TCG_TIS=y
# CONFIG_TCG_TIS_SPI is not set
# CONFIG_TCG_TIS_I2C is not set
# CONFIG_TCG_TIS_I2C_CR50 is not set
# CONFIG_TCG_TIS_I2C_ATMEL is not set
# CONFIG_TCG_TIS_I2C_INFINEON is not set
# CONFIG_TCG_TIS_I2C_NUVOTON is not set
# CONFIG_TCG_NSC is not set
# CONFIG_TCG_ATMEL is not set
# CONFIG_TCG_INFINEON is not set
CONFIG_TCG_CRB=y
# CONFIG_TCG_VTPM_PROXY is not set
# CONFIG_TCG_TIS_ST33ZP24_I2C is not set
# CONFIG_TCG_TIS_ST33ZP24_SPI is not set
# CONFIG_TELCLOCK is not set
CONFIG_XILLYBUS_CLASS=y
# CONFIG_XILLYBUS is not set
CONFIG_XILLYUSB=y
# end of Character devices

#
# I2C support
#
CONFIG_I2C=y
CONFIG_ACPI_I2C_OPREGION=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX=y

#
# Multiplexer I2C Chip support
#
# CONFIG_I2C_ARB_GPIO_CHALLENGE is not set
# CONFIG_I2C_MUX_GPIO is not set
# CONFIG_I2C_MUX_GPMUX is not set
# CONFIG_I2C_MUX_LTC4306 is not set
# CONFIG_I2C_MUX_PCA9541 is not set
# CONFIG_I2C_MUX_PCA954x is not set
CONFIG_I2C_MUX_REG=y
# CONFIG_I2C_MUX_MLXCPLD is not set
# end of Multiplexer I2C Chip support

CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_SMBUS=y
CONFIG_I2C_ALGOBIT=y

#
# I2C Hardware Bus support
#

#
# PC SMBus host controller drivers
#
# CONFIG_I2C_ALI1535 is not set
# CONFIG_I2C_ALI1563 is not set
# CONFIG_I2C_ALI15X3 is not set
# CONFIG_I2C_AMD756 is not set
# CONFIG_I2C_AMD8111 is not set
# CONFIG_I2C_AMD_MP2 is not set
CONFIG_I2C_I801=y
# CONFIG_I2C_ISCH is not set
# CONFIG_I2C_ISMT is not set
# CONFIG_I2C_PIIX4 is not set
# CONFIG_I2C_CHT_WC is not set
# CONFIG_I2C_NFORCE2 is not set
# CONFIG_I2C_NVIDIA_GPU is not set
# CONFIG_I2C_SIS5595 is not set
# CONFIG_I2C_SIS630 is not set
# CONFIG_I2C_SIS96X is not set
# CONFIG_I2C_VIA is not set
# CONFIG_I2C_VIAPRO is not set
# CONFIG_I2C_ZHAOXIN is not set

#
# ACPI drivers
#
# CONFIG_I2C_SCMI is not set

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
# CONFIG_I2C_CBUS_GPIO is not set
CONFIG_I2C_DESIGNWARE_CORE=y
CONFIG_I2C_DESIGNWARE_PLATFORM=y
# CONFIG_I2C_DESIGNWARE_BAYTRAIL is not set
# CONFIG_I2C_DESIGNWARE_PCI is not set
# CONFIG_I2C_EMEV2 is not set
# CONFIG_I2C_GPIO is not set
# CONFIG_I2C_OCORES is not set
# CONFIG_I2C_PCA_PLATFORM is not set
# CONFIG_I2C_RK3X is not set
# CONFIG_I2C_SIMTEC is not set
# CONFIG_I2C_XILINX is not set

#
# External I2C/SMBus adapter drivers
#
CONFIG_I2C_DIOLAN_U2C=y
CONFIG_I2C_DLN2=y
CONFIG_I2C_LJCA=y
CONFIG_I2C_CP2615=y
# CONFIG_I2C_PARPORT is not set
# CONFIG_I2C_PCI1XXXX is not set
CONFIG_I2C_ROBOTFUZZ_OSIF=y
# CONFIG_I2C_TAOS_EVM is not set
CONFIG_I2C_TINY_USB=y
CONFIG_I2C_VIPERBOARD=y

#
# Other I2C/SMBus bus drivers
#
# CONFIG_I2C_MLXCPLD is not set
# CONFIG_I2C_VIRTIO is not set
# end of I2C Hardware Bus support

# CONFIG_I2C_STUB is not set
CONFIG_I2C_SLAVE=y
CONFIG_I2C_SLAVE_EEPROM=y
# CONFIG_I2C_SLAVE_TESTUNIT is not set
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
# end of I2C support

# CONFIG_I3C is not set
CONFIG_I3C_OR_I2C=y
CONFIG_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y
# CONFIG_SPI_MEM is not set

#
# SPI Master Controller Drivers
#
# CONFIG_SPI_ALTERA is not set
# CONFIG_SPI_AXI_SPI_ENGINE is not set
# CONFIG_SPI_BITBANG is not set
# CONFIG_SPI_BUTTERFLY is not set
# CONFIG_SPI_CADENCE is not set
# CONFIG_SPI_CADENCE_QUADSPI is not set
# CONFIG_SPI_CH341 is not set
# CONFIG_SPI_DESIGNWARE is not set
CONFIG_SPI_DLN2=y
# CONFIG_SPI_GPIO is not set
# CONFIG_SPI_LM70_LLP is not set
# CONFIG_SPI_FSL_SPI is not set
CONFIG_SPI_LJCA=y
# CONFIG_SPI_MICROCHIP_CORE_QSPI is not set
# CONFIG_SPI_MICROCHIP_CORE_SPI is not set
# CONFIG_SPI_LANTIQ_SSC is not set
# CONFIG_SPI_OC_TINY is not set
# CONFIG_SPI_PCI1XXXX is not set
# CONFIG_SPI_PXA2XX is not set
# CONFIG_SPI_SC18IS602 is not set
# CONFIG_SPI_SIFIVE is not set
# CONFIG_SPI_MXIC is not set
# CONFIG_SPI_VIRTIO is not set
# CONFIG_SPI_XCOMM is not set
# CONFIG_SPI_XILINX is not set

#
# SPI Multiplexer support
#
# CONFIG_SPI_MUX is not set

#
# SPI Protocol Masters
#
# CONFIG_SPI_SPIDEV is not set
# CONFIG_SPI_LOOPBACK_TEST is not set
# CONFIG_SPI_TLE62X0 is not set
# CONFIG_SPI_SLAVE is not set
CONFIG_SPI_DYNAMIC=y
# CONFIG_SPMI is not set
# CONFIG_HSI is not set
CONFIG_PPS=y
# CONFIG_PPS_DEBUG is not set

#
# PPS clients support
#
# CONFIG_PPS_CLIENT_KTIMER is not set
# CONFIG_PPS_CLIENT_LDISC is not set
# CONFIG_PPS_CLIENT_PARPORT is not set
# CONFIG_PPS_CLIENT_GPIO is not set
# CONFIG_PPS_GENERATOR is not set

#
# PTP clock support
#
CONFIG_PTP_1588_CLOCK=y
CONFIG_PTP_1588_CLOCK_OPTIONAL=y

#
# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
#
CONFIG_PTP_1588_CLOCK_KVM=y
CONFIG_PTP_1588_CLOCK_VMCLOCK=y
# CONFIG_PTP_1588_CLOCK_IDT82P33 is not set
# CONFIG_PTP_1588_CLOCK_IDTCM is not set
# CONFIG_PTP_1588_CLOCK_FC3W is not set
# CONFIG_PTP_1588_CLOCK_MOCK is not set
# CONFIG_PTP_1588_CLOCK_VMW is not set
# CONFIG_PTP_1588_CLOCK_OCP is not set
# CONFIG_PTP_NETC_V4_TIMER is not set
# end of PTP clock support

#
# DPLL device support
#
# CONFIG_ZL3073X_I2C is not set
# CONFIG_ZL3073X_SPI is not set
# end of DPLL device support

# CONFIG_PINCTRL is not set
CONFIG_GPIOLIB_LEGACY=y
CONFIG_GPIOLIB=y
CONFIG_GPIOLIB_FASTPATH_LIMIT=512
CONFIG_OF_GPIO=y
CONFIG_GPIO_ACPI=y
CONFIG_GPIOLIB_IRQCHIP=y
# CONFIG_DEBUG_GPIO is not set
# CONFIG_GPIO_SYSFS is not set
# CONFIG_GPIO_CDEV is not set

#
# Memory mapped GPIO drivers
#
# CONFIG_GPIO_74XX_MMIO is not set
# CONFIG_GPIO_ALTERA is not set
# CONFIG_GPIO_AMDPT is not set
# CONFIG_GPIO_BY_PINCTRL is not set
# CONFIG_GPIO_CADENCE is not set
# CONFIG_GPIO_DWAPB is not set
# CONFIG_GPIO_FTGPIO010 is not set
# CONFIG_GPIO_GENERIC_PLATFORM is not set
# CONFIG_GPIO_GRANITERAPIDS is not set
# CONFIG_GPIO_GRGPIO is not set
# CONFIG_GPIO_HLWD is not set
# CONFIG_GPIO_ICH is not set
# CONFIG_GPIO_LOGICVC is not set
# CONFIG_GPIO_MB86S7X is not set
# CONFIG_GPIO_POLARFIRE_SOC is not set
# CONFIG_GPIO_SIFIVE is not set
# CONFIG_GPIO_SYSCON is not set
# CONFIG_GPIO_WAVESHARE_DSI_TOUCH is not set
# CONFIG_GPIO_XILINX is not set
# CONFIG_GPIO_AMD_FCH is not set
# end of Memory mapped GPIO drivers

#
# Port-mapped I/O GPIO drivers
#
# CONFIG_GPIO_VX855 is not set
# CONFIG_GPIO_F7188X is not set
# CONFIG_GPIO_IT87 is not set
# CONFIG_GPIO_NOVALAKE is not set
# CONFIG_GPIO_SCH311X is not set
# CONFIG_GPIO_WINBOND is not set
# CONFIG_GPIO_WS16C48 is not set
# end of Port-mapped I/O GPIO drivers

#
# I2C GPIO expanders
#
# CONFIG_GPIO_ADNP is not set
# CONFIG_GPIO_FXL6408 is not set
# CONFIG_GPIO_DS4520 is not set
# CONFIG_GPIO_GW_PLD is not set
# CONFIG_GPIO_MAX7300 is not set
# CONFIG_GPIO_MAX732X is not set
# CONFIG_GPIO_PCA953X is not set
# CONFIG_GPIO_PCA9570 is not set
# CONFIG_GPIO_PCF857X is not set
# CONFIG_GPIO_TPIC2810 is not set
# end of I2C GPIO expanders

#
# MFD GPIO expanders
#
CONFIG_GPIO_DLN2=y
CONFIG_GPIO_LJCA=y
# CONFIG_GPIO_TWL4030 is not set
# CONFIG_GPIO_WHISKEY_COVE is not set
# end of MFD GPIO expanders

#
# Auxiliary Bus GPIO drivers
#
# end of Auxiliary Bus GPIO drivers

#
# PCI GPIO expanders
#
# CONFIG_GPIO_AMD8111 is not set
# CONFIG_GPIO_BT8XX is not set
# CONFIG_GPIO_ML_IOH is not set
# CONFIG_GPIO_PCI_IDIO_16 is not set
# CONFIG_GPIO_PCIE_IDIO_24 is not set
# CONFIG_GPIO_RDC321X is not set
# CONFIG_GPIO_SODAVILLE is not set
# end of PCI GPIO expanders

#
# SPI GPIO expanders
#
# CONFIG_GPIO_74X164 is not set
# CONFIG_GPIO_MAX3191X is not set
# CONFIG_GPIO_MAX7301 is not set
# CONFIG_GPIO_MC33880 is not set
# CONFIG_GPIO_PISOSR is not set
# CONFIG_GPIO_XRA1403 is not set
# end of SPI GPIO expanders

#
# USB GPIO expanders
#
CONFIG_GPIO_VIPERBOARD=y
# CONFIG_GPIO_MPSSE is not set
# end of USB GPIO expanders

#
# Virtual GPIO drivers
#
# CONFIG_GPIO_AGGREGATOR is not set
# CONFIG_GPIO_LATCH is not set
# CONFIG_GPIO_LINE_MUX is not set
# CONFIG_GPIO_MOCKUP is not set
# CONFIG_GPIO_VIRTIO is not set
# CONFIG_GPIO_SIM is not set
# end of Virtual GPIO drivers

#
# GPIO Debugging utilities
#
# CONFIG_GPIO_SLOPPY_LOGIC_ANALYZER is not set
# CONFIG_GPIO_VIRTUSER is not set
# end of GPIO Debugging utilities

# CONFIG_W1 is not set
# CONFIG_POWER_RESET is not set
# CONFIG_POWER_SEQUENCING is not set
CONFIG_POWER_SUPPLY=y
# CONFIG_POWER_SUPPLY_DEBUG is not set
CONFIG_POWER_SUPPLY_HWMON=y
# CONFIG_GENERIC_ADC_BATTERY is not set
# CONFIG_IP5XXX_POWER is not set
# CONFIG_TEST_POWER is not set
# CONFIG_CHARGER_ADP5061 is not set
# CONFIG_BATTERY_CHAGALL is not set
# CONFIG_BATTERY_CW2015 is not set
# CONFIG_BATTERY_DS2780 is not set
# CONFIG_BATTERY_DS2781 is not set
# CONFIG_BATTERY_DS2782 is not set
# CONFIG_BATTERY_SAMSUNG_SDI is not set
# CONFIG_BATTERY_S2MU005 is not set
# CONFIG_BATTERY_SBS is not set
# CONFIG_CHARGER_SBS is not set
# CONFIG_MANAGER_SBS is not set
# CONFIG_BATTERY_BQ27XXX is not set
# CONFIG_BATTERY_MAX17040 is not set
# CONFIG_BATTERY_MAX17042 is not set
# CONFIG_BATTERY_MAX1720X is not set
CONFIG_CHARGER_ISP1704=y
# CONFIG_CHARGER_MAX8903 is not set
# CONFIG_CHARGER_TWL4030 is not set
# CONFIG_CHARGER_TWL6030 is not set
# CONFIG_CHARGER_LP8727 is not set
# CONFIG_CHARGER_GPIO is not set
# CONFIG_CHARGER_MANAGER is not set
# CONFIG_CHARGER_LT3651 is not set
# CONFIG_CHARGER_LTC4162L is not set
# CONFIG_CHARGER_DETECTOR_MAX14656 is not set
# CONFIG_CHARGER_MAX77976 is not set
# CONFIG_CHARGER_MAX8971 is not set
# CONFIG_CHARGER_MT6360 is not set
# CONFIG_CHARGER_MT6370 is not set
# CONFIG_CHARGER_BQ2415X is not set
CONFIG_CHARGER_BQ24190=y
# CONFIG_CHARGER_BQ24257 is not set
# CONFIG_CHARGER_BQ24735 is not set
# CONFIG_CHARGER_BQ2515X is not set
# CONFIG_CHARGER_BQ25890 is not set
# CONFIG_CHARGER_BQ25980 is not set
# CONFIG_CHARGER_BQ256XX is not set
# CONFIG_CHARGER_SMB347 is not set
# CONFIG_BATTERY_GAUGE_LTC2941 is not set
# CONFIG_BATTERY_GOLDFISH is not set
# CONFIG_BATTERY_RT5033 is not set
# CONFIG_CHARGER_RT9455 is not set
# CONFIG_CHARGER_RT9467 is not set
# CONFIG_CHARGER_RT9471 is not set
# CONFIG_CHARGER_RT9756 is not set
# CONFIG_FUEL_GAUGE_STC3117 is not set
# CONFIG_CHARGER_UCS1002 is not set
# CONFIG_CHARGER_BD99954 is not set
# CONFIG_BATTERY_SURFACE is not set
# CONFIG_CHARGER_SURFACE is not set
# CONFIG_BATTERY_UG3105 is not set
# CONFIG_BATTERY_CHARGER_SURFACE_RT is not set
# CONFIG_FUEL_GAUGE_MM8013 is not set
CONFIG_HWMON=y
# CONFIG_HWMON_DEBUG_CHIP is not set

#
# Native drivers
#
# CONFIG_SENSORS_ABITUGURU is not set
# CONFIG_SENSORS_ABITUGURU3 is not set
# CONFIG_SENSORS_AD7314 is not set
# CONFIG_SENSORS_AD7414 is not set
# CONFIG_SENSORS_AD7418 is not set
# CONFIG_SENSORS_ADM1025 is not set
# CONFIG_SENSORS_ADM1026 is not set
# CONFIG_SENSORS_ADM1029 is not set
# CONFIG_SENSORS_ADM1031 is not set
# CONFIG_SENSORS_ADM1177 is not set
# CONFIG_SENSORS_ADM9240 is not set
# CONFIG_SENSORS_ADT7310 is not set
# CONFIG_SENSORS_ADT7410 is not set
# CONFIG_SENSORS_ADT7411 is not set
# CONFIG_SENSORS_ADT7462 is not set
# CONFIG_SENSORS_ADT7470 is not set
# CONFIG_SENSORS_ADT7475 is not set
# CONFIG_SENSORS_AHT10 is not set
CONFIG_SENSORS_AQUACOMPUTER_D5NEXT=y
# CONFIG_SENSORS_AS370 is not set
# CONFIG_SENSORS_ASC7621 is not set
# CONFIG_SENSORS_ASUS_ROG_RYUJIN is not set
# CONFIG_SENSORS_AXI_FAN_CONTROL is not set
# CONFIG_SENSORS_K8TEMP is not set
# CONFIG_SENSORS_K10TEMP is not set
# CONFIG_SENSORS_KB9002 is not set
# CONFIG_SENSORS_FAM15H_POWER is not set
# CONFIG_SENSORS_APPLESMC is not set
# CONFIG_SENSORS_ARCTIC_FAN_CONTROLLER is not set
# CONFIG_SENSORS_ASB100 is not set
# CONFIG_SENSORS_ATXP1 is not set
# CONFIG_SENSORS_CHIPCAP2 is not set
CONFIG_SENSORS_CORSAIR_CPRO=y
CONFIG_SENSORS_CORSAIR_PSU=y
# CONFIG_SENSORS_DRIVETEMP is not set
# CONFIG_SENSORS_DS620 is not set
# CONFIG_SENSORS_DS1621 is not set
# CONFIG_SENSORS_DELL_SMM is not set
# CONFIG_SENSORS_I5K_AMB is not set
# CONFIG_SENSORS_F71805F is not set
# CONFIG_SENSORS_F71882FG is not set
# CONFIG_SENSORS_F75375S is not set
# CONFIG_SENSORS_FSCHMD is not set
# CONFIG_SENSORS_FTSTEUTATES is not set
CONFIG_SENSORS_GIGABYTE_WATERFORCE=y
# CONFIG_SENSORS_GL518SM is not set
# CONFIG_SENSORS_GL520SM is not set
# CONFIG_SENSORS_GPD is not set
# CONFIG_SENSORS_G760A is not set
# CONFIG_SENSORS_G762 is not set
# CONFIG_SENSORS_GPIO_FAN is not set
# CONFIG_SENSORS_HIH6130 is not set
# CONFIG_SENSORS_HS3001 is not set
# CONFIG_SENSORS_HTU31 is not set
# CONFIG_SENSORS_IIO_HWMON is not set
# CONFIG_SENSORS_I5500 is not set
# CONFIG_SENSORS_CORETEMP is not set
# CONFIG_SENSORS_ISL28022 is not set
# CONFIG_SENSORS_IT87 is not set
# CONFIG_SENSORS_JC42 is not set
CONFIG_SENSORS_POWERZ=y
# CONFIG_SENSORS_POWR1220 is not set
# CONFIG_SENSORS_PROM21_XHCI is not set
# CONFIG_SENSORS_LATTEPANDA_SIGMA_EC is not set
# CONFIG_SENSORS_LENOVO_EC is not set
# CONFIG_SENSORS_LINEAGE is not set
# CONFIG_SENSORS_LTC2945 is not set
# CONFIG_SENSORS_LTC2947_I2C is not set
# CONFIG_SENSORS_LTC2947_SPI is not set
# CONFIG_SENSORS_LTC2990 is not set
# CONFIG_SENSORS_LTC2991 is not set
# CONFIG_SENSORS_LTC2992 is not set
# CONFIG_SENSORS_LTC4151 is not set
# CONFIG_SENSORS_LTC4215 is not set
# CONFIG_SENSORS_LTC4222 is not set
# CONFIG_SENSORS_LTC4245 is not set
# CONFIG_SENSORS_LTC4260 is not set
# CONFIG_SENSORS_LTC4261 is not set
# CONFIG_SENSORS_LTC4282 is not set
# CONFIG_SENSORS_LTC4283 is not set
# CONFIG_SENSORS_MAX1111 is not set
# CONFIG_SENSORS_MAX127 is not set
# CONFIG_SENSORS_MAX16065 is not set
# CONFIG_SENSORS_MAX1619 is not set
# CONFIG_SENSORS_MAX1668 is not set
# CONFIG_SENSORS_MAX197 is not set
# CONFIG_SENSORS_MAX31722 is not set
# CONFIG_SENSORS_MAX31730 is not set
# CONFIG_SENSORS_MAX31760 is not set
# CONFIG_MAX31827 is not set
# CONFIG_SENSORS_MAX6620 is not set
# CONFIG_SENSORS_MAX6621 is not set
# CONFIG_SENSORS_MAX6639 is not set
# CONFIG_SENSORS_MAX6650 is not set
# CONFIG_SENSORS_MAX6697 is not set
# CONFIG_SENSORS_MAX31790 is not set
# CONFIG_SENSORS_MC34VR500 is not set
# CONFIG_SENSORS_MCP3021 is not set
# CONFIG_SENSORS_MCP9982 is not set
# CONFIG_SENSORS_TC654 is not set
# CONFIG_SENSORS_TPS23861 is not set
# CONFIG_SENSORS_MR75203 is not set
# CONFIG_SENSORS_ADCXX is not set
# CONFIG_SENSORS_LM63 is not set
# CONFIG_SENSORS_LM70 is not set
# CONFIG_SENSORS_LM73 is not set
# CONFIG_SENSORS_LM75 is not set
# CONFIG_SENSORS_LM77 is not set
# CONFIG_SENSORS_LM78 is not set
# CONFIG_SENSORS_LM80 is not set
# CONFIG_SENSORS_LM83 is not set
# CONFIG_SENSORS_LM85 is not set
# CONFIG_SENSORS_LM87 is not set
# CONFIG_SENSORS_LM90 is not set
# CONFIG_SENSORS_LM92 is not set
# CONFIG_SENSORS_LM93 is not set
# CONFIG_SENSORS_LM95234 is not set
# CONFIG_SENSORS_LM95241 is not set
# CONFIG_SENSORS_LM95245 is not set
# CONFIG_SENSORS_PC87360 is not set
# CONFIG_SENSORS_PC87427 is not set
# CONFIG_SENSORS_NTC_THERMISTOR is not set
# CONFIG_SENSORS_NCT6683 is not set
# CONFIG_SENSORS_NCT6775 is not set
# CONFIG_SENSORS_NCT6775_I2C is not set
# CONFIG_SENSORS_NCT7363 is not set
# CONFIG_SENSORS_NCT7802 is not set
# CONFIG_SENSORS_NCT7904 is not set
# CONFIG_SENSORS_NPCM7XX is not set
CONFIG_SENSORS_NZXT_KRAKEN2=y
# CONFIG_SENSORS_NZXT_KRAKEN3 is not set
CONFIG_SENSORS_NZXT_SMART2=y
# CONFIG_SENSORS_OCC_P8_I2C is not set
# CONFIG_SENSORS_PCF8591 is not set
# CONFIG_PMBUS is not set
# CONFIG_SENSORS_PT5161L is not set
# CONFIG_SENSORS_SBTSI is not set
# CONFIG_SENSORS_SHT15 is not set
# CONFIG_SENSORS_SHT21 is not set
# CONFIG_SENSORS_SHT3x is not set
# CONFIG_SENSORS_SHT4x is not set
# CONFIG_SENSORS_SHTC1 is not set
# CONFIG_SENSORS_SIS5595 is not set
# CONFIG_SENSORS_DME1737 is not set
# CONFIG_SENSORS_EMC1403 is not set
# CONFIG_SENSORS_EMC1812 is not set
# CONFIG_SENSORS_EMC2103 is not set
# CONFIG_SENSORS_EMC2305 is not set
# CONFIG_SENSORS_EMC6W201 is not set
# CONFIG_SENSORS_SMSC47M1 is not set
# CONFIG_SENSORS_SMSC47M192 is not set
# CONFIG_SENSORS_SMSC47B397 is not set
# CONFIG_SENSORS_SCH5627 is not set
# CONFIG_SENSORS_SCH5636 is not set
# CONFIG_SENSORS_STTS751 is not set
# CONFIG_SENSORS_SURFACE_FAN is not set
# CONFIG_SENSORS_SURFACE_TEMP is not set
# CONFIG_SENSORS_ADC128D818 is not set
# CONFIG_SENSORS_ADS7828 is not set
# CONFIG_SENSORS_ADS7871 is not set
# CONFIG_SENSORS_AMC6821 is not set
# CONFIG_SENSORS_INA209 is not set
# CONFIG_SENSORS_INA2XX is not set
# CONFIG_SENSORS_INA238 is not set
# CONFIG_SENSORS_INA3221 is not set
# CONFIG_SENSORS_SPD5118 is not set
# CONFIG_SENSORS_TC74 is not set
# CONFIG_SENSORS_THMC50 is not set
# CONFIG_SENSORS_TMP102 is not set
# CONFIG_SENSORS_TMP103 is not set
# CONFIG_SENSORS_TMP108 is not set
# CONFIG_SENSORS_TMP401 is not set
# CONFIG_SENSORS_TMP421 is not set
# CONFIG_SENSORS_TMP464 is not set
# CONFIG_SENSORS_TMP513 is not set
# CONFIG_SENSORS_TSC1641 is not set
# CONFIG_SENSORS_VIA_CPUTEMP is not set
# CONFIG_SENSORS_VIA686A is not set
# CONFIG_SENSORS_VT1211 is not set
# CONFIG_SENSORS_VT8231 is not set
# CONFIG_SENSORS_W83773G is not set
# CONFIG_SENSORS_W83781D is not set
# CONFIG_SENSORS_W83791D is not set
# CONFIG_SENSORS_W83792D is not set
# CONFIG_SENSORS_W83793 is not set
# CONFIG_SENSORS_W83795 is not set
# CONFIG_SENSORS_W83L785TS is not set
# CONFIG_SENSORS_W83L786NG is not set
# CONFIG_SENSORS_W83627HF is not set
# CONFIG_SENSORS_W83627EHF is not set
# CONFIG_SENSORS_XGENE is not set
# CONFIG_SENSORS_YOGAFAN is not set

#
# ACPI drivers
#
# CONFIG_SENSORS_ACPI_POWER is not set
# CONFIG_SENSORS_ATK0110 is not set
# CONFIG_SENSORS_ASUS_WMI is not set
# CONFIG_SENSORS_ASUS_EC is not set
# CONFIG_SENSORS_HP_WMI is not set
CONFIG_THERMAL=y
CONFIG_THERMAL_NETLINK=y
# CONFIG_THERMAL_STATISTICS is not set
# CONFIG_THERMAL_DEBUGFS is not set
# CONFIG_THERMAL_CORE_TESTING is not set
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
CONFIG_THERMAL_HWMON=y
# CONFIG_THERMAL_OF is not set
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
# CONFIG_THERMAL_GOV_FAIR_SHARE is not set
CONFIG_THERMAL_GOV_STEP_WISE=y
# CONFIG_THERMAL_GOV_BANG_BANG is not set
# CONFIG_THERMAL_GOV_USER_SPACE is not set
# CONFIG_PCIE_THERMAL is not set
# CONFIG_THERMAL_EMULATION is not set
# CONFIG_THERMAL_MMIO is not set

#
# Intel thermal drivers
#
# CONFIG_INTEL_POWERCLAMP is not set
CONFIG_X86_THERMAL_VECTOR=y
# CONFIG_X86_PKG_TEMP_THERMAL is not set
# CONFIG_INTEL_SOC_DTS_THERMAL is not set

#
# ACPI INT340X thermal drivers
#
# CONFIG_INT340X_THERMAL is not set
# end of ACPI INT340X thermal drivers

# CONFIG_INTEL_BXT_PMIC_THERMAL is not set
# CONFIG_INTEL_PCH_THERMAL is not set
# CONFIG_INTEL_TCC_COOLING is not set
# CONFIG_INTEL_HFI_THERMAL is not set
# end of Intel thermal drivers

# CONFIG_GENERIC_ADC_THERMAL is not set
CONFIG_WATCHDOG=y
# CONFIG_WATCHDOG_CORE is not set
# CONFIG_WATCHDOG_NOWAYOUT is not set
CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y
CONFIG_WATCHDOG_OPEN_TIMEOUT=0
# CONFIG_WATCHDOG_SYSFS is not set
# CONFIG_WATCHDOG_HRTIMER_PRETIMEOUT is not set

#
# Watchdog Pretimeout Governors
#

#
# Watchdog Device Drivers
#
# CONFIG_SOFT_WATCHDOG is not set
# CONFIG_GPIO_WATCHDOG is not set
# CONFIG_LENOVO_SE10_WDT is not set
# CONFIG_LENOVO_SE30_WDT is not set
# CONFIG_LENOVO_SE30G2_SE60_WDT is not set
# CONFIG_WDAT_WDT is not set
# CONFIG_XILINX_WATCHDOG is not set
# CONFIG_ZIIRAVE_WATCHDOG is not set
# CONFIG_CADENCE_WATCHDOG is not set
# CONFIG_DW_WATCHDOG is not set
# CONFIG_TWL4030_WATCHDOG is not set
# CONFIG_MAX63XX_WATCHDOG is not set
# CONFIG_RETU_WATCHDOG is not set
# CONFIG_ACQUIRE_WDT is not set
# CONFIG_ADVANTECH_WDT is not set
# CONFIG_ADVANTECH_EC_WDT is not set
# CONFIG_ALIM1535_WDT is not set
# CONFIG_ALIM7101_WDT is not set
# CONFIG_EBC_C384_WDT is not set
# CONFIG_EXAR_WDT is not set
# CONFIG_F71808E_WDT is not set
# CONFIG_SP5100_TCO is not set
# CONFIG_SBC_FITPC2_WATCHDOG is not set
# CONFIG_EUROTECH_WDT is not set
# CONFIG_IB700_WDT is not set
# CONFIG_IBMASR is not set
# CONFIG_WAFER_WDT is not set
# CONFIG_I6300ESB_WDT is not set
# CONFIG_IE6XX_WDT is not set
# CONFIG_INTEL_OC_WATCHDOG is not set
# CONFIG_ITCO_WDT is not set
# CONFIG_IT8712F_WDT is not set
# CONFIG_IT87_WDT is not set
# CONFIG_HP_WATCHDOG is not set
# CONFIG_SC1200_WDT is not set
# CONFIG_PC87413_WDT is not set
# CONFIG_NV_TCO is not set
# CONFIG_60XX_WDT is not set
# CONFIG_SMSC_SCH311X_WDT is not set
# CONFIG_SMSC37B787_WDT is not set
# CONFIG_TQMX86_WDT is not set
# CONFIG_VIA_WDT is not set
# CONFIG_W83627HF_WDT is not set
# CONFIG_W83877F_WDT is not set
# CONFIG_W83977F_WDT is not set
# CONFIG_SBC_EPX_C3_WATCHDOG is not set
# CONFIG_INTEL_MEI_WDT is not set
# CONFIG_NI903X_WDT is not set
# CONFIG_NIC7018_WDT is not set
# CONFIG_MEN_A21_WDT is not set

#
# PCI-based Watchdog Cards
#
# CONFIG_PCIPCWATCHDOG is not set
# CONFIG_WDTPCI is not set

#
# USB-based Watchdog Cards
#
CONFIG_USBPCWATCHDOG=y
CONFIG_SSB_POSSIBLE=y
CONFIG_SSB=y
CONFIG_SSB_PCIHOST_POSSIBLE=y
# CONFIG_SSB_PCIHOST is not set
CONFIG_SSB_PCMCIAHOST_POSSIBLE=y
# CONFIG_SSB_PCMCIAHOST is not set
CONFIG_SSB_SDIOHOST_POSSIBLE=y
# CONFIG_SSB_SDIOHOST is not set
# CONFIG_SSB_DRIVER_GPIO is not set
CONFIG_BCMA_POSSIBLE=y
CONFIG_BCMA=y
CONFIG_BCMA_HOST_PCI_POSSIBLE=y
# CONFIG_BCMA_HOST_PCI is not set
# CONFIG_BCMA_HOST_SOC is not set
# CONFIG_BCMA_DRIVER_PCI is not set
# CONFIG_BCMA_DRIVER_GMAC_CMN is not set
# CONFIG_BCMA_DRIVER_GPIO is not set
# CONFIG_BCMA_DEBUG is not set

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
# CONFIG_MFD_ADP5585 is not set
# CONFIG_MFD_ACT8945A is not set
# CONFIG_MFD_AS3711 is not set
# CONFIG_MFD_SMPRO is not set
# CONFIG_MFD_AS3722 is not set
# CONFIG_PMIC_ADP5520 is not set
# CONFIG_MFD_AAT2870_CORE is not set
# CONFIG_MFD_ATMEL_FLEXCOM is not set
# CONFIG_MFD_ATMEL_HLCDC is not set
# CONFIG_MFD_BCM590XX is not set
# CONFIG_MFD_BD9571MWV is not set
# CONFIG_MFD_AXP20X_I2C is not set
# CONFIG_MFD_CGBC is not set
# CONFIG_MFD_CS40L50_I2C is not set
# CONFIG_MFD_CS40L50_SPI is not set
# CONFIG_MFD_CS42L43_I2C is not set
# CONFIG_MFD_CS42L43_SDW is not set
# CONFIG_MFD_LOCHNAGAR is not set
# CONFIG_MFD_MADERA is not set
# CONFIG_PMIC_DA903X is not set
# CONFIG_MFD_DA9052_SPI is not set
# CONFIG_MFD_DA9052_I2C is not set
# CONFIG_MFD_DA9055 is not set
# CONFIG_MFD_DA9062 is not set
# CONFIG_MFD_DA9063 is not set
# CONFIG_MFD_DA9150 is not set
CONFIG_MFD_DLN2=y
# CONFIG_MFD_GATEWORKS_GSC is not set
# CONFIG_MFD_MC13XXX_SPI is not set
# CONFIG_MFD_MC13XXX_I2C is not set
# CONFIG_MFD_MP2629 is not set
# CONFIG_MFD_PF1550 is not set
# CONFIG_MFD_HI6421_PMIC is not set
# CONFIG_MFD_INTEL_QUARK_I2C_GPIO is not set
CONFIG_LPC_ICH=y
# CONFIG_LPC_SCH is not set
# CONFIG_INTEL_SOC_PMIC is not set
CONFIG_INTEL_SOC_PMIC_BXTWC=y
CONFIG_INTEL_SOC_PMIC_CHTWC=y
# CONFIG_INTEL_SOC_PMIC_CHTDC_TI is not set
# CONFIG_MFD_INTEL_LPSS_ACPI is not set
# CONFIG_MFD_INTEL_LPSS_PCI is not set
CONFIG_MFD_INTEL_PMC_BXT=y
# CONFIG_MFD_IQS62X is not set
# CONFIG_MFD_JANZ_CMODIO is not set
# CONFIG_MFD_KEMPLD is not set
# CONFIG_MFD_88PM800 is not set
# CONFIG_MFD_88PM805 is not set
# CONFIG_MFD_88PM860X is not set
# CONFIG_MFD_88PM886_PMIC is not set
# CONFIG_MFD_MAX5970 is not set
# CONFIG_MFD_MAX14577 is not set
# CONFIG_MFD_MAX77541 is not set
# CONFIG_MFD_MAX77620 is not set
# CONFIG_MFD_MAX77650 is not set
# CONFIG_MFD_MAX77686 is not set
# CONFIG_MFD_MAX77693 is not set
# CONFIG_MFD_MAX77705 is not set
# CONFIG_MFD_MAX77714 is not set
# CONFIG_MFD_MAX77759 is not set
# CONFIG_MFD_MAX77843 is not set
# CONFIG_MFD_MAX8907 is not set
# CONFIG_MFD_MAX8925 is not set
# CONFIG_MFD_MAX8997 is not set
# CONFIG_MFD_MAX8998 is not set
CONFIG_MFD_MT6360=y
CONFIG_MFD_MT6370=y
# CONFIG_MFD_MT6397 is not set
# CONFIG_MFD_MENF21BMC is not set
# CONFIG_MFD_NCT6694 is not set
# CONFIG_MFD_OCELOT is not set
# CONFIG_MFD_CPCAP is not set
CONFIG_MFD_VIPERBOARD=y
# CONFIG_MFD_NTXEC is not set
CONFIG_MFD_RETU=y
# CONFIG_MFD_SY7636A is not set
# CONFIG_MFD_RDC321X is not set
# CONFIG_MFD_RT4831 is not set
# CONFIG_MFD_RT5033 is not set
# CONFIG_MFD_RT5120 is not set
# CONFIG_MFD_RC5T583 is not set
# CONFIG_MFD_RK8XX_I2C is not set
# CONFIG_MFD_RK8XX_SPI is not set
# CONFIG_MFD_RN5T618 is not set
# CONFIG_MFD_SEC_I2C is not set
# CONFIG_MFD_SI476X_CORE is not set
# CONFIG_MFD_SM501 is not set
# CONFIG_MFD_SKY81452 is not set
# CONFIG_MFD_STMPE is not set
CONFIG_MFD_SYSCON=y
# CONFIG_MFD_LP3943 is not set
# CONFIG_MFD_LP8788 is not set
# CONFIG_MFD_TI_LMU is not set
# CONFIG_MFD_BQ257XX is not set
# CONFIG_MFD_PALMAS is not set
# CONFIG_TPS6105X is not set
# CONFIG_TPS65010 is not set
# CONFIG_TPS6507X is not set
# CONFIG_MFD_TPS65086 is not set
# CONFIG_MFD_TPS65090 is not set
# CONFIG_MFD_TPS65217 is not set
# CONFIG_MFD_TI_LP873X is not set
# CONFIG_MFD_TI_LP87565 is not set
# CONFIG_MFD_TPS65218 is not set
# CONFIG_MFD_TPS65219 is not set
# CONFIG_MFD_TPS6586X is not set
# CONFIG_MFD_TPS65910 is not set
# CONFIG_MFD_TPS65912_I2C is not set
# CONFIG_MFD_TPS65912_SPI is not set
# CONFIG_MFD_TPS6594_I2C is not set
# CONFIG_MFD_TPS6594_SPI is not set
CONFIG_TWL4030_CORE=y
# CONFIG_MFD_TWL4030_AUDIO is not set
# CONFIG_TWL6040_CORE is not set
# CONFIG_MFD_LM3533 is not set
# CONFIG_MFD_TC3589X is not set
# CONFIG_MFD_TQMX86 is not set
# CONFIG_MFD_VX855 is not set
# CONFIG_MFD_ARIZONA_I2C is not set
# CONFIG_MFD_ARIZONA_SPI is not set
# CONFIG_MFD_WM8400 is not set
# CONFIG_MFD_WM831X_I2C is not set
# CONFIG_MFD_WM831X_SPI is not set
# CONFIG_MFD_WM8350_I2C is not set
# CONFIG_MFD_WM8994 is not set
# CONFIG_MFD_ROHM_BD718XX is not set
# CONFIG_MFD_ROHM_BD71828 is not set
# CONFIG_MFD_ROHM_BD957XMUF is not set
# CONFIG_MFD_ROHM_BD96801 is not set
# CONFIG_MFD_STPMIC1 is not set
# CONFIG_MFD_STMFX is not set
# CONFIG_MFD_ATC260X_I2C is not set
# CONFIG_MFD_QCOM_PM8008 is not set
# CONFIG_RAVE_SP_CORE is not set
# CONFIG_MFD_INTEL_M10_BMC_SPI is not set
# CONFIG_MFD_QNAP_MCU is not set
# CONFIG_MFD_RSMU_I2C is not set
# CONFIG_MFD_RSMU_SPI is not set
# CONFIG_MFD_UPBOARD_FPGA is not set
# CONFIG_MFD_MAX7360 is not set
# end of Multifunction device drivers

CONFIG_REGULATOR=y
# CONFIG_REGULATOR_DEBUG is not set
CONFIG_REGULATOR_FIXED_VOLTAGE=y
# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
# CONFIG_REGULATOR_NETLINK_EVENTS is not set
# CONFIG_REGULATOR_88PG86X is not set
# CONFIG_REGULATOR_ACT8865 is not set
# CONFIG_REGULATOR_AD5398 is not set
# CONFIG_REGULATOR_ADP5055 is not set
# CONFIG_REGULATOR_AW37503 is not set
# CONFIG_REGULATOR_DA9121 is not set
# CONFIG_REGULATOR_DA9210 is not set
# CONFIG_REGULATOR_DA9211 is not set
# CONFIG_REGULATOR_FAN53555 is not set
# CONFIG_REGULATOR_FAN53880 is not set
# CONFIG_REGULATOR_GPIO is not set
# CONFIG_REGULATOR_ISL9305 is not set
# CONFIG_REGULATOR_ISL6271A is not set
# CONFIG_REGULATOR_FP9931 is not set
# CONFIG_REGULATOR_LP3971 is not set
# CONFIG_REGULATOR_LP3972 is not set
# CONFIG_REGULATOR_LP872X is not set
# CONFIG_REGULATOR_LP8755 is not set
# CONFIG_REGULATOR_LTC3589 is not set
# CONFIG_REGULATOR_LTC3676 is not set
# CONFIG_REGULATOR_MAX1586 is not set
# CONFIG_REGULATOR_MAX77503 is not set
# CONFIG_REGULATOR_MAX77675 is not set
# CONFIG_REGULATOR_MAX77857 is not set
# CONFIG_REGULATOR_MAX8649 is not set
# CONFIG_REGULATOR_MAX8660 is not set
# CONFIG_REGULATOR_MAX8893 is not set
# CONFIG_REGULATOR_MAX8952 is not set
# CONFIG_REGULATOR_MAX20086 is not set
# CONFIG_REGULATOR_MAX20411 is not set
# CONFIG_REGULATOR_MAX77826 is not set
# CONFIG_REGULATOR_MAX77838 is not set
# CONFIG_REGULATOR_MCP16502 is not set
# CONFIG_REGULATOR_MP5416 is not set
# CONFIG_REGULATOR_MP8859 is not set
# CONFIG_REGULATOR_MP886X is not set
# CONFIG_REGULATOR_MPQ7920 is not set
# CONFIG_REGULATOR_MT6311 is not set
# CONFIG_REGULATOR_MT6360 is not set
# CONFIG_REGULATOR_MT6370 is not set
# CONFIG_REGULATOR_PCA9450 is not set
# CONFIG_REGULATOR_PF9453 is not set
# CONFIG_REGULATOR_PF0900 is not set
# CONFIG_REGULATOR_PF530X is not set
# CONFIG_REGULATOR_PF8X00 is not set
# CONFIG_REGULATOR_PFUZE100 is not set
# CONFIG_REGULATOR_PV88060 is not set
# CONFIG_REGULATOR_PV88080 is not set
# CONFIG_REGULATOR_PV88090 is not set
# CONFIG_REGULATOR_RAA215300 is not set
# CONFIG_REGULATOR_RT4801 is not set
# CONFIG_REGULATOR_RT4803 is not set
# CONFIG_REGULATOR_RT5133 is not set
# CONFIG_REGULATOR_RT5190A is not set
# CONFIG_REGULATOR_RT5739 is not set
# CONFIG_REGULATOR_RT5759 is not set
# CONFIG_REGULATOR_RT6160 is not set
# CONFIG_REGULATOR_RT6190 is not set
# CONFIG_REGULATOR_RT6245 is not set
# CONFIG_REGULATOR_RT8092 is not set
# CONFIG_REGULATOR_RTQ2134 is not set
# CONFIG_REGULATOR_RTMV20 is not set
# CONFIG_REGULATOR_RTQ6752 is not set
# CONFIG_REGULATOR_RTQ2208 is not set
# CONFIG_REGULATOR_SGM3804 is not set
# CONFIG_REGULATOR_SLG51000 is not set
# CONFIG_REGULATOR_SY8106A is not set
# CONFIG_REGULATOR_SY8824X is not set
# CONFIG_REGULATOR_SY8827N is not set
# CONFIG_REGULATOR_TPS51632 is not set
# CONFIG_REGULATOR_TPS62360 is not set
# CONFIG_REGULATOR_TPS6286X is not set
# CONFIG_REGULATOR_TPS6287X is not set
# CONFIG_REGULATOR_TPS65023 is not set
# CONFIG_REGULATOR_TPS6507X is not set
# CONFIG_REGULATOR_TPS65132 is not set
# CONFIG_REGULATOR_TPS65185 is not set
# CONFIG_REGULATOR_TPS6524X is not set
CONFIG_REGULATOR_TWL4030=y
# CONFIG_REGULATOR_VCTRL is not set
CONFIG_RC_CORE=y
# CONFIG_LIRC is not set
# CONFIG_RC_MAP is not set
# CONFIG_RC_DECODERS is not set
CONFIG_RC_DEVICES=y
# CONFIG_IR_ENE is not set
# CONFIG_IR_FINTEK is not set
# CONFIG_IR_GPIO_CIR is not set
# CONFIG_IR_HIX5HD2 is not set
CONFIG_IR_IGORPLUGUSB=y
CONFIG_IR_IGUANA=y
CONFIG_IR_IMON=y
CONFIG_IR_IMON_RAW=y
# CONFIG_IR_ITE_CIR is not set
CONFIG_IR_MCEUSB=y
# CONFIG_IR_NUVOTON is not set
CONFIG_IR_REDRAT3=y
# CONFIG_IR_SERIAL is not set
CONFIG_IR_STREAMZAP=y
CONFIG_IR_TOY=y
CONFIG_IR_TTUSBIR=y
# CONFIG_IR_WINBOND_CIR is not set
CONFIG_RC_ATI_REMOTE=y
# CONFIG_RC_LOOPBACK is not set
CONFIG_RC_XBOX_DVD=y
CONFIG_CEC_CORE=y

#
# CEC support
#
# CONFIG_MEDIA_CEC_RC is not set
CONFIG_MEDIA_CEC_SUPPORT=y
# CONFIG_CEC_CH7322 is not set
# CONFIG_CEC_NXP_TDA9950 is not set
# CONFIG_CEC_GPIO is not set
# CONFIG_CEC_SECO is not set
# CONFIG_USB_EXTRON_DA_HD_4K_PLUS_CEC is not set
CONFIG_USB_PULSE8_CEC=y
CONFIG_USB_RAINSHADOW_CEC=y
# end of CEC support

CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_SUPPORT_FILTER=y
# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set

#
# Media device types
#
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
CONFIG_MEDIA_RADIO_SUPPORT=y
CONFIG_MEDIA_SDR_SUPPORT=y
CONFIG_MEDIA_PLATFORM_SUPPORT=y
CONFIG_MEDIA_TEST_SUPPORT=y
# end of Media device types

CONFIG_VIDEO_DEV=y
CONFIG_MEDIA_CONTROLLER=y
CONFIG_DVB_CORE=y

#
# Video4Linux options
#
CONFIG_VIDEO_V4L2_I2C=y
CONFIG_VIDEO_V4L2_SUBDEV_API=y
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
CONFIG_VIDEO_TUNER=y
CONFIG_V4L2_MEM2MEM_DEV=y
# end of Video4Linux options

#
# Media controller options
#
CONFIG_MEDIA_CONTROLLER_DVB=y
# end of Media controller options

#
# Digital TV options
#
# CONFIG_DVB_MMAP is not set
# CONFIG_DVB_NET is not set
CONFIG_DVB_MAX_ADAPTERS=16
# CONFIG_DVB_DYNAMIC_MINORS is not set
# CONFIG_DVB_DEMUX_SECTION_LOSS_LOG is not set
# CONFIG_DVB_ULE_DEBUG is not set
# end of Digital TV options

#
# Media drivers
#

#
# Drivers filtered as selected at 'Filter media drivers'
#

#
# Media drivers
#
CONFIG_MEDIA_USB_SUPPORT=y

#
# Webcam devices
#
CONFIG_USB_GSPCA=y
CONFIG_USB_GSPCA_BENQ=y
CONFIG_USB_GSPCA_CONEX=y
CONFIG_USB_GSPCA_CPIA1=y
CONFIG_USB_GSPCA_DTCS033=y
CONFIG_USB_GSPCA_ETOMS=y
CONFIG_USB_GSPCA_FINEPIX=y
CONFIG_USB_GSPCA_JEILINJ=y
CONFIG_USB_GSPCA_JL2005BCD=y
CONFIG_USB_GSPCA_KINECT=y
CONFIG_USB_GSPCA_KONICA=y
CONFIG_USB_GSPCA_MARS=y
CONFIG_USB_GSPCA_MR97310A=y
CONFIG_USB_GSPCA_NW80X=y
CONFIG_USB_GSPCA_OV519=y
CONFIG_USB_GSPCA_OV534=y
CONFIG_USB_GSPCA_OV534_9=y
CONFIG_USB_GSPCA_PAC207=y
CONFIG_USB_GSPCA_PAC7302=y
CONFIG_USB_GSPCA_PAC7311=y
CONFIG_USB_GSPCA_SE401=y
CONFIG_USB_GSPCA_SN9C2028=y
CONFIG_USB_GSPCA_SN9C20X=y
CONFIG_USB_GSPCA_SONIXB=y
CONFIG_USB_GSPCA_SONIXJ=y
CONFIG_USB_GSPCA_SPCA1528=y
CONFIG_USB_GSPCA_SPCA500=y
CONFIG_USB_GSPCA_SPCA501=y
CONFIG_USB_GSPCA_SPCA505=y
CONFIG_USB_GSPCA_SPCA506=y
CONFIG_USB_GSPCA_SPCA508=y
CONFIG_USB_GSPCA_SPCA561=y
CONFIG_USB_GSPCA_SQ905=y
CONFIG_USB_GSPCA_SQ905C=y
CONFIG_USB_GSPCA_SQ930X=y
CONFIG_USB_GSPCA_STK014=y
CONFIG_USB_GSPCA_STK1135=y
CONFIG_USB_GSPCA_STV0680=y
CONFIG_USB_GSPCA_SUNPLUS=y
CONFIG_USB_GSPCA_T613=y
CONFIG_USB_GSPCA_TOPRO=y
CONFIG_USB_GSPCA_TOUPTEK=y
CONFIG_USB_GSPCA_TV8532=y
CONFIG_USB_GSPCA_VC032X=y
CONFIG_USB_GSPCA_VICAM=y
CONFIG_USB_GSPCA_XIRLINK_CIT=y
CONFIG_USB_GSPCA_ZC3XX=y
CONFIG_USB_GL860=y
CONFIG_USB_M5602=y
CONFIG_USB_STV06XX=y
CONFIG_USB_PWC=y
# CONFIG_USB_PWC_DEBUG is not set
CONFIG_USB_PWC_INPUT_EVDEV=y
CONFIG_USB_S2255=y
CONFIG_VIDEO_USBTV=y
CONFIG_USB_VIDEO_CLASS=y
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y

#
# Analog TV USB devices
#
CONFIG_VIDEO_GO7007=y
CONFIG_VIDEO_GO7007_USB=y
CONFIG_VIDEO_GO7007_LOADER=y
CONFIG_VIDEO_GO7007_USB_S2250_BOARD=y
CONFIG_VIDEO_HDPVR=y
CONFIG_VIDEO_PVRUSB2=y
CONFIG_VIDEO_PVRUSB2_SYSFS=y
CONFIG_VIDEO_PVRUSB2_DVB=y
# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
CONFIG_VIDEO_STK1160=y

#
# Analog/digital TV USB devices
#
CONFIG_VIDEO_AU0828=y
CONFIG_VIDEO_AU0828_V4L2=y
CONFIG_VIDEO_AU0828_RC=y
CONFIG_VIDEO_CX231XX=y
CONFIG_VIDEO_CX231XX_RC=y
CONFIG_VIDEO_CX231XX_ALSA=y
CONFIG_VIDEO_CX231XX_DVB=y

#
# Digital TV USB devices
#
CONFIG_DVB_AS102=y
CONFIG_DVB_B2C2_FLEXCOP_USB=y
# CONFIG_DVB_B2C2_FLEXCOP_USB_DEBUG is not set
CONFIG_DVB_USB_V2=y
CONFIG_DVB_USB_AF9015=y
CONFIG_DVB_USB_AF9035=y
CONFIG_DVB_USB_ANYSEE=y
CONFIG_DVB_USB_AU6610=y
CONFIG_DVB_USB_AZ6007=y
CONFIG_DVB_USB_CE6230=y
CONFIG_DVB_USB_DVBSKY=y
CONFIG_DVB_USB_EC168=y
CONFIG_DVB_USB_GL861=y
CONFIG_DVB_USB_LME2510=y
CONFIG_DVB_USB_MXL111SF=y
CONFIG_DVB_USB_RTL28XXU=y
CONFIG_DVB_USB_ZD1301=y
CONFIG_DVB_USB=y
# CONFIG_DVB_USB_DEBUG is not set
CONFIG_DVB_USB_A800=y
CONFIG_DVB_USB_AF9005=y
CONFIG_DVB_USB_AF9005_REMOTE=y
CONFIG_DVB_USB_AZ6027=y
CONFIG_DVB_USB_CINERGY_T2=y
CONFIG_DVB_USB_CXUSB=y
CONFIG_DVB_USB_CXUSB_ANALOG=y
CONFIG_DVB_USB_DIB0700=y
CONFIG_DVB_USB_DIB3000MC=y
CONFIG_DVB_USB_DIBUSB_MB=y
# CONFIG_DVB_USB_DIBUSB_MB_FAULTY is not set
CONFIG_DVB_USB_DIBUSB_MC=y
CONFIG_DVB_USB_DIGITV=y
CONFIG_DVB_USB_DTT200U=y
CONFIG_DVB_USB_DTV5100=y
CONFIG_DVB_USB_DW2102=y
CONFIG_DVB_USB_GP8PSK=y
CONFIG_DVB_USB_M920X=y
CONFIG_DVB_USB_NOVA_T_USB2=y
CONFIG_DVB_USB_OPERA1=y
CONFIG_DVB_USB_PCTV452E=y
CONFIG_DVB_USB_TECHNISAT_USB2=y
CONFIG_DVB_USB_TTUSB2=y
CONFIG_DVB_USB_UMT_010=y
CONFIG_DVB_USB_VP702X=y
CONFIG_DVB_USB_VP7045=y
CONFIG_SMS_USB_DRV=y
CONFIG_DVB_TTUSB_BUDGET=y
CONFIG_DVB_TTUSB_DEC=y

#
# Webcam, TV (analog/digital) USB devices
#
CONFIG_VIDEO_EM28XX=y
CONFIG_VIDEO_EM28XX_V4L2=y
CONFIG_VIDEO_EM28XX_ALSA=y
CONFIG_VIDEO_EM28XX_DVB=y
CONFIG_VIDEO_EM28XX_RC=y

#
# Software defined radio USB devices
#
CONFIG_USB_AIRSPY=y
CONFIG_USB_HACKRF=y
CONFIG_USB_MSI2500=y
# CONFIG_MEDIA_PCI_SUPPORT is not set
CONFIG_RADIO_ADAPTERS=y
# CONFIG_RADIO_MAXIRADIO is not set
# CONFIG_RADIO_SAA7706H is not set
CONFIG_RADIO_SHARK=y
CONFIG_RADIO_SHARK2=y
CONFIG_RADIO_SI4713=y
CONFIG_RADIO_TEA575X=y
# CONFIG_RADIO_TEA5764 is not set
# CONFIG_RADIO_TEF6862 is not set
CONFIG_USB_DSBR=y
CONFIG_USB_KEENE=y
CONFIG_USB_MA901=y
CONFIG_USB_MR800=y
CONFIG_USB_RAREMONO=y
CONFIG_RADIO_SI470X=y
CONFIG_USB_SI470X=y
# CONFIG_I2C_SI470X is not set
CONFIG_USB_SI4713=y
# CONFIG_PLATFORM_SI4713 is not set
CONFIG_I2C_SI4713=y
# CONFIG_MEDIA_PLATFORM_DRIVERS is not set

#
# MMC/SDIO DVB adapters
#
CONFIG_SMS_SDIO_DRV=y
CONFIG_V4L_TEST_DRIVERS=y
CONFIG_VIDEO_VIM2M=y
CONFIG_VIDEO_VICODEC=y
CONFIG_VIDEO_VIMC=y
CONFIG_VIDEO_VIVID=y
CONFIG_VIDEO_VIVID_CEC=y
# CONFIG_VIDEO_VIVID_OSD is not set
CONFIG_VIDEO_VIVID_MAX_DEVS=64
# CONFIG_VIDEO_VISL is not set
CONFIG_DVB_TEST_DRIVERS=y
CONFIG_DVB_VIDTV=y

#
# FireWire (IEEE 1394) Adapters
#
# CONFIG_DVB_FIREDTV is not set
CONFIG_MEDIA_COMMON_OPTIONS=y

#
# common driver options
#
CONFIG_CYPRESS_FIRMWARE=y
CONFIG_TTPCI_EEPROM=y
CONFIG_UVC_COMMON=y
CONFIG_VIDEO_CX2341X=y
CONFIG_VIDEO_TVEEPROM=y
CONFIG_DVB_B2C2_FLEXCOP=y
CONFIG_SMS_SIANO_MDTV=y
CONFIG_SMS_SIANO_RC=y
CONFIG_SMS_SIANO_DEBUGFS=y
CONFIG_VIDEO_V4L2_TPG=y
CONFIG_VIDEOBUF2_CORE=y
CONFIG_VIDEOBUF2_V4L2=y
CONFIG_VIDEOBUF2_MEMOPS=y
CONFIG_VIDEOBUF2_DMA_CONTIG=y
CONFIG_VIDEOBUF2_VMALLOC=y
CONFIG_VIDEOBUF2_DMA_SG=y
# end of Media drivers

#
# Media ancillary drivers
#
CONFIG_MEDIA_ATTACH=y
# CONFIG_VIDEO_IR_I2C is not set
# CONFIG_VIDEO_CAMERA_SENSOR is not set

#
# Camera ISPs
#
# CONFIG_VIDEO_THP7312 is not set
# end of Camera ISPs

# CONFIG_VIDEO_CAMERA_LENS is not set

#
# Flash devices
#
# CONFIG_VIDEO_ADP1653 is not set
# CONFIG_VIDEO_LM3560 is not set
# CONFIG_VIDEO_LM3646 is not set
# end of Flash devices

#
# Audio decoders, processors and mixers
#
# CONFIG_VIDEO_CS3308 is not set
# CONFIG_VIDEO_CS5345 is not set
CONFIG_VIDEO_CS53L32A=y
CONFIG_VIDEO_MSP3400=y
# CONFIG_VIDEO_SONY_BTF_MPX is not set
# CONFIG_VIDEO_TDA1997X is not set
# CONFIG_VIDEO_TDA7432 is not set
# CONFIG_VIDEO_TDA9840 is not set
# CONFIG_VIDEO_TEA6415C is not set
# CONFIG_VIDEO_TEA6420 is not set
# CONFIG_VIDEO_TLV320AIC23B is not set
# CONFIG_VIDEO_TVAUDIO is not set
# CONFIG_VIDEO_UDA1342 is not set
# CONFIG_VIDEO_VP27SMPX is not set
# CONFIG_VIDEO_WM8739 is not set
CONFIG_VIDEO_WM8775=y
# end of Audio decoders, processors and mixers

#
# RDS decoders
#
# CONFIG_VIDEO_SAA6588 is not set
# end of RDS decoders

#
# Video decoders
#
# CONFIG_VIDEO_ADV7180 is not set
# CONFIG_VIDEO_ADV7183 is not set
# CONFIG_VIDEO_ADV748X is not set
# CONFIG_VIDEO_ADV7604 is not set
# CONFIG_VIDEO_ADV7842 is not set
# CONFIG_VIDEO_BT819 is not set
# CONFIG_VIDEO_BT856 is not set
# CONFIG_VIDEO_BT866 is not set
# CONFIG_VIDEO_ISL7998X is not set
# CONFIG_VIDEO_LT6911UXE is not set
# CONFIG_VIDEO_KS0127 is not set
# CONFIG_VIDEO_MAX9286 is not set
# CONFIG_VIDEO_ML86V7667 is not set
# CONFIG_VIDEO_SAA7110 is not set
CONFIG_VIDEO_SAA711X=y
# CONFIG_VIDEO_TC358743 is not set
# CONFIG_VIDEO_TC358746 is not set
# CONFIG_VIDEO_TVP514X is not set
# CONFIG_VIDEO_TVP5150 is not set
# CONFIG_VIDEO_TVP7002 is not set
# CONFIG_VIDEO_TW2804 is not set
# CONFIG_VIDEO_TW9900 is not set
# CONFIG_VIDEO_TW9903 is not set
# CONFIG_VIDEO_TW9906 is not set
# CONFIG_VIDEO_TW9910 is not set
# CONFIG_VIDEO_VPX3220 is not set

#
# Video and audio decoders
#
# CONFIG_VIDEO_SAA717X is not set
CONFIG_VIDEO_CX25840=y
# end of Video decoders

#
# Video encoders
#
# CONFIG_VIDEO_ADV7170 is not set
# CONFIG_VIDEO_ADV7175 is not set
# CONFIG_VIDEO_ADV7343 is not set
# CONFIG_VIDEO_ADV7393 is not set
# CONFIG_VIDEO_ADV7511 is not set
# CONFIG_VIDEO_AK881X is not set
# CONFIG_VIDEO_SAA7127 is not set
# CONFIG_VIDEO_SAA7185 is not set
# CONFIG_VIDEO_THS8200 is not set
# end of Video encoders

#
# Video improvement chips
#
# CONFIG_VIDEO_UPD64031A is not set
# CONFIG_VIDEO_UPD64083 is not set
# end of Video improvement chips

#
# Audio/Video compression chips
#
# CONFIG_VIDEO_SAA6752HS is not set
# end of Audio/Video compression chips

#
# SDR tuner chips
#
# CONFIG_SDR_MAX2175 is not set
# end of SDR tuner chips

#
# Miscellaneous helper chips
#
# CONFIG_VIDEO_INTEL_CVS is not set
# CONFIG_VIDEO_I2C is not set
# CONFIG_VIDEO_M52790 is not set
# CONFIG_VIDEO_ST_MIPID02 is not set
# CONFIG_VIDEO_THS7303 is not set
# end of Miscellaneous helper chips

#
# Video serializers and deserializers
#
# CONFIG_VIDEO_DS90UB913 is not set
# CONFIG_VIDEO_DS90UB953 is not set
# CONFIG_VIDEO_DS90UB960 is not set
# CONFIG_VIDEO_MAX96714 is not set
# CONFIG_VIDEO_MAX96717 is not set
# end of Video serializers and deserializers

#
# Media SPI Adapters
#
# CONFIG_CXD2880_SPI_DRV is not set
# CONFIG_VIDEO_GS1662 is not set
# end of Media SPI Adapters

CONFIG_MEDIA_TUNER=y

#
# Customize TV tuners
#
# CONFIG_MEDIA_TUNER_E4000 is not set
# CONFIG_MEDIA_TUNER_FC0011 is not set
# CONFIG_MEDIA_TUNER_FC0012 is not set
# CONFIG_MEDIA_TUNER_FC0013 is not set
# CONFIG_MEDIA_TUNER_FC2580 is not set
# CONFIG_MEDIA_TUNER_IT913X is not set
# CONFIG_MEDIA_TUNER_M88RS6000T is not set
# CONFIG_MEDIA_TUNER_MAX2165 is not set
# CONFIG_MEDIA_TUNER_MC44S803 is not set
CONFIG_MEDIA_TUNER_MSI001=y
# CONFIG_MEDIA_TUNER_MT2060 is not set
# CONFIG_MEDIA_TUNER_MT2063 is not set
# CONFIG_MEDIA_TUNER_MT20XX is not set
# CONFIG_MEDIA_TUNER_MT2131 is not set
# CONFIG_MEDIA_TUNER_MT2266 is not set
# CONFIG_MEDIA_TUNER_MXL301RF is not set
# CONFIG_MEDIA_TUNER_MXL5005S is not set
# CONFIG_MEDIA_TUNER_MXL5007T is not set
# CONFIG_MEDIA_TUNER_QM1D1B0004 is not set
# CONFIG_MEDIA_TUNER_QM1D1C0042 is not set
# CONFIG_MEDIA_TUNER_QT1010 is not set
# CONFIG_MEDIA_TUNER_R820T is not set
# CONFIG_MEDIA_TUNER_SI2157 is not set
# CONFIG_MEDIA_TUNER_SIMPLE is not set
# CONFIG_MEDIA_TUNER_TDA18212 is not set
# CONFIG_MEDIA_TUNER_TDA18218 is not set
# CONFIG_MEDIA_TUNER_TDA18250 is not set
# CONFIG_MEDIA_TUNER_TDA18271 is not set
# CONFIG_MEDIA_TUNER_TDA827X is not set
# CONFIG_MEDIA_TUNER_TDA8290 is not set
# CONFIG_MEDIA_TUNER_TDA9887 is not set
# CONFIG_MEDIA_TUNER_TEA5761 is not set
# CONFIG_MEDIA_TUNER_TEA5767 is not set
# CONFIG_MEDIA_TUNER_TUA9001 is not set
# CONFIG_MEDIA_TUNER_XC2028 is not set
# CONFIG_MEDIA_TUNER_XC4000 is not set
# CONFIG_MEDIA_TUNER_XC5000 is not set
# end of Customize TV tuners

#
# Customise DVB Frontends
#

#
# Multistandard (satellite) frontends
#
# CONFIG_DVB_M88DS3103 is not set
# CONFIG_DVB_MXL5XX is not set
# CONFIG_DVB_STB0899 is not set
# CONFIG_DVB_STB6100 is not set
# CONFIG_DVB_STV090x is not set
# CONFIG_DVB_STV0910 is not set
# CONFIG_DVB_STV6110x is not set
# CONFIG_DVB_STV6111 is not set

#
# Multistandard (cable + terrestrial) frontends
#
# CONFIG_DVB_DRXK is not set
# CONFIG_DVB_MN88472 is not set
# CONFIG_DVB_MN88473 is not set
# CONFIG_DVB_SI2165 is not set
# CONFIG_DVB_TDA18271C2DD is not set

#
# DVB-S (satellite) frontends
#
# CONFIG_DVB_CX24110 is not set
# CONFIG_DVB_CX24116 is not set
# CONFIG_DVB_CX24117 is not set
# CONFIG_DVB_CX24120 is not set
# CONFIG_DVB_CX24123 is not set
# CONFIG_DVB_DS3000 is not set
# CONFIG_DVB_MB86A16 is not set
# CONFIG_DVB_MT312 is not set
# CONFIG_DVB_S5H1420 is not set
# CONFIG_DVB_SI21XX is not set
# CONFIG_DVB_STB6000 is not set
# CONFIG_DVB_STV0288 is not set
# CONFIG_DVB_STV0299 is not set
# CONFIG_DVB_STV0900 is not set
# CONFIG_DVB_STV6110 is not set
# CONFIG_DVB_TDA10071 is not set
# CONFIG_DVB_TDA10086 is not set
# CONFIG_DVB_TDA8083 is not set
# CONFIG_DVB_TDA8261 is not set
# CONFIG_DVB_TDA826X is not set
# CONFIG_DVB_TS2020 is not set
# CONFIG_DVB_TUA6100 is not set
# CONFIG_DVB_TUNER_CX24113 is not set
# CONFIG_DVB_TUNER_ITD1000 is not set
# CONFIG_DVB_VES1X93 is not set
# CONFIG_DVB_ZL10036 is not set
# CONFIG_DVB_ZL10039 is not set

#
# DVB-T (terrestrial) frontends
#
CONFIG_DVB_AF9013=y
CONFIG_DVB_AS102_FE=y
# CONFIG_DVB_CX22700 is not set
# CONFIG_DVB_CX22702 is not set
# CONFIG_DVB_CXD2820R is not set
# CONFIG_DVB_CXD2841ER is not set
CONFIG_DVB_DIB3000MB=y
CONFIG_DVB_DIB3000MC=y
# CONFIG_DVB_DIB7000M is not set
# CONFIG_DVB_DIB7000P is not set
# CONFIG_DVB_DIB9000 is not set
# CONFIG_DVB_DRXD is not set
CONFIG_DVB_EC100=y
CONFIG_DVB_GP8PSK_FE=y
# CONFIG_DVB_L64781 is not set
# CONFIG_DVB_MT352 is not set
# CONFIG_DVB_NXT6000 is not set
CONFIG_DVB_RTL2830=y
CONFIG_DVB_RTL2832=y
CONFIG_DVB_RTL2832_SDR=y
# CONFIG_DVB_S5H1432 is not set
# CONFIG_DVB_SI2168 is not set
# CONFIG_DVB_SP887X is not set
# CONFIG_DVB_STV0367 is not set
# CONFIG_DVB_TDA10048 is not set
# CONFIG_DVB_TDA1004X is not set
# CONFIG_DVB_ZD1301_DEMOD is not set
CONFIG_DVB_ZL10353=y
# CONFIG_DVB_CXD2880 is not set

#
# DVB-C (cable) frontends
#
# CONFIG_DVB_STV0297 is not set
# CONFIG_DVB_TDA10021 is not set
# CONFIG_DVB_TDA10023 is not set
# CONFIG_DVB_VES1820 is not set

#
# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
#
# CONFIG_DVB_AU8522_DTV is not set
# CONFIG_DVB_AU8522_V4L is not set
# CONFIG_DVB_BCM3510 is not set
# CONFIG_DVB_LG2160 is not set
# CONFIG_DVB_LGDT3305 is not set
# CONFIG_DVB_LGDT3306A is not set
# CONFIG_DVB_LGDT330X is not set
# CONFIG_DVB_MXL692 is not set
# CONFIG_DVB_NXT200X is not set
# CONFIG_DVB_OR51132 is not set
# CONFIG_DVB_OR51211 is not set
# CONFIG_DVB_S5H1409 is not set
# CONFIG_DVB_S5H1411 is not set

#
# ISDB-T (terrestrial) frontends
#
# CONFIG_DVB_DIB8000 is not set
# CONFIG_DVB_MB86A20S is not set
# CONFIG_DVB_S921 is not set

#
# ISDB-S (satellite) & ISDB-T (terrestrial) frontends
#
# CONFIG_DVB_MN88443X is not set
# CONFIG_DVB_TC90522 is not set

#
# Digital terrestrial only tuners/PLL
#
# CONFIG_DVB_PLL is not set
# CONFIG_DVB_TUNER_DIB0070 is not set
# CONFIG_DVB_TUNER_DIB0090 is not set

#
# SEC control devices for DVB-S
#
# CONFIG_DVB_A8293 is not set
CONFIG_DVB_AF9033=y
# CONFIG_DVB_ASCOT2E is not set
# CONFIG_DVB_ATBM8830 is not set
# CONFIG_DVB_HELENE is not set
# CONFIG_DVB_HORUS3A is not set
# CONFIG_DVB_ISL6405 is not set
# CONFIG_DVB_ISL6421 is not set
# CONFIG_DVB_ISL6423 is not set
# CONFIG_DVB_IX2505V is not set
# CONFIG_DVB_LGS8GL5 is not set
# CONFIG_DVB_LGS8GXX is not set
# CONFIG_DVB_LNBH25 is not set
# CONFIG_DVB_LNBH29 is not set
# CONFIG_DVB_LNBP21 is not set
# CONFIG_DVB_LNBP22 is not set
# CONFIG_DVB_M88RS2000 is not set
# CONFIG_DVB_TDA665x is not set
# CONFIG_DVB_DRX39XYJ is not set

#
# Common Interface (EN50221) controller drivers
#
# CONFIG_DVB_CXD2099 is not set
# CONFIG_DVB_SP2 is not set
# end of Customise DVB Frontends

#
# Tools to develop new frontends
#
# CONFIG_DVB_DUMMY_FE is not set
# end of Media ancillary drivers

#
# Graphics support
#
CONFIG_APERTURE_HELPERS=y
CONFIG_SCREEN_INFO=y
CONFIG_VIDEO=y
# CONFIG_AUXDISPLAY is not set
# CONFIG_PANEL is not set
CONFIG_AGP=y
CONFIG_AGP_AMD64=y
CONFIG_AGP_INTEL=y
# CONFIG_AGP_SIS is not set
# CONFIG_AGP_VIA is not set
CONFIG_INTEL_GTT=y
# CONFIG_VGA_SWITCHEROO is not set
CONFIG_GPU_BUDDY=y
CONFIG_DRM=y

#
# DRM debugging options
#
# CONFIG_DRM_WERROR is not set
CONFIG_DRM_DEBUG_MM=y
# end of DRM debugging options

CONFIG_DRM_MIPI_DSI=y
CONFIG_DRM_KMS_HELPER=y
# CONFIG_DRM_PANIC is not set
# CONFIG_DRM_RAS is not set
# CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS is not set
# CONFIG_DRM_DEBUG_MODESET_LOCK is not set
CONFIG_DRM_CLIENT=y
CONFIG_DRM_CLIENT_LIB=y
CONFIG_DRM_CLIENT_SELECTION=y
CONFIG_DRM_CLIENT_SETUP=y

#
# Supported DRM clients
#
CONFIG_DRM_FBDEV_EMULATION=y
CONFIG_DRM_FBDEV_OVERALLOC=100
# CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM is not set
# CONFIG_DRM_CLIENT_LOG is not set
CONFIG_DRM_CLIENT_DEFAULT_FBDEV=y
CONFIG_DRM_CLIENT_DEFAULT="fbdev"
# end of Supported DRM clients

# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set
CONFIG_DRM_DISPLAY_DP_AUX_BUS=y
CONFIG_DRM_DISPLAY_HELPER=y
# CONFIG_DRM_DISPLAY_DP_AUX_CEC is not set
# CONFIG_DRM_DISPLAY_DP_AUX_CHARDEV is not set
CONFIG_DRM_DISPLAY_DP_HELPER=y
CONFIG_DRM_DISPLAY_DSC_HELPER=y
CONFIG_DRM_DISPLAY_HDCP_HELPER=y
CONFIG_DRM_DISPLAY_HDMI_HELPER=y
CONFIG_DRM_TTM=y
CONFIG_DRM_BUDDY=y
CONFIG_DRM_TTM_HELPER=y
CONFIG_DRM_GEM_SHMEM_HELPER=y
# CONFIG_DRM_AMDGPU is not set

#
# ARM devices
#
# CONFIG_DRM_KOMEDA is not set
# end of ARM devices

# CONFIG_DRM_AST is not set
CONFIG_DRM_BRIDGE=y
CONFIG_DRM_PANEL_BRIDGE=y
CONFIG_DRM_AUX_BRIDGE=y
CONFIG_DRM_AUX_HPD_BRIDGE=y

#
# Display Interface Bridges
#
# CONFIG_DRM_CHIPONE_ICN6211 is not set
# CONFIG_DRM_CHRONTEL_CH7033 is not set
# CONFIG_DRM_DISPLAY_CONNECTOR is not set
# CONFIG_DRM_I2C_NXP_TDA998X is not set
# CONFIG_DRM_ITE_IT6263 is not set
# CONFIG_DRM_ITE_IT6505 is not set
# CONFIG_DRM_LONTIUM_LT8912B is not set
# CONFIG_DRM_LONTIUM_LT9211 is not set
# CONFIG_DRM_LONTIUM_LT9611 is not set
# CONFIG_DRM_LONTIUM_LT9611UXC is not set
# CONFIG_DRM_LONTIUM_LT8713SX is not set
# CONFIG_DRM_ITE_IT66121 is not set
# CONFIG_DRM_LVDS_CODEC is not set
# CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW is not set
# CONFIG_DRM_NWL_MIPI_DSI is not set
# CONFIG_DRM_NXP_PTN3460 is not set
# CONFIG_DRM_PARADE_PS8622 is not set
# CONFIG_DRM_PARADE_PS8640 is not set
# CONFIG_DRM_SAMSUNG_DSIM is not set
# CONFIG_DRM_SIL_SII8620 is not set
# CONFIG_DRM_SII902X is not set
# CONFIG_DRM_SII9234 is not set
# CONFIG_DRM_SIMPLE_BRIDGE is not set
# CONFIG_DRM_SOLOMON_SSD2825 is not set
# CONFIG_DRM_THINE_THC63LVD1024 is not set
# CONFIG_DRM_TOSHIBA_TC358762 is not set
# CONFIG_DRM_TOSHIBA_TC358764 is not set
# CONFIG_DRM_TOSHIBA_TC358767 is not set
# CONFIG_DRM_TOSHIBA_TC358768 is not set
# CONFIG_DRM_TOSHIBA_TC358775 is not set
# CONFIG_DRM_TI_DLPC3433 is not set
# CONFIG_DRM_TI_TDP158 is not set
# CONFIG_DRM_TI_TFP410 is not set
# CONFIG_DRM_TI_SN65DSI83 is not set
# CONFIG_DRM_TI_SN65DSI86 is not set
# CONFIG_DRM_TI_TPD12S015 is not set
# CONFIG_DRM_WAVESHARE_BRIDGE is not set
# CONFIG_DRM_ANALOGIX_ANX6345 is not set
# CONFIG_DRM_ANALOGIX_ANX78XX is not set
# CONFIG_DRM_ANALOGIX_ANX7625 is not set
# CONFIG_DRM_I2C_ADV7511 is not set
# CONFIG_DRM_CDNS_DSI is not set
# CONFIG_DRM_CDNS_MHDP8546 is not set
# end of Display Interface Bridges

# CONFIG_DRM_ETNAVIV is not set
# CONFIG_DRM_GMA500 is not set
CONFIG_DRM_GUD=y
# CONFIG_DRM_HISI_HIBMC is not set
CONFIG_DRM_I915=y
CONFIG_DRM_I915_FORCE_PROBE=""
CONFIG_DRM_I915_CAPTURE_ERROR=y
CONFIG_DRM_I915_COMPRESS_ERROR=y
CONFIG_DRM_I915_USERPTR=y
# CONFIG_DRM_I915_GVT_KVMGT is not set
# CONFIG_DRM_I915_DP_TUNNEL is not set

#
# drm/i915 Debugging
#
# CONFIG_DRM_I915_WERROR is not set
# CONFIG_DRM_I915_REPLAY_GPU_HANGS_API is not set
# CONFIG_DRM_I915_DEBUG is not set
# CONFIG_DRM_I915_DEBUG_MMIO is not set
# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set
# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set
# CONFIG_DRM_I915_DEBUG_GUC is not set
# CONFIG_DRM_I915_SELFTEST is not set
# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set
# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set
# CONFIG_DRM_I915_DEBUG_RUNTIME_PM is not set
# CONFIG_DRM_I915_DEBUG_WAKEREF is not set
# end of drm/i915 Debugging

#
# drm/i915 Profile Guided Optimisation
#
CONFIG_DRM_I915_REQUEST_TIMEOUT=20000
CONFIG_DRM_I915_FENCE_TIMEOUT=10000
CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250
CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500
CONFIG_DRM_I915_PREEMPT_TIMEOUT=640
CONFIG_DRM_I915_PREEMPT_TIMEOUT_COMPUTE=7500
CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000
CONFIG_DRM_I915_STOP_TIMEOUT=100
CONFIG_DRM_I915_TIMESLICE_DURATION=1
# end of drm/i915 Profile Guided Optimisation

# CONFIG_DRM_LOGICVC is not set
# CONFIG_DRM_MGAG200 is not set
# CONFIG_DRM_NOUVEAU is not set
CONFIG_DRM_PANEL=y

#
# Display Panels
#
# CONFIG_DRM_PANEL_ABT_Y030XX067A is not set
# CONFIG_DRM_PANEL_ARM_VERSATILE is not set
# CONFIG_DRM_PANEL_ASUS_Z00T_TM5P5_NT35596 is not set
# CONFIG_DRM_PANEL_AUO_A030JTN01 is not set
# CONFIG_DRM_PANEL_BOE_BF060Y8M_AJ0 is not set
# CONFIG_DRM_PANEL_BOE_HIMAX8279D is not set
# CONFIG_DRM_PANEL_BOE_TD4320 is not set
# CONFIG_DRM_PANEL_BOE_TH101MB31UIG002_28A is not set
# CONFIG_DRM_PANEL_BOE_TV101WUM_NL6 is not set
# CONFIG_DRM_PANEL_BOE_TV101WUM_LL2 is not set
# CONFIG_DRM_PANEL_CHIPWEALTH_CH13726A is not set
# CONFIG_DRM_PANEL_EBBG_FT8719 is not set
# CONFIG_DRM_PANEL_ELIDA_KD35T133 is not set
# CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02 is not set
# CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D is not set
# CONFIG_DRM_PANEL_FOCALTECH_OTA7290B is not set
# CONFIG_DRM_PANEL_DSI_CM is not set
# CONFIG_DRM_PANEL_LVDS is not set
# CONFIG_DRM_PANEL_HIMAX_HX8279 is not set
# CONFIG_DRM_PANEL_HIMAX_HX83102 is not set
# CONFIG_DRM_PANEL_HIMAX_HX83112A is not set
# CONFIG_DRM_PANEL_HIMAX_HX83112B is not set
# CONFIG_DRM_PANEL_HIMAX_HX83121A is not set
# CONFIG_DRM_PANEL_HIMAX_HX8394 is not set
# CONFIG_DRM_PANEL_HYDIS_HV101HD1 is not set
# CONFIG_DRM_PANEL_ILITEK_IL9322 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9341 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9805 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9806E_DSI is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9806E_SPI is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9881C is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9882T is not set
# CONFIG_DRM_PANEL_INNOLUX_EJ030NA is not set
# CONFIG_DRM_PANEL_INNOLUX_P079ZCA is not set
# CONFIG_DRM_PANEL_JADARD_JD9365DA_H3 is not set
# CONFIG_DRM_PANEL_JDI_LPM102A188A is not set
# CONFIG_DRM_PANEL_JDI_LT070ME05000 is not set
# CONFIG_DRM_PANEL_JDI_R63452 is not set
# CONFIG_DRM_PANEL_KHADAS_TS050 is not set
# CONFIG_DRM_PANEL_KINGDISPLAY_KD097D04 is not set
# CONFIG_DRM_PANEL_LEADTEK_LTK050H3146W is not set
# CONFIG_DRM_PANEL_LEADTEK_LTK500HD1829 is not set
# CONFIG_DRM_PANEL_LINCOLNTECH_LCD197 is not set
# CONFIG_DRM_PANEL_LG_LB035Q02 is not set
# CONFIG_DRM_PANEL_LG_LD070WX3 is not set
# CONFIG_DRM_PANEL_LG_LG4573 is not set
# CONFIG_DRM_PANEL_LG_SW43408 is not set
# CONFIG_DRM_PANEL_LXD_M9189A is not set
# CONFIG_DRM_PANEL_MAGNACHIP_D53E6EA8966 is not set
# CONFIG_DRM_PANEL_MANTIX_MLAF057WE51 is not set
# CONFIG_DRM_PANEL_MOTOROLA_MOT is not set
# CONFIG_DRM_PANEL_NEC_NL8048HL11 is not set
# CONFIG_DRM_PANEL_NEWVISION_NV3051D is not set
# CONFIG_DRM_PANEL_NEWVISION_NV3052C is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35510 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35532 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35560 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35950 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT36523 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT36672A is not set
# CONFIG_DRM_PANEL_NOVATEK_NT36672E is not set
# CONFIG_DRM_PANEL_NOVATEK_NT37700F is not set
# CONFIG_DRM_PANEL_NOVATEK_NT37801 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT39016 is not set
# CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO is not set
# CONFIG_DRM_PANEL_ORISETECH_OTA5601A is not set
# CONFIG_DRM_PANEL_ORISETECH_OTM8009A is not set
# CONFIG_DRM_PANEL_OSD_OSD101T2587_53TS is not set
# CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00 is not set
# CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM67191 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM67200 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM68200 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM692E5 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM69380 is not set
# CONFIG_DRM_PANEL_RENESAS_R61307 is not set
# CONFIG_DRM_PANEL_RENESAS_R69328 is not set
# CONFIG_DRM_PANEL_RONBO_RB070D30 is not set
# CONFIG_DRM_PANEL_SAMSUNG_AMS581VF01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_AMS639RQ08 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS427AP24 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_ATNA33XC20 is not set
# CONFIG_DRM_PANEL_SAMSUNG_DB7430 is not set
# CONFIG_DRM_PANEL_SAMSUNG_LD9040 is not set
# CONFIG_DRM_PANEL_SAMSUNG_LTL106HL02 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E3FA7 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6D16D0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6D27A1 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6D7AA0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E3FC2X01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E3HA8 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E63M0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E8AA5X01_AMS561RA01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E8FC0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_SOFEF00 is not set
# CONFIG_DRM_PANEL_SEIKO_43WVF1G is not set
# CONFIG_DRM_PANEL_SHARP_LQ079L1SX01 is not set
# CONFIG_DRM_PANEL_SHARP_LQ101R1SX01 is not set
# CONFIG_DRM_PANEL_SHARP_LS037V7DW01 is not set
# CONFIG_DRM_PANEL_SHARP_LS043T1LE01 is not set
# CONFIG_DRM_PANEL_SHARP_LS060T1SX01 is not set
# CONFIG_DRM_PANEL_SITRONIX_ST7701 is not set
# CONFIG_DRM_PANEL_SITRONIX_ST7703 is not set
# CONFIG_DRM_PANEL_SITRONIX_ST7789V is not set
# CONFIG_DRM_PANEL_SONY_ACX565AKM is not set
# CONFIG_DRM_PANEL_SONY_TD4353_JDI is not set
# CONFIG_DRM_PANEL_SONY_TULIP_TRULY_NT35521 is not set
# CONFIG_DRM_PANEL_STARTEK_KD070FHFID015 is not set
CONFIG_DRM_PANEL_EDP=y
# CONFIG_DRM_PANEL_SIMPLE is not set
# CONFIG_DRM_PANEL_SUMMIT is not set
# CONFIG_DRM_PANEL_SYNAPTICS_R63353 is not set
# CONFIG_DRM_PANEL_SYNAPTICS_TDDI is not set
# CONFIG_DRM_PANEL_TDO_TL070WSH30 is not set
# CONFIG_DRM_PANEL_TPO_TD028TTEC1 is not set
# CONFIG_DRM_PANEL_TPO_TD043MTEA1 is not set
# CONFIG_DRM_PANEL_TPO_TPG110 is not set
# CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA is not set
# CONFIG_DRM_PANEL_VISIONOX_G2647FB105 is not set
# CONFIG_DRM_PANEL_VISIONOX_R66451 is not set
# CONFIG_DRM_PANEL_VISIONOX_RM69299 is not set
# CONFIG_DRM_PANEL_VISIONOX_RM692E5 is not set
# CONFIG_DRM_PANEL_VISIONOX_VTDR6130 is not set
# CONFIG_DRM_PANEL_WIDECHIPS_WS2401 is not set
# CONFIG_DRM_PANEL_XINPENG_XPP055C272 is not set
# end of Display Panels

# CONFIG_DRM_QXL is not set
# CONFIG_DRM_RADEON is not set
# CONFIG_DRM_ST7571 is not set
# CONFIG_DRM_ST7586 is not set
# CONFIG_DRM_ST7735R is not set
# CONFIG_DRM_ST7920 is not set
# CONFIG_DRM_SSD130X is not set

#
# Drivers for system framebuffers
#
CONFIG_DRM_SYSFB_HELPER=y
CONFIG_DRM_SIMPLEDRM=y
# CONFIG_DRM_VESADRM is not set
# end of Drivers for system framebuffers

# CONFIG_DRM_APPLETBDRM is not set
# CONFIG_DRM_ARCPGU is not set
CONFIG_DRM_BOCHS=y
CONFIG_DRM_CIRRUS_QEMU=y
CONFIG_DRM_GM12U320=y
# CONFIG_DRM_PANEL_MIPI_DBI is not set
# CONFIG_DRM_PIXPAPER is not set
# CONFIG_TINYDRM_HX8357D is not set
# CONFIG_TINYDRM_ILI9163 is not set
# CONFIG_TINYDRM_ILI9225 is not set
# CONFIG_TINYDRM_ILI9341 is not set
# CONFIG_TINYDRM_ILI9486 is not set
# CONFIG_TINYDRM_MI0283QT is not set
# CONFIG_TINYDRM_REPAPER is not set
# CONFIG_TINYDRM_SHARP_MEMORY is not set
CONFIG_DRM_UDL=y
# CONFIG_DRM_VBOXVIDEO is not set
CONFIG_DRM_VGEM=y
CONFIG_DRM_VIRTIO_GPU=y
CONFIG_DRM_VIRTIO_GPU_KMS=y
# CONFIG_DRM_VKMS is not set
CONFIG_DRM_VMWGFX=y
# CONFIG_DRM_VMWGFX_MKSSTATS is not set
# CONFIG_DRM_XE is not set
CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y

#
# Frame buffer Devices
#
CONFIG_FB=y
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_ARC is not set
# CONFIG_FB_ASILIANT is not set
# CONFIG_FB_IMSTT is not set
CONFIG_FB_VGA16=y
# CONFIG_FB_UVESA is not set
CONFIG_FB_VESA=y
# CONFIG_FB_N411 is not set
# CONFIG_FB_OPENCORES is not set
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_NVIDIA is not set
# CONFIG_FB_RIVA is not set
# CONFIG_FB_I740 is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_RADEON is not set
# CONFIG_FB_ATY128 is not set
# CONFIG_FB_ATY is not set
# CONFIG_FB_S3 is not set
# CONFIG_FB_SAVAGE is not set
# CONFIG_FB_SIS is not set
# CONFIG_FB_VIA is not set
# CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_KYRO is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
# CONFIG_FB_VT8623 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_ARK is not set
# CONFIG_FB_PM3 is not set
# CONFIG_FB_CARMINE is not set
# CONFIG_FB_SMSCUFX is not set
# CONFIG_FB_UDL is not set
# CONFIG_FB_IBM_GXT4500 is not set
CONFIG_FB_VIRTUAL=y
# CONFIG_FB_METRONOME is not set
# CONFIG_FB_MB862XX is not set
# CONFIG_FB_SSD1307 is not set
# CONFIG_FB_SM712 is not set
CONFIG_FB_CORE=y
CONFIG_FB_NOTIFY=y
CONFIG_FB_DEVICE=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_SYS_FILLRECT=y
CONFIG_FB_SYS_COPYAREA=y
CONFIG_FB_SYS_IMAGEBLIT=y
# CONFIG_FB_FOREIGN_ENDIAN is not set
CONFIG_FB_SYSMEM_FOPS=y
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_IOMEM_FOPS=y
CONFIG_FB_IOMEM_HELPERS=y
CONFIG_FB_SYSMEM_HELPERS=y
CONFIG_FB_SYSMEM_HELPERS_DEFERRED=y
CONFIG_FB_TILEBLITTING=y
# end of Frame buffer Devices

#
# Backlight & LCD device support
#
CONFIG_LCD_CLASS_DEVICE=y
# CONFIG_LCD_L4F00242T03 is not set
# CONFIG_LCD_LMS283GF05 is not set
# CONFIG_LCD_LTV350QV is not set
# CONFIG_LCD_ILI922X is not set
# CONFIG_LCD_ILI9320 is not set
# CONFIG_LCD_TDO24M is not set
# CONFIG_LCD_VGG2432A4 is not set
# CONFIG_LCD_PLATFORM is not set
# CONFIG_LCD_AMS369FG06 is not set
# CONFIG_LCD_LMS501KF03 is not set
# CONFIG_LCD_HX8357 is not set
# CONFIG_LCD_OTM3225A is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_AW99706 is not set
# CONFIG_BACKLIGHT_KTD253 is not set
# CONFIG_BACKLIGHT_KTD2801 is not set
# CONFIG_BACKLIGHT_KTZ8866 is not set
# CONFIG_BACKLIGHT_MAX25014 is not set
# CONFIG_BACKLIGHT_MT6370 is not set
# CONFIG_BACKLIGHT_APPLE is not set
# CONFIG_BACKLIGHT_QCOM_WLED is not set
# CONFIG_BACKLIGHT_SAHARA is not set
# CONFIG_BACKLIGHT_ADP8860 is not set
# CONFIG_BACKLIGHT_ADP8870 is not set
# CONFIG_BACKLIGHT_LM3509 is not set
# CONFIG_BACKLIGHT_LM3639 is not set
# CONFIG_BACKLIGHT_PANDORA is not set
# CONFIG_BACKLIGHT_GPIO is not set
# CONFIG_BACKLIGHT_LV5207LP is not set
# CONFIG_BACKLIGHT_BD6107 is not set
# CONFIG_BACKLIGHT_ARCXCNN is not set
# CONFIG_BACKLIGHT_LED is not set
# end of Backlight & LCD device support

CONFIG_VGASTATE=y
CONFIG_VIDEOMODE_HELPERS=y
CONFIG_HDMI=y
# CONFIG_FIRMWARE_EDID is not set

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
CONFIG_DUMMY_CONSOLE=y
CONFIG_DUMMY_CONSOLE_COLUMNS=80
CONFIG_DUMMY_CONSOLE_ROWS=25
CONFIG_FRAMEBUFFER_CONSOLE=y
# CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is not set
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
# CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is not set
# end of Console display driver support

CONFIG_LOGO=y
CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_MONO_FILE="drivers/video/logo/logo_linux_mono.pbm"
CONFIG_LOGO_LINUX_VGA16=y
CONFIG_LOGO_LINUX_VGA16_FILE="drivers/video/logo/logo_linux_vga16.ppm"
# CONFIG_LOGO_LINUX_CLUT224 is not set
# CONFIG_TRACE_GPU_MEM is not set
# end of Graphics support

# CONFIG_DRM_ACCEL is not set
CONFIG_SOUND=y
CONFIG_SOUND_OSS_CORE=y
CONFIG_SOUND_OSS_CORE_PRECLAIM=y
CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
CONFIG_SND_HWDEP=y
CONFIG_SND_SEQ_DEVICE=y
CONFIG_SND_RAWMIDI=y
CONFIG_SND_UMP=y
CONFIG_SND_UMP_LEGACY_RAWMIDI=y
CONFIG_SND_JACK=y
CONFIG_SND_JACK_INPUT_DEV=y
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=y
CONFIG_SND_PCM_OSS=y
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_PCM_TIMER=y
CONFIG_SND_HRTIMER=y
# CONFIG_SND_DYNAMIC_MINORS is not set
# CONFIG_SND_SUPPORT_OLD_API is not set
CONFIG_SND_PROC_FS=y
CONFIG_SND_VERBOSE_PROCFS=y
CONFIG_SND_CTL_FAST_LOOKUP=y
CONFIG_SND_DEBUG=y
# CONFIG_SND_DEBUG_VERBOSE is not set
CONFIG_SND_PCM_XRUN_DEBUG=y
# CONFIG_SND_CTL_INPUT_VALIDATION is not set
# CONFIG_SND_CTL_DEBUG is not set
# CONFIG_SND_JACK_INJECTION_DEBUG is not set
# CONFIG_SND_UTIMER is not set
CONFIG_SND_VMASTER=y
CONFIG_SND_DMA_SGBUF=y
CONFIG_SND_CTL_LED=y
CONFIG_SND_SEQUENCER=y
CONFIG_SND_SEQ_DUMMY=y
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
CONFIG_SND_SEQ_MIDI_EVENT=y
CONFIG_SND_SEQ_MIDI=y
CONFIG_SND_SEQ_VIRMIDI=y
# CONFIG_SND_SEQ_UMP is not set
CONFIG_SND_DRIVERS=y
# CONFIG_SND_PCSP is not set
CONFIG_SND_DUMMY=y
CONFIG_SND_ALOOP=y
# CONFIG_SND_PCMTEST is not set
CONFIG_SND_VIRMIDI=y
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_MTS64 is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_SERIAL_GENERIC is not set
# CONFIG_SND_MPU401 is not set
# CONFIG_SND_PORTMAN2X4 is not set
CONFIG_SND_PCI=y
# CONFIG_SND_AD1889 is not set
# CONFIG_SND_ALS300 is not set
# CONFIG_SND_ALS4000 is not set
# CONFIG_SND_ALI5451 is not set
# CONFIG_SND_ASIHPI is not set
# CONFIG_SND_ATIIXP is not set
# CONFIG_SND_ATIIXP_MODEM is not set
# CONFIG_SND_AU8810 is not set
# CONFIG_SND_AU8820 is not set
# CONFIG_SND_AU8830 is not set
# CONFIG_SND_AW2 is not set
# CONFIG_SND_AZT3328 is not set
# CONFIG_SND_BT87X is not set
# CONFIG_SND_CA0106 is not set
# CONFIG_SND_CMIPCI is not set
# CONFIG_SND_OXYGEN is not set
# CONFIG_SND_CS4281 is not set
# CONFIG_SND_CS46XX is not set
# CONFIG_SND_CTXFI is not set
# CONFIG_SND_DARLA20 is not set
# CONFIG_SND_GINA20 is not set
# CONFIG_SND_LAYLA20 is not set
# CONFIG_SND_DARLA24 is not set
# CONFIG_SND_GINA24 is not set
# CONFIG_SND_LAYLA24 is not set
# CONFIG_SND_MONA is not set
# CONFIG_SND_MIA is not set
# CONFIG_SND_ECHO3G is not set
# CONFIG_SND_INDIGO is not set
# CONFIG_SND_INDIGOIO is not set
# CONFIG_SND_INDIGODJ is not set
# CONFIG_SND_INDIGOIOX is not set
# CONFIG_SND_INDIGODJX is not set
# CONFIG_SND_EMU10K1 is not set
# CONFIG_SND_EMU10K1X is not set
# CONFIG_SND_ENS1370 is not set
# CONFIG_SND_ENS1371 is not set
# CONFIG_SND_ES1938 is not set
# CONFIG_SND_ES1968 is not set
# CONFIG_SND_FM801 is not set
# CONFIG_SND_HDSP is not set
# CONFIG_SND_HDSPM is not set
# CONFIG_SND_ICE1712 is not set
# CONFIG_SND_ICE1724 is not set
# CONFIG_SND_INTEL8X0 is not set
# CONFIG_SND_INTEL8X0M is not set
# CONFIG_SND_KORG1212 is not set
# CONFIG_SND_LOLA is not set
# CONFIG_SND_LX6464ES is not set
# CONFIG_SND_MAESTRO3 is not set
# CONFIG_SND_MIXART is not set
# CONFIG_SND_NM256 is not set
# CONFIG_SND_PCXHR is not set
# CONFIG_SND_RIPTIDE is not set
# CONFIG_SND_RME32 is not set
# CONFIG_SND_RME96 is not set
# CONFIG_SND_RME9652 is not set
# CONFIG_SND_SE6X is not set
# CONFIG_SND_SONICVIBES is not set
# CONFIG_SND_TRIDENT is not set
# CONFIG_SND_VIA82XX is not set
# CONFIG_SND_VIA82XX_MODEM is not set
# CONFIG_SND_VIRTUOSO is not set
# CONFIG_SND_VX222 is not set
# CONFIG_SND_YMFPCI is not set

#
# HD-Audio
#
CONFIG_SND_HDA=y
CONFIG_SND_HDA_HWDEP=y
CONFIG_SND_HDA_RECONFIG=y
CONFIG_SND_HDA_INPUT_BEEP=y
CONFIG_SND_HDA_INPUT_BEEP_MODE=1
CONFIG_SND_HDA_PATCH_LOADER=y
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
# CONFIG_SND_HDA_CTL_DEV_ID is not set
CONFIG_SND_HDA_PREALLOC_SIZE=0
CONFIG_SND_HDA_INTEL=y
# CONFIG_SND_HDA_ACPI is not set
CONFIG_SND_HDA_GENERIC_LEDS=y
CONFIG_SND_HDA_CODEC_ANALOG=y
CONFIG_SND_HDA_CODEC_SIGMATEL=y
CONFIG_SND_HDA_CODEC_VIA=y
CONFIG_SND_HDA_CODEC_CONEXANT=y
# CONFIG_SND_HDA_CODEC_SENARYTECH is not set
CONFIG_SND_HDA_CODEC_CA0110=y
CONFIG_SND_HDA_CODEC_CA0132=y
# CONFIG_SND_HDA_CODEC_CA0132_DSP is not set
CONFIG_SND_HDA_CODEC_CMEDIA=y
# CONFIG_SND_HDA_CODEC_CM9825 is not set
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_CODEC_REALTEK=y
# CONFIG_SND_HDA_CODEC_ALC260 is not set
# CONFIG_SND_HDA_CODEC_ALC262 is not set
# CONFIG_SND_HDA_CODEC_ALC268 is not set
# CONFIG_SND_HDA_CODEC_ALC269 is not set
# CONFIG_SND_HDA_CODEC_ALC662 is not set
# CONFIG_SND_HDA_CODEC_ALC680 is not set
# CONFIG_SND_HDA_CODEC_ALC861 is not set
# CONFIG_SND_HDA_CODEC_ALC861VD is not set
# CONFIG_SND_HDA_CODEC_ALC880 is not set
# CONFIG_SND_HDA_CODEC_ALC882 is not set
CONFIG_SND_HDA_CODEC_CIRRUS=y
# CONFIG_SND_HDA_CODEC_CS420X is not set
# CONFIG_SND_HDA_CODEC_CS421X is not set
# CONFIG_SND_HDA_CODEC_CS8409 is not set
CONFIG_SND_HDA_CODEC_HDMI=y
# CONFIG_SND_HDA_CODEC_HDMI_GENERIC is not set
# CONFIG_SND_HDA_CODEC_HDMI_SIMPLE is not set
# CONFIG_SND_HDA_CODEC_HDMI_INTEL is not set
# CONFIG_SND_HDA_CODEC_HDMI_ATI is not set
# CONFIG_SND_HDA_CODEC_HDMI_NVIDIA is not set
# CONFIG_SND_HDA_CODEC_HDMI_NVIDIA_MCP is not set
# CONFIG_SND_HDA_CODEC_HDMI_TEGRA is not set
# CONFIG_SND_HDA_SCODEC_AW88399_I2C is not set
# CONFIG_SND_HDA_SCODEC_CS35L56_I2C is not set
# CONFIG_SND_HDA_SCODEC_CS35L56_SPI is not set
CONFIG_SND_HDA_CORE=y
CONFIG_SND_HDA_COMPONENT=y
CONFIG_SND_HDA_I915=y
CONFIG_SND_INTEL_NHLT=y
CONFIG_SND_INTEL_DSP_CONFIG=y
CONFIG_SND_INTEL_SOUNDWIRE_ACPI=y
# end of HD-Audio

# CONFIG_SND_SPI is not set
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=y
CONFIG_SND_USB_AUDIO_MIDI_V2=y
CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER=y
CONFIG_SND_USB_UA101=y
CONFIG_SND_USB_USX2Y=y
CONFIG_SND_USB_CAIAQ=y
CONFIG_SND_USB_CAIAQ_INPUT=y
CONFIG_SND_USB_US122L=y
# CONFIG_SND_USB_US144MKII is not set
CONFIG_SND_USB_6FIRE=y
CONFIG_SND_USB_HIFACE=y
CONFIG_SND_BCD2000=y
CONFIG_SND_USB_LINE6=y
CONFIG_SND_USB_POD=y
CONFIG_SND_USB_PODHD=y
CONFIG_SND_USB_TONEPORT=y
CONFIG_SND_USB_VARIAX=y
# CONFIG_SND_FIREWIRE is not set
CONFIG_SND_PCMCIA=y
# CONFIG_SND_VXPOCKET is not set
# CONFIG_SND_PDAUDIOCF is not set
CONFIG_SND_SOC=y
# CONFIG_SND_SOC_USB is not set

#
# Analog Devices
#
# CONFIG_SND_SOC_ADI_AXI_I2S is not set
# CONFIG_SND_SOC_ADI_AXI_SPDIF is not set
# end of Analog Devices

#
# AMD
#
# CONFIG_SND_SOC_AMD_ACP is not set
# CONFIG_SND_SOC_AMD_ACP3x is not set
# CONFIG_SND_SOC_AMD_RENOIR is not set
# CONFIG_SND_SOC_AMD_ACP5x is not set
# CONFIG_SND_SOC_AMD_ACP6x is not set
# CONFIG_SND_AMD_ACP_CONFIG is not set
# CONFIG_SND_SOC_AMD_ACP_COMMON is not set
# end of AMD

#
# Apple
#
# end of Apple

#
# Atmel
#
# CONFIG_SND_SOC_MIKROE_PROTO is not set
# end of Atmel

#
# Au1x
#
# end of Au1x

#
# Broadcom
#
# CONFIG_SND_BCM63XX_I2S_WHISTLER is not set
# end of Broadcom

#
# Cirrus Logic
#
# end of Cirrus Logic

#
# DesignWare
#
# CONFIG_SND_DESIGNWARE_I2S is not set
# end of DesignWare

#
# Freescale
#

#
# Common SoC Audio options for Freescale CPUs:
#
# CONFIG_SND_SOC_FSL_ASRC is not set
# CONFIG_SND_SOC_FSL_SAI is not set
# CONFIG_SND_SOC_FSL_AUDMIX is not set
# CONFIG_SND_SOC_FSL_SSI is not set
# CONFIG_SND_SOC_FSL_SPDIF is not set
# CONFIG_SND_SOC_FSL_ESAI is not set
# CONFIG_SND_SOC_FSL_MICFIL is not set
# CONFIG_SND_SOC_FSL_XCVR is not set
# CONFIG_SND_SOC_IMX_AUDMUX is not set
# end of Freescale

#
# Google
#
# CONFIG_SND_SOC_CHV3_I2S is not set
# end of Google

#
# Hisilicon
#
# CONFIG_SND_I2S_HI6210_I2S is not set
# end of Hisilicon

#
# JZ4740
#
# end of JZ4740

#
# Kirkwood
#
# end of Kirkwood

#
# Loongson
#
# end of Loongson

#
# Intel
#
# CONFIG_SND_SOC_INTEL_SST_TOPLEVEL is not set
# CONFIG_SND_SOC_INTEL_AVS is not set
# end of Intel

#
# Mediatek
#
# CONFIG_SND_SOC_MTK_BTCVSD is not set
# end of Mediatek

#
# PXA
#
# end of PXA

#
# SoundWire (SDCA)
#
# CONFIG_SND_SOC_SDCA is not set
CONFIG_SND_SOC_SDCA_OPTIONAL=y
# end of SoundWire (SDCA)

#
# ST SPEAr
#
# end of ST SPEAr

#
# Spreadtrum
#
# end of Spreadtrum

#
# STMicroelectronics STM32
#
# end of STMicroelectronics STM32

#
# Tegra
#
# end of Tegra

#
# Xilinx
#
# CONFIG_SND_SOC_XILINX_I2S is not set
# CONFIG_SND_SOC_XILINX_AUDIO_FORMATTER is not set
# CONFIG_SND_SOC_XILINX_SPDIF is not set
# end of Xilinx

#
# Xtensa
#
# CONFIG_SND_SOC_XTFPGA_I2S is not set
# end of Xtensa

# CONFIG_SND_SOC_SOF_TOPLEVEL is not set
CONFIG_SND_SOC_I2C_AND_SPI=y

#
# CODEC drivers
#
# CONFIG_SND_SOC_AC97_CODEC is not set
# CONFIG_SND_SOC_ADAU1372_I2C is not set
# CONFIG_SND_SOC_ADAU1372_SPI is not set
# CONFIG_SND_SOC_ADAU1373 is not set
# CONFIG_SND_SOC_ADAU1701 is not set
# CONFIG_SND_SOC_ADAU1761_I2C is not set
# CONFIG_SND_SOC_ADAU1761_SPI is not set
# CONFIG_SND_SOC_ADAU7002 is not set
# CONFIG_SND_SOC_ADAU7118_HW is not set
# CONFIG_SND_SOC_ADAU7118_I2C is not set
# CONFIG_SND_SOC_AK4104 is not set
# CONFIG_SND_SOC_AK4118 is not set
# CONFIG_SND_SOC_AK4375 is not set
# CONFIG_SND_SOC_AK4458 is not set
# CONFIG_SND_SOC_AK4554 is not set
# CONFIG_SND_SOC_AK4613 is not set
# CONFIG_SND_SOC_AK4619 is not set
# CONFIG_SND_SOC_AK4642 is not set
# CONFIG_SND_SOC_AK5386 is not set
# CONFIG_SND_SOC_AK5558 is not set
# CONFIG_SND_SOC_ALC5623 is not set
# CONFIG_SND_SOC_AUDIO_IIO_AUX is not set
# CONFIG_SND_SOC_AW8738 is not set
# CONFIG_SND_SOC_AW88395 is not set
# CONFIG_SND_SOC_AW88166 is not set
# CONFIG_SND_SOC_AW88261 is not set
# CONFIG_SND_SOC_AW88081 is not set
# CONFIG_SND_SOC_AW87390 is not set
# CONFIG_SND_SOC_AW88399 is not set
# CONFIG_SND_SOC_BD28623 is not set
# CONFIG_SND_SOC_BT_SCO is not set
# CONFIG_SND_SOC_CHV3_CODEC is not set
# CONFIG_SND_SOC_CS35L32 is not set
# CONFIG_SND_SOC_CS35L33 is not set
# CONFIG_SND_SOC_CS35L34 is not set
# CONFIG_SND_SOC_CS35L35 is not set
# CONFIG_SND_SOC_CS35L36 is not set
# CONFIG_SND_SOC_CS35L41_SPI is not set
# CONFIG_SND_SOC_CS35L41_I2C is not set
# CONFIG_SND_SOC_CS35L45_SPI is not set
# CONFIG_SND_SOC_CS35L45_I2C is not set
# CONFIG_SND_SOC_CS35L56_I2C is not set
# CONFIG_SND_SOC_CS35L56_SPI is not set
# CONFIG_SND_SOC_CS35L56_SDW is not set
# CONFIG_SND_SOC_CS42L42 is not set
# CONFIG_SND_SOC_CS42L42_SDW is not set
# CONFIG_SND_SOC_CS42L51_I2C is not set
# CONFIG_SND_SOC_CS42L52 is not set
# CONFIG_SND_SOC_CS42L56 is not set
# CONFIG_SND_SOC_CS42L73 is not set
# CONFIG_SND_SOC_CS42L83 is not set
# CONFIG_SND_SOC_CS42L84 is not set
# CONFIG_SND_SOC_CS4234 is not set
# CONFIG_SND_SOC_CS4265 is not set
# CONFIG_SND_SOC_CS4270 is not set
# CONFIG_SND_SOC_CS4271_I2C is not set
# CONFIG_SND_SOC_CS4271_SPI is not set
# CONFIG_SND_SOC_CS42XX8_SPI is not set
# CONFIG_SND_SOC_CS42XX8_I2C is not set
# CONFIG_SND_SOC_CS43130 is not set
# CONFIG_SND_SOC_CS4341 is not set
# CONFIG_SND_SOC_CS4349 is not set
# CONFIG_SND_SOC_CS48L32 is not set
# CONFIG_SND_SOC_CS53L30 is not set
# CONFIG_SND_SOC_CS530X_I2C is not set
# CONFIG_SND_SOC_CS530X_SPI is not set
# CONFIG_SND_SOC_CX2072X is not set
# CONFIG_SND_SOC_DA7213 is not set
# CONFIG_SND_SOC_DMIC is not set
# CONFIG_SND_SOC_ES7134 is not set
# CONFIG_SND_SOC_ES7241 is not set
# CONFIG_SND_SOC_ES8311 is not set
# CONFIG_SND_SOC_ES8316 is not set
# CONFIG_SND_SOC_ES8323 is not set
# CONFIG_SND_SOC_ES8326 is not set
# CONFIG_SND_SOC_ES8328_I2C is not set
# CONFIG_SND_SOC_ES8328_SPI is not set
# CONFIG_SND_SOC_ES8375 is not set
# CONFIG_SND_SOC_ES8389 is not set
# CONFIG_SND_SOC_FS210X is not set
# CONFIG_SND_SOC_GTM601 is not set
# CONFIG_SND_SOC_HDA is not set
# CONFIG_SND_SOC_ICS43432 is not set
# CONFIG_SND_SOC_IDT821034 is not set
# CONFIG_SND_SOC_MAX98088 is not set
# CONFIG_SND_SOC_MAX98090 is not set
# CONFIG_SND_SOC_MAX98357A is not set
# CONFIG_SND_SOC_MAX98504 is not set
# CONFIG_SND_SOC_MAX9867 is not set
# CONFIG_SND_SOC_MAX98927 is not set
# CONFIG_SND_SOC_MAX98520 is not set
# CONFIG_SND_SOC_MAX98363 is not set
# CONFIG_SND_SOC_MAX98373_I2C is not set
# CONFIG_SND_SOC_MAX98373_SDW is not set
# CONFIG_SND_SOC_MAX98388 is not set
# CONFIG_SND_SOC_MAX98390 is not set
# CONFIG_SND_SOC_MAX98396 is not set
# CONFIG_SND_SOC_MAX9860 is not set
# CONFIG_SND_SOC_MSM8916_WCD_DIGITAL is not set
# CONFIG_SND_SOC_PCM1681 is not set
# CONFIG_SND_SOC_PCM1754 is not set
# CONFIG_SND_SOC_PCM1789_I2C is not set
# CONFIG_SND_SOC_PCM179X_I2C is not set
# CONFIG_SND_SOC_PCM179X_SPI is not set
# CONFIG_SND_SOC_PCM186X_I2C is not set
# CONFIG_SND_SOC_PCM186X_SPI is not set
# CONFIG_SND_SOC_PCM3060_I2C is not set
# CONFIG_SND_SOC_PCM3060_SPI is not set
# CONFIG_SND_SOC_PCM3168A_I2C is not set
# CONFIG_SND_SOC_PCM3168A_SPI is not set
# CONFIG_SND_SOC_PCM5102A is not set
# CONFIG_SND_SOC_PCM512x_I2C is not set
# CONFIG_SND_SOC_PCM512x_SPI is not set
# CONFIG_SND_SOC_PCM6240 is not set
# CONFIG_SND_SOC_PEB2466 is not set
# CONFIG_SND_SOC_PM4125_SDW is not set
# CONFIG_SND_SOC_RT1017_SDCA_SDW is not set
# CONFIG_SND_SOC_RT1308_SDW is not set
# CONFIG_SND_SOC_RT1316_SDW is not set
# CONFIG_SND_SOC_RT1318_SDW is not set
# CONFIG_SND_SOC_RT1320_SDW is not set
# CONFIG_SND_SOC_RT5575 is not set
# CONFIG_SND_SOC_RT5616 is not set
# CONFIG_SND_SOC_RT5631 is not set
# CONFIG_SND_SOC_RT5640 is not set
# CONFIG_SND_SOC_RT5645 is not set
# CONFIG_SND_SOC_RT5659 is not set
# CONFIG_SND_SOC_RT5677 is not set
# CONFIG_SND_SOC_RT5682_SDW is not set
# CONFIG_SND_SOC_RT700_SDW is not set
# CONFIG_SND_SOC_RT711_SDW is not set
# CONFIG_SND_SOC_RT711_SDCA_SDW is not set
# CONFIG_SND_SOC_RT712_SDCA_SDW is not set
# CONFIG_SND_SOC_RT712_SDCA_DMIC_SDW is not set
# CONFIG_SND_SOC_RT721_SDCA_SDW is not set
# CONFIG_SND_SOC_RT722_SDCA_SDW is not set
# CONFIG_SND_SOC_RT715_SDW is not set
# CONFIG_SND_SOC_RT715_SDCA_SDW is not set
# CONFIG_SND_SOC_RT9120 is not set
# CONFIG_SND_SOC_RT9123 is not set
# CONFIG_SND_SOC_RT9123P is not set
# CONFIG_SND_SOC_RTQ9124 is not set
# CONFIG_SND_SOC_RTQ9128 is not set
# CONFIG_SND_SOC_SDW_MOCKUP is not set
# CONFIG_SND_SOC_SGTL5000 is not set
# CONFIG_SND_SOC_SIMPLE_AMPLIFIER is not set
# CONFIG_SND_SOC_SIMPLE_MUX is not set
# CONFIG_SND_SOC_SMA1303 is not set
# CONFIG_SND_SOC_SMA1307 is not set
# CONFIG_SND_SOC_SPDIF is not set
# CONFIG_SND_SOC_SRC4XXX_I2C is not set
# CONFIG_SND_SOC_SSM2305 is not set
# CONFIG_SND_SOC_SSM2518 is not set
# CONFIG_SND_SOC_SSM2602_SPI is not set
# CONFIG_SND_SOC_SSM2602_I2C is not set
# CONFIG_SND_SOC_SSM3515 is not set
# CONFIG_SND_SOC_SSM4567 is not set
# CONFIG_SND_SOC_STA32X is not set
# CONFIG_SND_SOC_STA350 is not set
# CONFIG_SND_SOC_STI_SAS is not set
# CONFIG_SND_SOC_TAS2552 is not set
# CONFIG_SND_SOC_TAS2562 is not set
# CONFIG_SND_SOC_TAS2764 is not set
# CONFIG_SND_SOC_TAS2770 is not set
# CONFIG_SND_SOC_TAS2780 is not set
# CONFIG_SND_SOC_TAS2781_I2C is not set
# CONFIG_SND_SOC_TAS5086 is not set
# CONFIG_SND_SOC_TAS571X is not set
# CONFIG_SND_SOC_TAS5720 is not set
# CONFIG_SND_SOC_TAS5805M is not set
# CONFIG_SND_SOC_TAS6424 is not set
# CONFIG_SND_SOC_TAS675X is not set
# CONFIG_SND_SOC_TDA7419 is not set
# CONFIG_SND_SOC_TFA9879 is not set
# CONFIG_SND_SOC_TFA989X is not set
# CONFIG_SND_SOC_TLV320ADC3XXX is not set
# CONFIG_SND_SOC_TLV320AIC23_I2C is not set
# CONFIG_SND_SOC_TLV320AIC23_SPI is not set
# CONFIG_SND_SOC_TLV320AIC31XX is not set
# CONFIG_SND_SOC_TLV320AIC32X4_I2C is not set
# CONFIG_SND_SOC_TLV320AIC32X4_SPI is not set
# CONFIG_SND_SOC_TLV320AIC3X_I2C is not set
# CONFIG_SND_SOC_TLV320AIC3X_SPI is not set
# CONFIG_SND_SOC_TLV320ADCX140 is not set
# CONFIG_SND_SOC_TS3A227E is not set
# CONFIG_SND_SOC_TSCS42XX is not set
# CONFIG_SND_SOC_TSCS454 is not set
# CONFIG_SND_SOC_UDA1334 is not set
# CONFIG_SND_SOC_UDA1342 is not set
# CONFIG_SND_SOC_UDA1380 is not set
# CONFIG_SND_SOC_WCD937X_SDW is not set
# CONFIG_SND_SOC_WCD938X_SDW is not set
# CONFIG_SND_SOC_WCD939X_SDW is not set
# CONFIG_SND_SOC_WM8510 is not set
# CONFIG_SND_SOC_WM8523 is not set
# CONFIG_SND_SOC_WM8524 is not set
# CONFIG_SND_SOC_WM8580 is not set
# CONFIG_SND_SOC_WM8711 is not set
# CONFIG_SND_SOC_WM8728 is not set
# CONFIG_SND_SOC_WM8731_I2C is not set
# CONFIG_SND_SOC_WM8731_SPI is not set
# CONFIG_SND_SOC_WM8737 is not set
# CONFIG_SND_SOC_WM8741 is not set
# CONFIG_SND_SOC_WM8750 is not set
# CONFIG_SND_SOC_WM8753 is not set
# CONFIG_SND_SOC_WM8770 is not set
# CONFIG_SND_SOC_WM8776 is not set
# CONFIG_SND_SOC_WM8782 is not set
# CONFIG_SND_SOC_WM8804_I2C is not set
# CONFIG_SND_SOC_WM8804_SPI is not set
# CONFIG_SND_SOC_WM8903 is not set
# CONFIG_SND_SOC_WM8904 is not set
# CONFIG_SND_SOC_WM8940 is not set
# CONFIG_SND_SOC_WM8960 is not set
# CONFIG_SND_SOC_WM8961 is not set
# CONFIG_SND_SOC_WM8962 is not set
# CONFIG_SND_SOC_WM8974 is not set
# CONFIG_SND_SOC_WM8978 is not set
# CONFIG_SND_SOC_WM8985 is not set
# CONFIG_SND_SOC_WSA881X is not set
# CONFIG_SND_SOC_WSA883X is not set
# CONFIG_SND_SOC_WSA884X is not set
# CONFIG_SND_SOC_WSA885X is not set
# CONFIG_SND_SOC_ZL38060 is not set
# CONFIG_SND_SOC_MAX9759 is not set
# CONFIG_SND_SOC_MT6351 is not set
# CONFIG_SND_SOC_MT6357 is not set
# CONFIG_SND_SOC_MT6358 is not set
# CONFIG_SND_SOC_MT6660 is not set
# CONFIG_SND_SOC_NAU8315 is not set
# CONFIG_SND_SOC_NAU8325 is not set
# CONFIG_SND_SOC_NAU8540 is not set
# CONFIG_SND_SOC_NAU8810 is not set
# CONFIG_SND_SOC_NAU8821 is not set
# CONFIG_SND_SOC_NAU8822 is not set
# CONFIG_SND_SOC_NAU8824 is not set
# CONFIG_SND_SOC_NTP8918 is not set
# CONFIG_SND_SOC_NTP8835 is not set
# CONFIG_SND_SOC_TPA6130A2 is not set
# CONFIG_SND_SOC_LPASS_WSA_MACRO is not set
# CONFIG_SND_SOC_LPASS_VA_MACRO is not set
# CONFIG_SND_SOC_LPASS_RX_MACRO is not set
# CONFIG_SND_SOC_LPASS_TX_MACRO is not set
# end of CODEC drivers

#
# Generic drivers
#
# CONFIG_SND_SIMPLE_CARD is not set
# CONFIG_SND_AUDIO_GRAPH_CARD is not set
# CONFIG_SND_AUDIO_GRAPH_CARD2 is not set
# CONFIG_SND_TEST_COMPONENT is not set
# end of Generic drivers

CONFIG_SND_X86=y
# CONFIG_HDMI_LPE_AUDIO is not set
CONFIG_SND_VIRTIO=y
CONFIG_HID_SUPPORT=y
CONFIG_HID=y
CONFIG_HID_BATTERY_STRENGTH=y
CONFIG_HIDRAW=y
CONFIG_UHID=y
CONFIG_HID_GENERIC=y
CONFIG_HID_HAPTIC=y

#
# Special HID drivers
#
CONFIG_HID_A4TECH=y
CONFIG_HID_ACCUTOUCH=y
CONFIG_HID_ACRUX=y
CONFIG_HID_ACRUX_FF=y
CONFIG_HID_APPLE=y
CONFIG_HID_APPLEIR=y
# CONFIG_HID_APPLETB_BL is not set
# CONFIG_HID_APPLETB_KBD is not set
CONFIG_HID_ASUS=y
CONFIG_HID_AUREAL=y
CONFIG_HID_BELKIN=y
CONFIG_HID_BETOP_FF=y
CONFIG_HID_BIGBEN_FF=y
CONFIG_HID_CHERRY=y
CONFIG_HID_CHICONY=y
CONFIG_HID_CORSAIR=y
CONFIG_HID_COUGAR=y
CONFIG_HID_MACALLY=y
CONFIG_HID_PRODIKEYS=y
CONFIG_HID_CMEDIA=y
CONFIG_HID_CP2112=y
CONFIG_HID_CREATIVE_SB0540=y
CONFIG_HID_CYPRESS=y
CONFIG_HID_DRAGONRISE=y
CONFIG_DRAGONRISE_FF=y
CONFIG_HID_EMS_FF=y
CONFIG_HID_ELAN=y
CONFIG_HID_ELECOM=y
CONFIG_HID_ELO=y
CONFIG_HID_EVISION=y
CONFIG_HID_EZKEY=y
CONFIG_HID_FT260=y
CONFIG_HID_GEMBIRD=y
CONFIG_HID_GFRM=y
CONFIG_HID_GLORIOUS=y
CONFIG_HID_HOLTEK=y
CONFIG_HOLTEK_FF=y
# CONFIG_HID_HYPERX is not set
CONFIG_HID_VIVALDI_COMMON=y
# CONFIG_HID_GOODIX_SPI is not set
CONFIG_HID_GOOGLE_STADIA_FF=y
CONFIG_HID_VIVALDI=y
CONFIG_HID_GT683R=y
# CONFIG_HID_MSI is not set
CONFIG_HID_KEYTOUCH=y
CONFIG_HID_KYE=y
# CONFIG_HID_KYSONA is not set
CONFIG_HID_UCLOGIC=y
CONFIG_HID_WALTOP=y
CONFIG_HID_VIEWSONIC=y
CONFIG_HID_VRC2=y
CONFIG_HID_XIAOMI=y
CONFIG_HID_GYRATION=y
CONFIG_HID_ICADE=y
CONFIG_HID_ITE=y
CONFIG_HID_JABRA=y
CONFIG_HID_TWINHAN=y
CONFIG_HID_KENSINGTON=y
CONFIG_HID_LCPOWER=y
CONFIG_HID_LED=y
CONFIG_HID_LENOVO=y
# CONFIG_HID_LENOVO_GO is not set
# CONFIG_HID_LENOVO_GO_S is not set
CONFIG_HID_LETSKETCH=y
CONFIG_HID_LOGITECH=y
CONFIG_HID_LOGITECH_DJ=y
CONFIG_HID_LOGITECH_HIDPP=y
CONFIG_LOGITECH_FF=y
CONFIG_LOGIRUMBLEPAD2_FF=y
CONFIG_LOGIG940_FF=y
CONFIG_LOGIWHEELS_FF=y
CONFIG_HID_MAGICMOUSE=y
CONFIG_HID_MALTRON=y
CONFIG_HID_MAYFLASH=y
CONFIG_HID_MEGAWORLD_FF=y
# CONFIG_HID_RAKK is not set
CONFIG_HID_REDRAGON=y
CONFIG_HID_MICROSOFT=y
CONFIG_HID_MONTEREY=y
CONFIG_HID_MULTITOUCH=y
CONFIG_HID_NINTENDO=y
CONFIG_NINTENDO_FF=y
CONFIG_HID_NTI=y
CONFIG_HID_NTRIG=y
CONFIG_HID_NVIDIA_SHIELD=y
CONFIG_NVIDIA_SHIELD_FF=y
CONFIG_HID_ORTEK=y
# CONFIG_HID_OXP is not set
CONFIG_HID_PANTHERLORD=y
CONFIG_PANTHERLORD_FF=y
CONFIG_HID_PENMOUNT=y
CONFIG_HID_PETALYNX=y
CONFIG_HID_PICOLCD=y
CONFIG_HID_PICOLCD_FB=y
CONFIG_HID_PICOLCD_BACKLIGHT=y
CONFIG_HID_PICOLCD_LCD=y
CONFIG_HID_PICOLCD_LEDS=y
CONFIG_HID_PICOLCD_CIR=y
CONFIG_HID_PLANTRONICS=y
CONFIG_HID_PLAYSTATION=y
CONFIG_PLAYSTATION_FF=y
CONFIG_HID_PXRC=y
# CONFIG_HID_RAPOO is not set
CONFIG_HID_RAZER=y
CONFIG_HID_PRIMAX=y
CONFIG_HID_RETRODE=y
CONFIG_HID_ROCCAT=y
CONFIG_HID_SAITEK=y
CONFIG_HID_SAMSUNG=y
CONFIG_HID_SEMITEK=y
CONFIG_HID_SIGMAMICRO=y
CONFIG_HID_SONY=y
CONFIG_SONY_FF=y
CONFIG_HID_SPEEDLINK=y
CONFIG_HID_STEAM=y
CONFIG_STEAM_FF=y
CONFIG_HID_STEELSERIES=y
CONFIG_HID_SUNPLUS=y
CONFIG_HID_RMI=y
CONFIG_HID_GREENASIA=y
CONFIG_GREENASIA_FF=y
CONFIG_HID_SMARTJOYPLUS=y
CONFIG_SMARTJOYPLUS_FF=y
CONFIG_HID_TIVO=y
CONFIG_HID_TOPSEED=y
CONFIG_HID_TOPRE=y
CONFIG_HID_THINGM=y
CONFIG_HID_THRUSTMASTER=y
CONFIG_THRUSTMASTER_FF=y
CONFIG_HID_UDRAW_PS3=y
CONFIG_HID_U2FZERO=y
# CONFIG_HID_UNIVERSAL_PIDFF is not set
CONFIG_HID_WACOM=y
CONFIG_HID_WIIMOTE=y
# CONFIG_HID_WINWING is not set
CONFIG_HID_XINMO=y
CONFIG_HID_ZEROPLUS=y
CONFIG_ZEROPLUS_FF=y
CONFIG_HID_ZYDACRON=y
CONFIG_HID_SENSOR_HUB=y
CONFIG_HID_SENSOR_CUSTOM_SENSOR=y
CONFIG_HID_ALPS=y
CONFIG_HID_MCP2200=y
CONFIG_HID_MCP2221=y
CONFIG_HID_HUAWEI=y
# end of Special HID drivers

#
# HID-BPF support
#
# end of HID-BPF support

CONFIG_I2C_HID=y
CONFIG_I2C_HID_ACPI=y
CONFIG_I2C_HID_OF=y
# CONFIG_I2C_HID_OF_ELAN is not set
# CONFIG_I2C_HID_OF_GOODIX is not set
CONFIG_I2C_HID_CORE=y

#
# Intel ISH HID support
#
CONFIG_INTEL_ISH_HID=y
CONFIG_INTEL_ISH_FIRMWARE_DOWNLOADER=y
# end of Intel ISH HID support

#
# AMD SFH HID Support
#
CONFIG_AMD_SFH_HID=y
# end of AMD SFH HID Support

#
# Surface System Aggregator Module HID support
#
CONFIG_SURFACE_HID=y
CONFIG_SURFACE_KBD=y
# end of Surface System Aggregator Module HID support

CONFIG_SURFACE_HID_CORE=y

#
# Intel THC HID Support
#
# CONFIG_INTEL_THC_HID is not set
# end of Intel THC HID Support

#
# USB HID support
#
CONFIG_USB_HID=y
CONFIG_HID_PID=y
CONFIG_USB_HIDDEV=y
# end of USB HID support

CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=y
CONFIG_USB_LED_TRIG=y
CONFIG_USB_ULPI_BUS=y
CONFIG_USB_CONN_GPIO=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=y
CONFIG_USB_PCI=y
CONFIG_USB_PCI_AMD=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y

#
# Miscellaneous USB options
#
CONFIG_USB_DEFAULT_PERSIST=y
CONFIG_USB_FEW_INIT_RETRIES=y
CONFIG_USB_DYNAMIC_MINORS=y
CONFIG_USB_OTG=y
# CONFIG_USB_OTG_PRODUCTLIST is not set
# CONFIG_USB_OTG_DISABLE_EXTERNAL_HUB is not set
CONFIG_USB_OTG_FSM=y
CONFIG_USB_LEDS_TRIGGER_USBPORT=y
CONFIG_USB_AUTOSUSPEND_DELAY=2
CONFIG_USB_DEFAULT_AUTHORIZATION_MODE=1
CONFIG_USB_MON=y

#
# USB Host Controller Drivers
#
CONFIG_USB_C67X00_HCD=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_DBGCAP=y
CONFIG_USB_XHCI_PCI=y
CONFIG_USB_XHCI_PCI_RENESAS=y
CONFIG_USB_XHCI_PLATFORM=y
# CONFIG_USB_XHCI_SIDEBAND is not set
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_EHCI_PCI=y
CONFIG_USB_EHCI_FSL=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_OXU210HP_HCD=y
CONFIG_USB_ISP116X_HCD=y
CONFIG_USB_MAX3421_HCD=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PCI=y
# CONFIG_USB_OHCI_HCD_SSB is not set
CONFIG_USB_OHCI_HCD_PLATFORM=y
CONFIG_USB_UHCI_HCD=y
CONFIG_USB_SL811_HCD=y
CONFIG_USB_SL811_HCD_ISO=y
CONFIG_USB_SL811_CS=y
CONFIG_USB_R8A66597_HCD=y
CONFIG_USB_HCD_BCMA=y
CONFIG_USB_HCD_SSB=y
# CONFIG_USB_HCD_TEST_MODE is not set

#
# USB Device Class drivers
#
CONFIG_USB_ACM=y
CONFIG_USB_PRINTER=y
CONFIG_USB_WDM=y
CONFIG_USB_TMC=y

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=y
# CONFIG_USB_STORAGE_DEBUG is not set
CONFIG_USB_STORAGE_REALTEK=y
CONFIG_REALTEK_AUTOPM=y
CONFIG_USB_STORAGE_DATAFAB=y
CONFIG_USB_STORAGE_FREECOM=y
CONFIG_USB_STORAGE_ISD200=y
CONFIG_USB_STORAGE_USBAT=y
CONFIG_USB_STORAGE_SDDR09=y
CONFIG_USB_STORAGE_SDDR55=y
CONFIG_USB_STORAGE_JUMPSHOT=y
CONFIG_USB_STORAGE_ALAUDA=y
CONFIG_USB_STORAGE_ONETOUCH=y
CONFIG_USB_STORAGE_KARMA=y
CONFIG_USB_STORAGE_CYPRESS_ATACB=y
CONFIG_USB_STORAGE_ENE_UB6250=y
CONFIG_USB_UAS=y

#
# USB Imaging devices
#
CONFIG_USB_MDC800=y
CONFIG_USB_MICROTEK=y
CONFIG_USBIP_CORE=y
CONFIG_USBIP_VHCI_HCD=y
CONFIG_USBIP_VHCI_HC_PORTS=8
CONFIG_USBIP_VHCI_NR_HCS=16
CONFIG_USBIP_HOST=y
CONFIG_USBIP_VUDC=y
# CONFIG_USBIP_DEBUG is not set

#
# USB dual-mode controller drivers
#
CONFIG_USB_CDNS_SUPPORT=y
CONFIG_USB_CDNS3=y
CONFIG_USB_CDNS3_HOST=y
CONFIG_USB_CDNS3_GADGET=y

#
# Platform glue driver support
#
CONFIG_USB_CDNS3_PCI_WRAP=y
CONFIG_USB_CDNSP_PCI=y
CONFIG_USB_MUSB_HDRC=y
# CONFIG_USB_MUSB_HOST is not set
# CONFIG_USB_MUSB_GADGET is not set
CONFIG_USB_MUSB_DUAL_ROLE=y

#
# Platform Glue Layer
#

#
# MUSB DMA mode
#
CONFIG_MUSB_PIO_ONLY=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_ULPI=y
# CONFIG_USB_DWC3_HOST is not set
CONFIG_USB_DWC3_GADGET=y
# CONFIG_USB_DWC3_DUAL_ROLE is not set

#
# Platform Glue Driver Support
#
CONFIG_USB_DWC3_PCI=y
CONFIG_USB_DWC3_HAPS=y
CONFIG_USB_DWC3_OF_SIMPLE=y
CONFIG_USB_DWC3_GENERIC_PLAT=y
# CONFIG_USB_DWC3_GOOGLE is not set
CONFIG_USB_DWC2=y
CONFIG_USB_DWC2_HOST=y

#
# Gadget/Dual-role mode requires USB Gadget support to be enabled
#
# CONFIG_USB_DWC2_PERIPHERAL is not set
# CONFIG_USB_DWC2_DUAL_ROLE is not set
CONFIG_USB_DWC2_PCI=y
# CONFIG_USB_DWC2_DEBUG is not set
# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_UDC=y
CONFIG_USB_CHIPIDEA_HOST=y
CONFIG_USB_CHIPIDEA_PCI=y
CONFIG_USB_CHIPIDEA_MSM=y
CONFIG_USB_CHIPIDEA_NPCM=y
# CONFIG_USB_CHIPIDEA_IMX is not set
CONFIG_USB_CHIPIDEA_GENERIC=y
# CONFIG_USB_CHIPIDEA_TEGRA is not set
CONFIG_USB_ISP1760=y
CONFIG_USB_ISP1760_HCD=y
CONFIG_USB_ISP1761_UDC=y
# CONFIG_USB_ISP1760_HOST_ROLE is not set
# CONFIG_USB_ISP1760_GADGET_ROLE is not set
CONFIG_USB_ISP1760_DUAL_ROLE=y

#
# USB port drivers
#
CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_CONSOLE=y
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_SIMPLE=y
CONFIG_USB_SERIAL_AIRCABLE=y
CONFIG_USB_SERIAL_ARK3116=y
CONFIG_USB_SERIAL_BELKIN=y
CONFIG_USB_SERIAL_CH341=y
CONFIG_USB_SERIAL_WHITEHEAT=y
CONFIG_USB_SERIAL_DIGI_ACCELEPORT=y
CONFIG_USB_SERIAL_CP210X=y
CONFIG_USB_SERIAL_CYPRESS_M8=y
CONFIG_USB_SERIAL_EMPEG=y
CONFIG_USB_SERIAL_FTDI_SIO=y
CONFIG_USB_SERIAL_VISOR=y
CONFIG_USB_SERIAL_IPAQ=y
CONFIG_USB_SERIAL_IR=y
CONFIG_USB_SERIAL_EDGEPORT=y
CONFIG_USB_SERIAL_EDGEPORT_TI=y
CONFIG_USB_SERIAL_F81232=y
CONFIG_USB_SERIAL_F8153X=y
CONFIG_USB_SERIAL_GARMIN=y
CONFIG_USB_SERIAL_IPW=y
CONFIG_USB_SERIAL_IUU=y
CONFIG_USB_SERIAL_KEYSPAN_PDA=y
CONFIG_USB_SERIAL_KEYSPAN=y
CONFIG_USB_SERIAL_KLSI=y
CONFIG_USB_SERIAL_KOBIL_SCT=y
CONFIG_USB_SERIAL_MCT_U232=y
CONFIG_USB_SERIAL_METRO=y
CONFIG_USB_SERIAL_MOS7720=y
CONFIG_USB_SERIAL_MOS7715_PARPORT=y
CONFIG_USB_SERIAL_MOS7840=y
CONFIG_USB_SERIAL_MXUPORT=y
CONFIG_USB_SERIAL_NAVMAN=y
CONFIG_USB_SERIAL_PL2303=y
CONFIG_USB_SERIAL_OTI6858=y
CONFIG_USB_SERIAL_QCAUX=y
CONFIG_USB_SERIAL_QUALCOMM=y
CONFIG_USB_SERIAL_SPCP8X5=y
CONFIG_USB_SERIAL_SAFE=y
# CONFIG_USB_SERIAL_SAFE_PADDED is not set
CONFIG_USB_SERIAL_SIERRAWIRELESS=y
CONFIG_USB_SERIAL_SYMBOL=y
CONFIG_USB_SERIAL_TI=y
CONFIG_USB_SERIAL_CYBERJACK=y
CONFIG_USB_SERIAL_WWAN=y
CONFIG_USB_SERIAL_OPTION=y
CONFIG_USB_SERIAL_OMNINET=y
CONFIG_USB_SERIAL_OPTICON=y
CONFIG_USB_SERIAL_XSENS_MT=y
CONFIG_USB_SERIAL_WISHBONE=y
CONFIG_USB_SERIAL_SSU100=y
CONFIG_USB_SERIAL_QT2=y
CONFIG_USB_SERIAL_UPD78F0730=y
CONFIG_USB_SERIAL_XR=y
CONFIG_USB_SERIAL_DEBUG=y

#
# USB Miscellaneous drivers
#
CONFIG_USB_USS720=y
CONFIG_USB_EMI62=y
CONFIG_USB_EMI26=y
CONFIG_USB_ADUTUX=y
CONFIG_USB_SEVSEG=y
CONFIG_USB_LEGOTOWER=y
CONFIG_USB_LCD=y
CONFIG_USB_CYPRESS_CY7C63=y
CONFIG_USB_CYTHERM=y
CONFIG_USB_IDMOUSE=y
CONFIG_USB_APPLEDISPLAY=y
CONFIG_APPLE_MFI_FASTCHARGE=y
CONFIG_USB_LJCA=y
# CONFIG_USB_USBIO is not set
CONFIG_USB_SISUSBVGA=y
CONFIG_USB_LD=y
CONFIG_USB_TRANCEVIBRATOR=y
CONFIG_USB_IOWARRIOR=y
CONFIG_USB_TEST=y
CONFIG_USB_EHSET_TEST_FIXTURE=y
CONFIG_USB_ISIGHTFW=y
CONFIG_USB_YUREX=y
CONFIG_USB_EZUSB_FX2=y
CONFIG_USB_HUB_USB251XB=y
CONFIG_USB_HSIC_USB3503=y
CONFIG_USB_HSIC_USB4604=y
CONFIG_USB_LINK_LAYER_TEST=y
CONFIG_USB_CHAOSKEY=y
# CONFIG_USB_ONBOARD_DEV is not set
CONFIG_USB_ATM=y
CONFIG_USB_SPEEDTOUCH=y
CONFIG_USB_CXACRU=y
CONFIG_USB_UEAGLEATM=y
CONFIG_USB_XUSBATM=y

#
# USB Physical Layer drivers
#
CONFIG_USB_PHY=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_TAHVO_USB=y
CONFIG_TAHVO_USB_HOST_BY_DEFAULT=y
CONFIG_USB_ISP1301=y
# end of USB Physical Layer drivers

CONFIG_USB_GADGET=y
# CONFIG_USB_GADGET_DEBUG is not set
CONFIG_USB_GADGET_DEBUG_FILES=y
CONFIG_USB_GADGET_DEBUG_FS=y
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
CONFIG_U_SERIAL_CONSOLE=y

#
# USB Peripheral Controller
#
CONFIG_USB_GR_UDC=y
CONFIG_USB_R8A66597=y
CONFIG_USB_PXA27X=y
CONFIG_USB_SNP_CORE=y
# CONFIG_USB_SNP_UDC_PLAT is not set
# CONFIG_USB_M66592 is not set
CONFIG_USB_BDC_UDC=y
CONFIG_USB_AMD5536UDC=y
CONFIG_USB_NET2280=y
CONFIG_USB_GOKU=y
CONFIG_USB_EG20T=y
# CONFIG_USB_GADGET_XILINX is not set
CONFIG_USB_MAX3420_UDC=y
CONFIG_USB_CDNS2_UDC=y
CONFIG_USB_DUMMY_HCD=y
# end of USB Peripheral Controller

CONFIG_USB_LIBCOMPOSITE=y
CONFIG_USB_F_ACM=y
CONFIG_USB_F_SS_LB=y
CONFIG_USB_U_SERIAL=y
CONFIG_USB_U_ETHER=y
CONFIG_USB_U_AUDIO=y
CONFIG_USB_F_SERIAL=y
CONFIG_USB_F_OBEX=y
CONFIG_USB_F_NCM=y
CONFIG_USB_F_ECM=y
CONFIG_USB_F_PHONET=y
CONFIG_USB_F_EEM=y
CONFIG_USB_F_SUBSET=y
CONFIG_USB_F_RNDIS=y
CONFIG_USB_F_MASS_STORAGE=y
CONFIG_USB_F_FS=y
CONFIG_USB_F_UAC1=y
CONFIG_USB_F_UAC1_LEGACY=y
CONFIG_USB_F_UAC2=y
CONFIG_USB_F_UVC=y
CONFIG_USB_F_MIDI=y
CONFIG_USB_F_MIDI2=y
CONFIG_USB_F_HID=y
CONFIG_USB_F_PRINTER=y
CONFIG_USB_F_TCM=y
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_OBEX=y
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_ECM_SUBSET=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_PHONET=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_LB_SS=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_UAC1=y
CONFIG_USB_CONFIGFS_F_UAC1_LEGACY=y
CONFIG_USB_CONFIGFS_F_UAC2=y
CONFIG_USB_CONFIGFS_F_MIDI=y
CONFIG_USB_CONFIGFS_F_MIDI2=y
CONFIG_USB_CONFIGFS_F_HID=y
CONFIG_USB_CONFIGFS_F_UVC=y
CONFIG_USB_CONFIGFS_F_PRINTER=y
CONFIG_USB_CONFIGFS_F_TCM=y

#
# USB Gadget precomposed configurations
#
# CONFIG_USB_ZERO is not set
# CONFIG_USB_AUDIO is not set
# CONFIG_USB_ETH is not set
# CONFIG_USB_G_NCM is not set
CONFIG_USB_GADGETFS=y
# CONFIG_USB_FUNCTIONFS is not set
# CONFIG_USB_MASS_STORAGE is not set
# CONFIG_USB_GADGET_TARGET is not set
# CONFIG_USB_G_SERIAL is not set
# CONFIG_USB_MIDI_GADGET is not set
# CONFIG_USB_G_PRINTER is not set
# CONFIG_USB_CDC_COMPOSITE is not set
# CONFIG_USB_G_NOKIA is not set
# CONFIG_USB_G_ACM_MS is not set
# CONFIG_USB_G_MULTI is not set
# CONFIG_USB_G_HID is not set
# CONFIG_USB_G_DBGP is not set
# CONFIG_USB_G_WEBCAM is not set
CONFIG_USB_RAW_GADGET=y
# end of USB Gadget precomposed configurations

CONFIG_TYPEC=y
CONFIG_TYPEC_TCPM=y
CONFIG_TYPEC_TCPCI=y
CONFIG_TYPEC_RT1711H=y
CONFIG_TYPEC_MT6360=y
CONFIG_TYPEC_TCPCI_MT6370=y
CONFIG_TYPEC_TCPCI_MAXIM=y
CONFIG_TYPEC_FUSB302=y
CONFIG_TYPEC_WCOVE=y
CONFIG_TYPEC_UCSI=y
CONFIG_UCSI_CCG=y
CONFIG_UCSI_ACPI=y
CONFIG_UCSI_STM32G0=y
CONFIG_TYPEC_TPS6598X=y
CONFIG_TYPEC_ANX7411=y
CONFIG_TYPEC_RT1719=y
CONFIG_TYPEC_HD3SS3220=y
CONFIG_TYPEC_STUSB160X=y
CONFIG_TYPEC_WUSB3801=y

#
# USB Type-C Multiplexer/DeMultiplexer Switch support
#
CONFIG_TYPEC_MUX_FSA4480=y
CONFIG_TYPEC_MUX_GPIO_SBU=y
CONFIG_TYPEC_MUX_PI3USB30532=y
CONFIG_TYPEC_MUX_INTEL_PMC=y
# CONFIG_TYPEC_MUX_IT5205 is not set
CONFIG_TYPEC_MUX_NB7VPQ904M=y
# CONFIG_TYPEC_MUX_PS883X is not set
CONFIG_TYPEC_MUX_PTN36502=y
# CONFIG_TYPEC_MUX_TUSB1046 is not set
CONFIG_TYPEC_MUX_WCD939X_USBSS=y
# end of USB Type-C Multiplexer/DeMultiplexer Switch support

#
# USB Type-C Alternate Mode drivers
#
CONFIG_TYPEC_DP_ALTMODE=y
CONFIG_TYPEC_NVIDIA_ALTMODE=y
# CONFIG_TYPEC_TBT_ALTMODE is not set
# end of USB Type-C Alternate Mode drivers

CONFIG_USB_ROLE_SWITCH=y
CONFIG_USB_ROLES_INTEL_XHCI=y
CONFIG_MMC=y
# CONFIG_PWRSEQ_EMMC is not set
# CONFIG_PWRSEQ_SD8787 is not set
# CONFIG_PWRSEQ_SIMPLE is not set
# CONFIG_MMC_BLOCK is not set
# CONFIG_SDIO_UART is not set
# CONFIG_MMC_TEST is not set
# CONFIG_MMC_CRYPTO is not set

#
# MMC/SD/SDIO Host Controller Drivers
#
# CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_SDHCI is not set
# CONFIG_MMC_WBSD is not set
# CONFIG_MMC_TIFM_SD is not set
# CONFIG_MMC_SPI is not set
# CONFIG_MMC_SDRICOH_CS is not set
# CONFIG_MMC_CB710 is not set
# CONFIG_MMC_VIA_SDMMC is not set
CONFIG_MMC_VUB300=y
CONFIG_MMC_USHC=y
# CONFIG_MMC_USDHI6ROL0 is not set
CONFIG_MMC_REALTEK_USB=y
# CONFIG_MMC_CQHCI is not set
# CONFIG_MMC_HSQ is not set
# CONFIG_MMC_TOSHIBA_PCI is not set
# CONFIG_MMC_MTK is not set
# CONFIG_SCSI_UFSHCD is not set
CONFIG_MEMSTICK=y
# CONFIG_MEMSTICK_DEBUG is not set

#
# MemoryStick drivers
#
# CONFIG_MEMSTICK_UNSAFE_RESUME is not set
# CONFIG_MSPRO_BLOCK is not set
# CONFIG_MS_BLOCK is not set

#
# MemoryStick Host Controller Drivers
#
# CONFIG_MEMSTICK_TIFM_MS is not set
# CONFIG_MEMSTICK_JMICRON_38X is not set
# CONFIG_MEMSTICK_R592 is not set
CONFIG_MEMSTICK_REALTEK_USB=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
# CONFIG_LEDS_CLASS_FLASH is not set
CONFIG_LEDS_CLASS_MULTICOLOR=y
# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set

#
# LED drivers
#
# CONFIG_LEDS_AN30259A is not set
# CONFIG_LEDS_APU is not set
# CONFIG_LEDS_OSRAM_AMS_AS3668 is not set
# CONFIG_LEDS_AW200XX is not set
# CONFIG_LEDS_AW2013 is not set
# CONFIG_LEDS_BCM6328 is not set
# CONFIG_LEDS_BCM6358 is not set
# CONFIG_LEDS_CHT_WCOVE is not set
# CONFIG_LEDS_CR0014114 is not set
# CONFIG_LEDS_EL15203000 is not set
# CONFIG_LEDS_LM3530 is not set
# CONFIG_LEDS_LM3532 is not set
# CONFIG_LEDS_LM3642 is not set
# CONFIG_LEDS_LM3692X is not set
# CONFIG_LEDS_PCA9532 is not set
# CONFIG_LEDS_GPIO is not set
# CONFIG_LEDS_LP3944 is not set
# CONFIG_LEDS_LP3952 is not set
# CONFIG_LEDS_LP50XX is not set
# CONFIG_LEDS_LP55XX_COMMON is not set
# CONFIG_LEDS_LP8860 is not set
# CONFIG_LEDS_LP8864 is not set
# CONFIG_LEDS_PCA955X is not set
# CONFIG_LEDS_PCA963X is not set
# CONFIG_LEDS_PCA995X is not set
# CONFIG_LEDS_DAC124S085 is not set
# CONFIG_LEDS_REGULATOR is not set
# CONFIG_LEDS_BD2606MVV is not set
# CONFIG_LEDS_BD2802 is not set
# CONFIG_LEDS_INTEL_SS4200 is not set
# CONFIG_LEDS_LT3593 is not set
# CONFIG_LEDS_TCA6507 is not set
# CONFIG_LEDS_TLC591XX is not set
# CONFIG_LEDS_LM355x is not set
# CONFIG_LEDS_IS31FL319X is not set
# CONFIG_LEDS_IS31FL32XX is not set

#
# LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)
#
# CONFIG_LEDS_BLINKM is not set
# CONFIG_LEDS_SYSCON is not set
# CONFIG_LEDS_MLXCPLD is not set
# CONFIG_LEDS_MLXREG is not set
# CONFIG_LEDS_USER is not set
# CONFIG_LEDS_NIC78BX is not set
# CONFIG_LEDS_SPI_BYTE is not set
# CONFIG_LEDS_LM3697 is not set
# CONFIG_LEDS_ST1202 is not set
# CONFIG_LEDS_LGM is not set

#
# Flash and Torch LED drivers
#

#
# RGB LED drivers
#
# CONFIG_LEDS_GROUP_MULTICOLOR is not set
# CONFIG_LEDS_KTD202X is not set
# CONFIG_LEDS_LP5812 is not set
# CONFIG_LEDS_LP5860_CORE is not set
# CONFIG_LEDS_LP5860_SPI is not set
# CONFIG_LEDS_NCP5623 is not set
# CONFIG_LEDS_MT6370_RGB is not set

#
# LED Triggers
#
CONFIG_LEDS_TRIGGERS=y
# CONFIG_LEDS_TRIGGER_TIMER is not set
# CONFIG_LEDS_TRIGGER_ONESHOT is not set
# CONFIG_LEDS_TRIGGER_DISK is not set
# CONFIG_LEDS_TRIGGER_MTD is not set
# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
# CONFIG_LEDS_TRIGGER_CPU is not set
# CONFIG_LEDS_TRIGGER_ACTIVITY is not set
# CONFIG_LEDS_TRIGGER_GPIO is not set
# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set

#
# iptables trigger is under Netfilter config (LED target)
#
# CONFIG_LEDS_TRIGGER_TRANSIENT is not set
# CONFIG_LEDS_TRIGGER_CAMERA is not set
# CONFIG_LEDS_TRIGGER_PANIC is not set
# CONFIG_LEDS_TRIGGER_NETDEV is not set
# CONFIG_LEDS_TRIGGER_PATTERN is not set
# CONFIG_LEDS_TRIGGER_TTY is not set
# CONFIG_LEDS_TRIGGER_INPUT_EVENTS is not set

#
# Simatic LED drivers
#
# CONFIG_ACCESSIBILITY is not set
CONFIG_INFINIBAND=y
CONFIG_INFINIBAND_USER_MAD=y
CONFIG_INFINIBAND_USER_ACCESS=y
CONFIG_INFINIBAND_USER_ACCESS_CORE=y
CONFIG_INFINIBAND_USER_MEM=y
CONFIG_INFINIBAND_ON_DEMAND_PAGING=y
CONFIG_INFINIBAND_ADDR_TRANS=y
CONFIG_INFINIBAND_ADDR_TRANS_CONFIGFS=y
CONFIG_INFINIBAND_VIRT_DMA=y
# CONFIG_INFINIBAND_EFA is not set
# CONFIG_INFINIBAND_ERDMA is not set
CONFIG_MLX4_INFINIBAND=y
# CONFIG_INFINIBAND_MTHCA is not set
# CONFIG_INFINIBAND_OCRDMA is not set
# CONFIG_INFINIBAND_USNIC is not set
# CONFIG_INFINIBAND_VMWARE_PVRDMA is not set
# CONFIG_INFINIBAND_RDMAVT is not set
CONFIG_RDMA_RXE=y
CONFIG_RDMA_SIW=y
CONFIG_INFINIBAND_IPOIB=y
CONFIG_INFINIBAND_IPOIB_CM=y
CONFIG_INFINIBAND_IPOIB_DEBUG=y
# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
CONFIG_INFINIBAND_SRP=y
# CONFIG_INFINIBAND_SRPT is not set
CONFIG_INFINIBAND_ISER=y
CONFIG_INFINIBAND_RTRS=y
CONFIG_INFINIBAND_RTRS_CLIENT=y
# CONFIG_INFINIBAND_RTRS_SERVER is not set
CONFIG_EDAC_ATOMIC_SCRUB=y
CONFIG_EDAC_SUPPORT=y
CONFIG_EDAC=y
# CONFIG_EDAC_DEBUG is not set
# CONFIG_EDAC_DECODE_MCE is not set
# CONFIG_EDAC_SCRUB is not set
# CONFIG_EDAC_ECS is not set
# CONFIG_EDAC_MEM_REPAIR is not set
# CONFIG_EDAC_E752X is not set
# CONFIG_EDAC_I82975X is not set
# CONFIG_EDAC_I3000 is not set
# CONFIG_EDAC_I3200 is not set
# CONFIG_EDAC_IE31200 is not set
# CONFIG_EDAC_X38 is not set
# CONFIG_EDAC_I5400 is not set
# CONFIG_EDAC_I7CORE is not set
# CONFIG_EDAC_I5100 is not set
# CONFIG_EDAC_I7300 is not set
# CONFIG_EDAC_SBRIDGE is not set
# CONFIG_EDAC_SKX is not set
# CONFIG_EDAC_I10NM is not set
# CONFIG_EDAC_IMH is not set
# CONFIG_EDAC_PND2 is not set
# CONFIG_EDAC_IGEN6 is not set
CONFIG_RTC_LIB=y
CONFIG_RTC_MC146818_LIB=y
CONFIG_RTC_CLASS=y
# CONFIG_RTC_HCTOSYS is not set
CONFIG_RTC_SYSTOHC=y
CONFIG_RTC_SYSTOHC_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set
# CONFIG_RTC_NVMEM is not set

#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
# CONFIG_RTC_DRV_TEST is not set

#
# I2C RTC drivers
#
# CONFIG_RTC_DRV_ABB5ZES3 is not set
# CONFIG_RTC_DRV_ABEOZ9 is not set
# CONFIG_RTC_DRV_ABX80X is not set
# CONFIG_RTC_DRV_DS1307 is not set
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_HYM8563 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_MAX31335 is not set
# CONFIG_RTC_DRV_NCT3018Y is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_ISL12022 is not set
# CONFIG_RTC_DRV_ISL12026 is not set
# CONFIG_RTC_DRV_X1205 is not set
# CONFIG_RTC_DRV_PCF8523 is not set
# CONFIG_RTC_DRV_PCF85363 is not set
# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_PCF8583 is not set
# CONFIG_RTC_DRV_M41T80 is not set
# CONFIG_RTC_DRV_BQ32K is not set
# CONFIG_RTC_DRV_TWL4030 is not set
# CONFIG_RTC_DRV_S35390A is not set
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8010 is not set
# CONFIG_RTC_DRV_RX8111 is not set
# CONFIG_RTC_DRV_RX8581 is not set
# CONFIG_RTC_DRV_RX8025 is not set
# CONFIG_RTC_DRV_EM3027 is not set
# CONFIG_RTC_DRV_RV3028 is not set
# CONFIG_RTC_DRV_RV3032 is not set
# CONFIG_RTC_DRV_RV8803 is not set
# CONFIG_RTC_DRV_SD2405AL is not set
# CONFIG_RTC_DRV_SD3078 is not set

#
# SPI RTC drivers
#
# CONFIG_RTC_DRV_M41T93 is not set
# CONFIG_RTC_DRV_M41T94 is not set
# CONFIG_RTC_DRV_DS1302 is not set
# CONFIG_RTC_DRV_DS1305 is not set
# CONFIG_RTC_DRV_DS1343 is not set
# CONFIG_RTC_DRV_DS1347 is not set
# CONFIG_RTC_DRV_DS1390 is not set
# CONFIG_RTC_DRV_MAX6916 is not set
# CONFIG_RTC_DRV_R9701 is not set
# CONFIG_RTC_DRV_RX4581 is not set
# CONFIG_RTC_DRV_RS5C348 is not set
# CONFIG_RTC_DRV_MAX6902 is not set
# CONFIG_RTC_DRV_PCF2123 is not set
# CONFIG_RTC_DRV_MCP795 is not set
CONFIG_RTC_I2C_AND_SPI=y

#
# SPI and I2C RTC drivers
#
# CONFIG_RTC_DRV_DS3232 is not set
# CONFIG_RTC_DRV_PCF2127 is not set
# CONFIG_RTC_DRV_PCF85063 is not set
# CONFIG_RTC_DRV_RV3029C2 is not set
# CONFIG_RTC_DRV_RX6110 is not set

#
# Platform RTC drivers
#
CONFIG_RTC_DRV_CMOS=y
# CONFIG_RTC_DRV_DS1286 is not set
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1685_FAMILY is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_DS2404 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_MSM6242 is not set
# CONFIG_RTC_DRV_RP5C01 is not set
# CONFIG_RTC_DRV_ZYNQMP is not set

#
# on-CPU RTC drivers
#
# CONFIG_RTC_DRV_CADENCE is not set
# CONFIG_RTC_DRV_FTRTC010 is not set
# CONFIG_RTC_DRV_R7301 is not set
# CONFIG_RTC_DRV_GOLDFISH is not set

#
# HID Sensor RTC drivers
#
CONFIG_RTC_DRV_HID_SENSOR_TIME=y
CONFIG_DMADEVICES=y
# CONFIG_DMADEVICES_DEBUG is not set

#
# DMA Devices
#
CONFIG_DMA_ENGINE=y
CONFIG_DMA_VIRTUAL_CHANNELS=y
CONFIG_DMA_ACPI=y
CONFIG_DMA_OF=y
# CONFIG_ALTERA_MSGDMA is not set
# CONFIG_DW_AXI_DMAC is not set
# CONFIG_FSL_EDMA is not set
CONFIG_INTEL_IDMA64=y
# CONFIG_INTEL_IDXD is not set
# CONFIG_INTEL_IDXD_COMPAT is not set
CONFIG_INTEL_IOATDMA=y
# CONFIG_PLX_DMA is not set
# CONFIG_SWITCHTEC_DMA is not set
# CONFIG_XILINX_DMA is not set
# CONFIG_XILINX_XDMA is not set
# CONFIG_XILINX_ZYNQMP_DPDMA is not set
# CONFIG_AMD_PTDMA is not set
# CONFIG_AMD_QDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
# CONFIG_QCOM_HIDMA is not set
CONFIG_DW_DMAC_CORE=y
# CONFIG_DW_DMAC is not set
# CONFIG_DW_DMAC_PCI is not set
# CONFIG_DW_EDMA is not set
CONFIG_HSU_DMA=y
# CONFIG_SF_PDMA is not set
# CONFIG_INTEL_LDMA is not set

#
# DMA Clients
#
CONFIG_ASYNC_TX_DMA=y
# CONFIG_DMATEST is not set
CONFIG_DMA_ENGINE_RAID=y

#
# DMABUF options
#
CONFIG_SYNC_FILE=y
CONFIG_SW_SYNC=y
CONFIG_UDMABUF=y
# CONFIG_DMABUF_DEBUG is not set
CONFIG_DMABUF_HEAPS=y
CONFIG_DMABUF_HEAPS_SYSTEM=y
# CONFIG_DMABUF_HEAPS_SYSTEM_CC_SHARED is not set
CONFIG_DMABUF_HEAPS_CMA=y
# end of DMABUF options

CONFIG_DCA=y
# CONFIG_UIO is not set
CONFIG_VFIO=y
CONFIG_VFIO_DEVICE_CDEV=y
# CONFIG_VFIO_GROUP is not set
# CONFIG_VFIO_NOIOMMU is not set
CONFIG_VFIO_VIRQFD=y
# CONFIG_VFIO_DEBUGFS is not set

#
# VFIO support for PCI devices
#
CONFIG_VFIO_PCI_CORE=y
CONFIG_VFIO_PCI_INTX=y
CONFIG_VFIO_PCI=y
# CONFIG_VFIO_PCI_VGA is not set
# CONFIG_VFIO_PCI_IGD is not set
# CONFIG_VIRTIO_VFIO_PCI is not set
# end of VFIO support for PCI devices

CONFIG_IRQ_BYPASS_MANAGER=y
# CONFIG_VIRT_DRIVERS is not set
CONFIG_VIRTIO_ANCHOR=y
CONFIG_VIRTIO=y
CONFIG_VIRTIO_PCI_LIB=y
CONFIG_VIRTIO_PCI_LIB_LEGACY=y
CONFIG_VIRTIO_MENU=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_PCI_ADMIN_LEGACY=y
CONFIG_VIRTIO_PCI_LEGACY=y
CONFIG_VIRTIO_VDPA=y
CONFIG_VIRTIO_PMEM=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_MEM=y
CONFIG_VIRTIO_INPUT=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
CONFIG_VIRTIO_DMA_SHARED_BUFFER=y
# CONFIG_VIRTIO_DEBUG is not set
# CONFIG_VIRTIO_RTC is not set
CONFIG_VDPA=y
CONFIG_VDPA_SIM=y
CONFIG_VDPA_SIM_NET=y
CONFIG_VDPA_SIM_BLOCK=y
# CONFIG_VDPA_USER is not set
# CONFIG_IFCVF is not set
# CONFIG_MLX5_VDPA_STEERING_DEBUG is not set
CONFIG_VP_VDPA=y
# CONFIG_ALIBABA_ENI_VDPA is not set
# CONFIG_SNET_VDPA is not set
# CONFIG_OCTEONEP_VDPA is not set
CONFIG_VHOST_IOTLB=y
CONFIG_VHOST_RING=y
CONFIG_VHOST_TASK=y
CONFIG_VHOST=y
CONFIG_VHOST_MENU=y
CONFIG_VHOST_NET=y
# CONFIG_VHOST_SCSI is not set
CONFIG_VHOST_VSOCK=y
CONFIG_VHOST_VDPA=y
CONFIG_VHOST_CROSS_ENDIAN_LEGACY=y
CONFIG_VHOST_ENABLE_FORK_OWNER_CONTROL=y

#
# Microsoft Hyper-V guest support
#
# CONFIG_HYPERV is not set
# end of Microsoft Hyper-V guest support

CONFIG_GREYBUS=y
# CONFIG_GREYBUS_BEAGLEPLAY is not set
CONFIG_GREYBUS_ES2=y
CONFIG_COMEDI=y
# CONFIG_COMEDI_DEBUG is not set
CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB=2048
CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB=20480
CONFIG_COMEDI_MISC_DRIVERS=y
CONFIG_COMEDI_BOND=y
CONFIG_COMEDI_TEST=y
CONFIG_COMEDI_PARPORT=y
CONFIG_COMEDI_ISA_DRIVERS=y
CONFIG_COMEDI_PCL711=y
CONFIG_COMEDI_PCL724=y
CONFIG_COMEDI_PCL726=y
CONFIG_COMEDI_PCL730=y
CONFIG_COMEDI_PCL812=y
CONFIG_COMEDI_PCL816=y
CONFIG_COMEDI_PCL818=y
CONFIG_COMEDI_PCM3724=y
CONFIG_COMEDI_AMPLC_DIO200_ISA=y
CONFIG_COMEDI_AMPLC_PC236_ISA=y
CONFIG_COMEDI_AMPLC_PC263_ISA=y
CONFIG_COMEDI_RTI800=y
CONFIG_COMEDI_RTI802=y
CONFIG_COMEDI_DAC02=y
CONFIG_COMEDI_DAS16M1=y
CONFIG_COMEDI_DAS08_ISA=y
# CONFIG_COMEDI_DAS16 is not set
CONFIG_COMEDI_DAS800=y
CONFIG_COMEDI_DAS1800=y
CONFIG_COMEDI_DAS6402=y
CONFIG_COMEDI_DT2801=y
CONFIG_COMEDI_DT2811=y
CONFIG_COMEDI_DT2814=y
CONFIG_COMEDI_DT2815=y
CONFIG_COMEDI_DT2817=y
CONFIG_COMEDI_DT282X=y
CONFIG_COMEDI_DMM32AT=y
CONFIG_COMEDI_FL512=y
CONFIG_COMEDI_AIO_AIO12_8=y
CONFIG_COMEDI_AIO_IIRO_16=y
# CONFIG_COMEDI_II_PCI20KC is not set
CONFIG_COMEDI_C6XDIGIO=y
CONFIG_COMEDI_MPC624=y
CONFIG_COMEDI_ADQ12B=y
CONFIG_COMEDI_NI_AT_A2150=y
CONFIG_COMEDI_NI_AT_AO=y
# CONFIG_COMEDI_NI_ATMIO is not set
CONFIG_COMEDI_NI_ATMIO16D=y
CONFIG_COMEDI_NI_LABPC_ISA=y
CONFIG_COMEDI_PCMAD=y
CONFIG_COMEDI_PCMDA12=y
CONFIG_COMEDI_PCMMIO=y
CONFIG_COMEDI_PCMUIO=y
CONFIG_COMEDI_MULTIQ3=y
CONFIG_COMEDI_S526=y
CONFIG_COMEDI_PCI_DRIVERS=y
CONFIG_COMEDI_8255_PCI=y
# CONFIG_COMEDI_ADDI_APCI_1032 is not set
# CONFIG_COMEDI_ADDI_APCI_1500 is not set
# CONFIG_COMEDI_ADDI_APCI_1516 is not set
# CONFIG_COMEDI_ADDI_APCI_1564 is not set
# CONFIG_COMEDI_ADDI_APCI_16XX is not set
# CONFIG_COMEDI_ADDI_APCI_2032 is not set
# CONFIG_COMEDI_ADDI_APCI_2200 is not set
# CONFIG_COMEDI_ADDI_APCI_3120 is not set
# CONFIG_COMEDI_ADDI_APCI_3501 is not set
# CONFIG_COMEDI_ADDI_APCI_3XXX is not set
# CONFIG_COMEDI_ADL_PCI6208 is not set
# CONFIG_COMEDI_ADL_PCI7250 is not set
# CONFIG_COMEDI_ADL_PCI7X3X is not set
# CONFIG_COMEDI_ADL_PCI8164 is not set
# CONFIG_COMEDI_ADL_PCI9111 is not set
CONFIG_COMEDI_ADL_PCI9118=y
# CONFIG_COMEDI_ADV_PCI1710 is not set
# CONFIG_COMEDI_ADV_PCI1720 is not set
# CONFIG_COMEDI_ADV_PCI1723 is not set
# CONFIG_COMEDI_ADV_PCI1724 is not set
# CONFIG_COMEDI_ADV_PCI1760 is not set
# CONFIG_COMEDI_ADV_PCI_DIO is not set
# CONFIG_COMEDI_AMPLC_DIO200_PCI is not set
# CONFIG_COMEDI_AMPLC_PC236_PCI is not set
# CONFIG_COMEDI_AMPLC_PC263_PCI is not set
# CONFIG_COMEDI_AMPLC_PCI224 is not set
# CONFIG_COMEDI_AMPLC_PCI230 is not set
# CONFIG_COMEDI_CONTEC_PCI_DIO is not set
# CONFIG_COMEDI_DAS08_PCI is not set
# CONFIG_COMEDI_DT3000 is not set
# CONFIG_COMEDI_DYNA_PCI10XX is not set
# CONFIG_COMEDI_GSC_HPDI is not set
# CONFIG_COMEDI_MF6X4 is not set
# CONFIG_COMEDI_ICP_MULTI is not set
# CONFIG_COMEDI_DAQBOARD2000 is not set
# CONFIG_COMEDI_JR3_PCI is not set
# CONFIG_COMEDI_KE_COUNTER is not set
# CONFIG_COMEDI_CB_PCIDAS64 is not set
# CONFIG_COMEDI_CB_PCIDAS is not set
# CONFIG_COMEDI_CB_PCIDDA is not set
# CONFIG_COMEDI_CB_PCIMDAS is not set
# CONFIG_COMEDI_CB_PCIMDDA is not set
# CONFIG_COMEDI_ME4000 is not set
# CONFIG_COMEDI_ME_DAQ is not set
# CONFIG_COMEDI_NI_6527 is not set
# CONFIG_COMEDI_NI_65XX is not set
# CONFIG_COMEDI_NI_660X is not set
# CONFIG_COMEDI_NI_670X is not set
CONFIG_COMEDI_NI_LABPC_PCI=y
# CONFIG_COMEDI_NI_PCIDIO is not set
# CONFIG_COMEDI_NI_PCIMIO is not set
# CONFIG_COMEDI_RTD520 is not set
# CONFIG_COMEDI_S626 is not set
CONFIG_COMEDI_PCMCIA_DRIVERS=y
# CONFIG_COMEDI_CB_DAS16_CS is not set
# CONFIG_COMEDI_DAS08_CS is not set
CONFIG_COMEDI_NI_DAQ_700_CS=y
# CONFIG_COMEDI_NI_DAQ_DIO24_CS is not set
CONFIG_COMEDI_NI_LABPC_CS=y
# CONFIG_COMEDI_NI_MIO_CS is not set
# CONFIG_COMEDI_QUATECH_DAQP_CS is not set
CONFIG_COMEDI_USB_DRIVERS=y
CONFIG_COMEDI_DT9812=y
CONFIG_COMEDI_NI_USB6501=y
CONFIG_COMEDI_USBDUX=y
CONFIG_COMEDI_USBDUXFAST=y
CONFIG_COMEDI_USBDUXSIGMA=y
CONFIG_COMEDI_VMK80XX=y
CONFIG_COMEDI_8254=y
CONFIG_COMEDI_8255=y
CONFIG_COMEDI_8255_SA=y
CONFIG_COMEDI_KCOMEDILIB=y
CONFIG_COMEDI_AMPLC_DIO200=y
CONFIG_COMEDI_AMPLC_PC236=y
CONFIG_COMEDI_DAS08=y
CONFIG_COMEDI_ISADMA=y
CONFIG_COMEDI_NI_LABPC=y
CONFIG_COMEDI_NI_LABPC_ISADMA=y
# CONFIG_COMEDI_TESTS is not set
# CONFIG_GPIB is not set
CONFIG_STAGING=y
# CONFIG_RTL8723BS is not set

#
# IIO staging drivers
#

#
# Accelerometers
#
# CONFIG_ADIS16203 is not set
# end of Accelerometers

#
# Analog to digital converters
#
# CONFIG_AD7816 is not set
# end of Analog to digital converters

#
# Analog digital bi-direction converters
#
# CONFIG_ADT7316 is not set
# end of Analog digital bi-direction converters

#
# Direct Digital Synthesis
#
# CONFIG_AD9832 is not set
# CONFIG_AD9834 is not set
# end of Direct Digital Synthesis

#
# Network Analyzer, Impedance Converters
#
# CONFIG_AD5933 is not set
# end of Network Analyzer, Impedance Converters
# end of IIO staging drivers

# CONFIG_FB_SM750 is not set
# CONFIG_STAGING_MEDIA is not set
# CONFIG_FB_TFT is not set
# CONFIG_MOST_COMPONENTS is not set
# CONFIG_GREYBUS_AUDIO is not set
# CONFIG_GREYBUS_BOOTROM is not set
# CONFIG_GREYBUS_FIRMWARE is not set
CONFIG_GREYBUS_HID=y
# CONFIG_GREYBUS_LOG is not set
# CONFIG_GREYBUS_LOOPBACK is not set
# CONFIG_GREYBUS_POWER is not set
# CONFIG_GREYBUS_RAW is not set
# CONFIG_GREYBUS_VIBRATOR is not set
CONFIG_GREYBUS_BRIDGED_PHY=y
# CONFIG_GREYBUS_GPIO is not set
# CONFIG_GREYBUS_I2C is not set
# CONFIG_GREYBUS_SDIO is not set
# CONFIG_GREYBUS_SPI is not set
# CONFIG_GREYBUS_UART is not set
CONFIG_GREYBUS_USB=y
# CONFIG_XIL_AXIS_FIFO is not set
# CONFIG_VME_BUS is not set
# CONFIG_GOLDFISH is not set
# CONFIG_CHROME_PLATFORMS is not set
# CONFIG_MELLANOX_PLATFORM is not set
CONFIG_SURFACE_PLATFORMS=y
# CONFIG_SURFACE3_WMI is not set
# CONFIG_SURFACE_3_POWER_OPREGION is not set
# CONFIG_SURFACE_ACPI_NOTIFY is not set
# CONFIG_SURFACE_AGGREGATOR_CDEV is not set
# CONFIG_SURFACE_AGGREGATOR_HUB is not set
CONFIG_SURFACE_AGGREGATOR_REGISTRY=y
# CONFIG_SURFACE_AGGREGATOR_TABLET_SWITCH is not set
# CONFIG_SURFACE_DTX is not set
# CONFIG_SURFACE_GPE is not set
# CONFIG_SURFACE_HOTPLUG is not set
# CONFIG_SURFACE_PLATFORM_PROFILE is not set
# CONFIG_SURFACE_PRO3_BUTTON is not set
CONFIG_SURFACE_AGGREGATOR=y
CONFIG_SURFACE_AGGREGATOR_BUS=y
CONFIG_X86_PLATFORM_DEVICES=y
CONFIG_WMI_BMOF=y
# CONFIG_HUAWEI_WMI is not set
# CONFIG_X86_PLATFORM_DRIVERS_UNIWILL is not set
# CONFIG_MXM_WMI is not set
# CONFIG_NVIDIA_WMI_EC_BACKLIGHT is not set
# CONFIG_XIAOMI_WMI is not set
# CONFIG_REDMI_WMI is not set
# CONFIG_GIGABYTE_WMI is not set
# CONFIG_BITLAND_MIFS_WMI is not set
# CONFIG_ACERHDF is not set
# CONFIG_ACER_WIRELESS is not set
# CONFIG_ACER_WMI is not set

#
# AMD HSMP Driver
#
# CONFIG_AMD_HSMP_ACPI is not set
# CONFIG_AMD_HSMP_PLAT is not set
# end of AMD HSMP Driver

# CONFIG_AMD_PMC is not set
# CONFIG_AMD_HFI is not set
# CONFIG_AMD_3D_VCACHE is not set
# CONFIG_AMD_WBRF is not set
# CONFIG_AMD_ISP_PLATFORM is not set
# CONFIG_ADV_SWBUTTON is not set
# CONFIG_APPLE_GMUX is not set
# CONFIG_ASUS_LAPTOP is not set
# CONFIG_ASUS_WIRELESS is not set
# CONFIG_ASUS_ARMOURY is not set
CONFIG_ASUS_WMI=y
# CONFIG_ASUS_WMI_DEPRECATED_ATTRS is not set
# CONFIG_ASUS_NB_WMI is not set
CONFIG_ASUS_TF103C_DOCK=y
# CONFIG_AYANEO_EC is not set
CONFIG_EEEPC_LAPTOP=y
# CONFIG_EEEPC_WMI is not set
# CONFIG_X86_PLATFORM_DRIVERS_DELL is not set
# CONFIG_AMILO_RFKILL is not set
# CONFIG_FUJITSU_LAPTOP is not set
# CONFIG_FUJITSU_TABLET is not set
# CONFIG_GPD_POCKET_FAN is not set
# CONFIG_X86_PLATFORM_DRIVERS_HP is not set
# CONFIG_WIRELESS_HOTKEY is not set
# CONFIG_IBM_RTL is not set
# CONFIG_SENSORS_HDAPS is not set
# CONFIG_INTEL_ATOMISP2_PM is not set
# CONFIG_INTEL_IFS is not set
# CONFIG_INTEL_SAR_INT1092 is not set
# CONFIG_INTEL_SKL_INT3472 is not set

#
# Intel Speed Select Technology interface support
#
# CONFIG_INTEL_SPEED_SELECT_INTERFACE is not set
# end of Intel Speed Select Technology interface support

# CONFIG_INTEL_WMI_SBL_FW_UPDATE is not set
# CONFIG_INTEL_WMI_THUNDERBOLT is not set

#
# Intel Uncore Frequency Control
#
# CONFIG_INTEL_UNCORE_FREQ_CONTROL is not set
# end of Intel Uncore Frequency Control

# CONFIG_INTEL_HID_EVENT is not set
# CONFIG_INTEL_VBTN is not set
# CONFIG_INTEL_EHL_PSE_IO is not set
# CONFIG_INTEL_INT0002_VGPIO is not set
# CONFIG_INTEL_OAKTRAIL is not set
# CONFIG_INTEL_BXTWC_PMIC_TMU is not set
CONFIG_INTEL_CHTWC_INT33FE=y
CONFIG_INTEL_ISHTP_ECLITE=y
# CONFIG_INTEL_PUNIT_IPC is not set
# CONFIG_INTEL_RST is not set
# CONFIG_INTEL_SMARTCONNECT is not set
# CONFIG_INTEL_TURBO_MAX_3 is not set
# CONFIG_INTEL_VSEC is not set
# CONFIG_IDEAPAD_LAPTOP is not set
# CONFIG_LENOVO_WMI_HOTKEY_UTILITIES is not set
# CONFIG_LENOVO_WMI_CAMERA is not set
# CONFIG_THINKPAD_ACPI is not set
# CONFIG_THINKPAD_LMI is not set
# CONFIG_YOGABOOK is not set
# CONFIG_YT2_1380 is not set
# CONFIG_LENOVO_WMI_GAMEZONE is not set
# CONFIG_LENOVO_WMI_TUNING is not set
# CONFIG_ACPI_QUICKSTART is not set
# CONFIG_MEEGOPAD_ANX7428 is not set
# CONFIG_MSI_EC is not set
# CONFIG_MSI_LAPTOP is not set
# CONFIG_MSI_WMI is not set
# CONFIG_MSI_WMI_PLATFORM is not set
# CONFIG_PCENGINES_APU2 is not set
# CONFIG_PORTWELL_EC is not set
# CONFIG_BARCO_P50_GPIO is not set
# CONFIG_SAMSUNG_GALAXYBOOK is not set
# CONFIG_SAMSUNG_LAPTOP is not set
# CONFIG_SAMSUNG_Q10 is not set
# CONFIG_ACPI_TOSHIBA is not set
# CONFIG_TOSHIBA_BT_RFKILL is not set
# CONFIG_TOSHIBA_HAPS is not set
# CONFIG_TOSHIBA_WMI is not set
# CONFIG_ACPI_CMPC is not set
# CONFIG_COMPAL_LAPTOP is not set
# CONFIG_LG_LAPTOP is not set
# CONFIG_PANASONIC_LAPTOP is not set
# CONFIG_SONY_LAPTOP is not set
# CONFIG_SYSTEM76_ACPI is not set
# CONFIG_TOPSTAR_LAPTOP is not set
# CONFIG_SERIAL_MULTI_INSTANTIATE is not set
# CONFIG_INSPUR_PLATFORM_PROFILE is not set
# CONFIG_DASHARO_ACPI is not set
# CONFIG_INTEL_IPS is not set
CONFIG_INTEL_SCU_IPC=y
# CONFIG_INTEL_SCU_PCI is not set
# CONFIG_INTEL_SCU_PLATFORM is not set
# CONFIG_SIEMENS_SIMATIC_IPC is not set
# CONFIG_SILICOM_PLATFORM is not set
# CONFIG_WINMATE_FM07_KEYS is not set
# CONFIG_OXP_EC is not set
# CONFIG_TUXEDO_NB04_WMI_AB is not set
CONFIG_P2SB=y
CONFIG_ACPI_WMI=y
# CONFIG_ACPI_WMI_LEGACY_DEVICE_NAMES is not set
CONFIG_HAVE_CLK=y
CONFIG_HAVE_CLK_PREPARE=y
CONFIG_COMMON_CLK=y
# CONFIG_LMK04832 is not set
# CONFIG_COMMON_CLK_MAX9485 is not set
# CONFIG_COMMON_CLK_SI5341 is not set
# CONFIG_COMMON_CLK_SI5351 is not set
# CONFIG_COMMON_CLK_SI514 is not set
# CONFIG_COMMON_CLK_SI544 is not set
# CONFIG_COMMON_CLK_SI570 is not set
# CONFIG_COMMON_CLK_CDCE706 is not set
# CONFIG_COMMON_CLK_CDCE925 is not set
# CONFIG_COMMON_CLK_CS2000_CP is not set
# CONFIG_CLK_TWL is not set
# CONFIG_COMMON_CLK_AXI_CLKGEN is not set
# CONFIG_COMMON_CLK_RS9_PCIE is not set
# CONFIG_COMMON_CLK_SI521XX is not set
# CONFIG_COMMON_CLK_VC3 is not set
# CONFIG_COMMON_CLK_VC5 is not set
# CONFIG_COMMON_CLK_VC7 is not set
# CONFIG_COMMON_CLK_FIXED_MMIO is not set
# CONFIG_CLK_LGM_CGU is not set
# CONFIG_XILINX_VCU is not set
# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set
# CONFIG_HWSPINLOCK is not set

#
# Clock Source drivers
#
CONFIG_CLKEVT_I8253=y
CONFIG_I8253_LOCK=y
CONFIG_CLKBLD_I8253=y
# end of Clock Source drivers

CONFIG_MAILBOX=y
# CONFIG_PLATFORM_MHU is not set
CONFIG_PCC=y
# CONFIG_ALTERA_MBOX is not set
# CONFIG_MAILBOX_TEST is not set
CONFIG_IOMMU_IOVA=y
CONFIG_IOMMU_API=y
CONFIG_IOMMUFD_DRIVER=y
CONFIG_IOMMU_SUPPORT=y

#
# Generic IOMMU Pagetable Support
#
# end of Generic IOMMU Pagetable Support

# CONFIG_IOMMU_DEBUGFS is not set
# CONFIG_IOMMU_DEFAULT_DMA_STRICT is not set
CONFIG_IOMMU_DEFAULT_DMA_LAZY=y
# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
CONFIG_OF_IOMMU=y
CONFIG_IOMMU_DMA=y
CONFIG_IOMMU_SVA=y
CONFIG_IOMMU_IOPF=y
CONFIG_AMD_IOMMU=y
# CONFIG_AMD_IOMMU_IOMMUFD is not set
CONFIG_DMAR_TABLE=y
CONFIG_INTEL_IOMMU=y
CONFIG_INTEL_IOMMU_SVM=y
CONFIG_INTEL_IOMMU_DEFAULT_ON=y
CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON=y
CONFIG_INTEL_IOMMU_PERF_EVENTS=y
CONFIG_IOMMUFD_DRIVER_CORE=y
CONFIG_IOMMUFD=y
CONFIG_IOMMUFD_TEST=y
CONFIG_IRQ_REMAP=y
# CONFIG_VIRTIO_IOMMU is not set
CONFIG_GENERIC_PT=y
CONFIG_DEBUG_GENERIC_PT=y
CONFIG_IOMMU_PT=y
CONFIG_IOMMU_PT_AMDV1=y
CONFIG_IOMMU_PT_VTDSS=y
# CONFIG_IOMMU_PT_RISCV64 is not set
CONFIG_IOMMU_PT_X86_64=y

#
# Remoteproc drivers
#
# CONFIG_REMOTEPROC is not set
# end of Remoteproc drivers

#
# Rpmsg drivers
#
# CONFIG_RPMSG_QCOM_GLINK_RPM is not set
# CONFIG_RPMSG_VIRTIO is not set
# end of Rpmsg drivers

CONFIG_SOUNDWIRE=y

#
# SoundWire Devices
#
# CONFIG_SOUNDWIRE_AMD is not set
# CONFIG_SOUNDWIRE_INTEL is not set
# CONFIG_SOUNDWIRE_QCOM is not set

#
# SOC (System On Chip) specific Drivers
#

#
# Amlogic SoC drivers
#
# end of Amlogic SoC drivers

#
# Broadcom SoC drivers
#
# end of Broadcom SoC drivers

#
# NXP/Freescale QorIQ SoC drivers
#
# end of NXP/Freescale QorIQ SoC drivers

#
# fujitsu SoC drivers
#
# end of fujitsu SoC drivers

#
# i.MX SoC drivers
#
# end of i.MX SoC drivers

#
# Enable LiteX SoC Builder specific drivers
#
# CONFIG_LITEX_SOC_CONTROLLER is not set
# end of Enable LiteX SoC Builder specific drivers

# CONFIG_WPCM450_SOC is not set
CONFIG_QCOM_QMI_HELPERS=y
# CONFIG_SOC_TI is not set

#
# Xilinx SoC drivers
#
# end of Xilinx SoC drivers
# end of SOC (System On Chip) specific Drivers

#
# PM Domains
#

#
# Amlogic PM Domains
#
# end of Amlogic PM Domains

#
# Broadcom PM Domains
#
# end of Broadcom PM Domains

#
# i.MX PM Domains
#
# end of i.MX PM Domains

#
# Qualcomm PM Domains
#
# end of Qualcomm PM Domains
# end of PM Domains

# CONFIG_PM_DEVFREQ is not set
CONFIG_EXTCON=y

#
# Extcon Device Drivers
#
# CONFIG_EXTCON_ADC_JACK is not set
# CONFIG_EXTCON_FSA9480 is not set
# CONFIG_EXTCON_GPIO is not set
# CONFIG_EXTCON_INTEL_INT3496 is not set
CONFIG_EXTCON_INTEL_CHT_WC=y
# CONFIG_EXTCON_LC824206XA is not set
# CONFIG_EXTCON_MAX3355 is not set
# CONFIG_EXTCON_MAX14526 is not set
CONFIG_EXTCON_PTN5150=y
# CONFIG_EXTCON_RT8973A is not set
# CONFIG_EXTCON_SM5502 is not set
# CONFIG_EXTCON_USB_GPIO is not set
CONFIG_EXTCON_USBC_TUSB320=y
# CONFIG_MEMORY is not set
CONFIG_IIO=y
CONFIG_IIO_BUFFER=y
# CONFIG_IIO_BUFFER_CB is not set
# CONFIG_IIO_BUFFER_DMA is not set
# CONFIG_IIO_BUFFER_DMAENGINE is not set
# CONFIG_IIO_BUFFER_HW_CONSUMER is not set
CONFIG_IIO_KFIFO_BUF=y
CONFIG_IIO_TRIGGERED_BUFFER=y
# CONFIG_IIO_CONFIGFS is not set
CONFIG_IIO_TRIGGER=y
CONFIG_IIO_CONSUMERS_PER_TRIGGER=2
# CONFIG_IIO_SW_DEVICE is not set
# CONFIG_IIO_SW_TRIGGER is not set
# CONFIG_IIO_TRIGGERED_EVENT is not set

#
# Accelerometers
#
# CONFIG_ADIS16201 is not set
# CONFIG_ADIS16209 is not set
# CONFIG_ADXL313_I2C is not set
# CONFIG_ADXL313_SPI is not set
# CONFIG_ADXL345_I2C is not set
# CONFIG_ADXL345_SPI is not set
# CONFIG_ADXL355_I2C is not set
# CONFIG_ADXL355_SPI is not set
# CONFIG_ADXL367_SPI is not set
# CONFIG_ADXL367_I2C is not set
# CONFIG_ADXL372_SPI is not set
# CONFIG_ADXL372_I2C is not set
# CONFIG_ADXL380_SPI is not set
# CONFIG_ADXL380_I2C is not set
# CONFIG_BMA180 is not set
# CONFIG_BMA220 is not set
# CONFIG_BMA400 is not set
# CONFIG_BMC150_ACCEL is not set
# CONFIG_BMI088_ACCEL is not set
# CONFIG_DA280 is not set
# CONFIG_DA311 is not set
# CONFIG_DMARD06 is not set
# CONFIG_DMARD09 is not set
# CONFIG_DMARD10 is not set
# CONFIG_FXLS8962AF_I2C is not set
# CONFIG_FXLS8962AF_SPI is not set
CONFIG_HID_SENSOR_ACCEL_3D=y
# CONFIG_IIO_ST_ACCEL_3AXIS is not set
# CONFIG_IIO_KX022A_SPI is not set
# CONFIG_IIO_KX022A_I2C is not set
# CONFIG_KXSD9 is not set
# CONFIG_KXCJK1013 is not set
# CONFIG_MC3230 is not set
# CONFIG_MMA7455_I2C is not set
# CONFIG_MMA7455_SPI is not set
# CONFIG_MMA7660 is not set
# CONFIG_MMA8452 is not set
# CONFIG_MMA9551 is not set
# CONFIG_MMA9553 is not set
# CONFIG_MSA311 is not set
# CONFIG_MXC4005 is not set
# CONFIG_MXC6255 is not set
# CONFIG_SCA3000 is not set
# CONFIG_SCA3300 is not set
# CONFIG_STK8312 is not set
# CONFIG_STK8BA50 is not set
# end of Accelerometers

#
# Analog to digital converters
#
# CONFIG_AD4000 is not set
# CONFIG_AD4080 is not set
# CONFIG_AD4130 is not set
# CONFIG_AD4134 is not set
# CONFIG_AD4170_4 is not set
# CONFIG_AD4691 is not set
# CONFIG_AD4695 is not set
# CONFIG_AD7091R5 is not set
# CONFIG_AD7091R8 is not set
# CONFIG_AD7124 is not set
# CONFIG_AD7173 is not set
# CONFIG_AD7191 is not set
# CONFIG_AD7192 is not set
# CONFIG_AD7266 is not set
# CONFIG_AD7280 is not set
# CONFIG_AD7291 is not set
# CONFIG_AD7292 is not set
# CONFIG_AD7298 is not set
# CONFIG_AD7380 is not set
# CONFIG_AD7476 is not set
# CONFIG_AD7606_IFACE_PARALLEL is not set
# CONFIG_AD7606_IFACE_SPI is not set
# CONFIG_AD7766 is not set
# CONFIG_AD7768_1 is not set
# CONFIG_AD7779 is not set
# CONFIG_AD7780 is not set
# CONFIG_AD7791 is not set
# CONFIG_AD7793 is not set
# CONFIG_AD7887 is not set
# CONFIG_AD7923 is not set
# CONFIG_AD7944 is not set
# CONFIG_AD7949 is not set
# CONFIG_AD799X is not set
# CONFIG_AD9467 is not set
# CONFIG_ADE9000 is not set
# CONFIG_CC10001_ADC is not set
CONFIG_DLN2_ADC=y
# CONFIG_ENVELOPE_DETECTOR is not set
# CONFIG_GEHC_PMC_ADC is not set
# CONFIG_HI8435 is not set
# CONFIG_HX711 is not set
# CONFIG_INA2XX_ADC is not set
# CONFIG_LTC2309 is not set
# CONFIG_LTC2471 is not set
# CONFIG_LTC2485 is not set
# CONFIG_LTC2496 is not set
# CONFIG_LTC2497 is not set
# CONFIG_MAX1027 is not set
# CONFIG_MAX11100 is not set
# CONFIG_MAX1118 is not set
# CONFIG_MAX11205 is not set
# CONFIG_MAX11410 is not set
# CONFIG_MAX1241 is not set
# CONFIG_MAX1363 is not set
# CONFIG_MAX14001 is not set
# CONFIG_MAX34408 is not set
# CONFIG_MAX9611 is not set
# CONFIG_MCP320X is not set
# CONFIG_MCP3422 is not set
# CONFIG_MCP3564 is not set
# CONFIG_MCP3911 is not set
# CONFIG_MEDIATEK_MT6360_ADC is not set
# CONFIG_MEDIATEK_MT6370_ADC is not set
# CONFIG_NAU7802 is not set
# CONFIG_NCT7201 is not set
# CONFIG_PAC1921 is not set
# CONFIG_PAC1934 is not set
# CONFIG_ROHM_BD79112 is not set
# CONFIG_ROHM_BD79124 is not set
# CONFIG_RICHTEK_RTQ6056 is not set
# CONFIG_SD_ADC_MODULATOR is not set
# CONFIG_TI_ADC081C is not set
# CONFIG_TI_ADC0832 is not set
# CONFIG_TI_ADC084S021 is not set
# CONFIG_TI_ADC108S102 is not set
# CONFIG_TI_ADC12138 is not set
# CONFIG_TI_ADC128S052 is not set
# CONFIG_TI_ADC161S626 is not set
# CONFIG_TI_ADS1015 is not set
# CONFIG_TI_ADS1018 is not set
# CONFIG_TI_ADS1100 is not set
# CONFIG_TI_ADS1119 is not set
# CONFIG_TI_ADS124S08 is not set
# CONFIG_TI_ADS1298 is not set
# CONFIG_TI_ADS131E08 is not set
# CONFIG_TI_ADS131M02 is not set
# CONFIG_TI_ADS7138 is not set
# CONFIG_TI_ADS7924 is not set
# CONFIG_TI_ADS7950 is not set
# CONFIG_TI_ADS8344 is not set
# CONFIG_TI_ADS8688 is not set
# CONFIG_TI_LMP92064 is not set
# CONFIG_TI_TLC4541 is not set
# CONFIG_TI_TSC2046 is not set
# CONFIG_TWL4030_MADC is not set
# CONFIG_TWL6030_GPADC is not set
# CONFIG_VF610_ADC is not set
CONFIG_VIPERBOARD_ADC=y
# CONFIG_XILINX_XADC is not set
# end of Analog to digital converters

#
# Analog to digital and digital to analog converters
#
# CONFIG_AD74115 is not set
# CONFIG_AD74413R is not set
# end of Analog to digital and digital to analog converters

#
# Analog Front Ends
#
# CONFIG_IIO_RESCALE is not set
# end of Analog Front Ends

#
# Amplifiers
#
# CONFIG_AD8366 is not set
# CONFIG_ADA4250 is not set
# CONFIG_ADL8113 is not set
# CONFIG_HMC425 is not set
# end of Amplifiers

#
# Capacitance to digital converters
#
# CONFIG_AD7150 is not set
# CONFIG_AD7746 is not set
# end of Capacitance to digital converters

#
# Chemical Sensors
#
# CONFIG_AOSONG_AGS02MA is not set
# CONFIG_ATLAS_PH_SENSOR is not set
# CONFIG_ATLAS_EZO_SENSOR is not set
# CONFIG_BME680 is not set
# CONFIG_CCS811 is not set
# CONFIG_ENS160 is not set
# CONFIG_IAQCORE is not set
# CONFIG_MHZ19B is not set
# CONFIG_PMS7003 is not set
# CONFIG_SCD30_CORE is not set
# CONFIG_SCD4X is not set
# CONFIG_SEN0322 is not set
# CONFIG_SENSIRION_SGP30 is not set
# CONFIG_SENSIRION_SGP40 is not set
# CONFIG_SPS30_I2C is not set
# CONFIG_SPS30_SERIAL is not set
# CONFIG_SENSEAIR_SUNRISE_CO2 is not set
# CONFIG_VZ89X is not set
# end of Chemical Sensors

#
# Hid Sensor IIO Common
#
CONFIG_HID_SENSOR_IIO_COMMON=y
CONFIG_HID_SENSOR_IIO_TRIGGER=y
# end of Hid Sensor IIO Common

#
# IIO SCMI Sensors
#
# end of IIO SCMI Sensors

#
# SSP Sensor Common
#
# CONFIG_IIO_SSP_SENSORHUB is not set
# end of SSP Sensor Common

#
# Digital to analog converters
#
# CONFIG_AD3530R is not set
# CONFIG_AD3552R_HS is not set
# CONFIG_AD3552R is not set
# CONFIG_AD5064 is not set
# CONFIG_AD5360 is not set
# CONFIG_AD5380 is not set
# CONFIG_AD5421 is not set
# CONFIG_AD5446_SPI is not set
# CONFIG_AD5446_I2C is not set
# CONFIG_AD5449 is not set
# CONFIG_AD5592R is not set
# CONFIG_AD5593R is not set
# CONFIG_AD5504 is not set
# CONFIG_AD5624R_SPI is not set
# CONFIG_AD5706R is not set
# CONFIG_AD9739A is not set
# CONFIG_LTC2688 is not set
# CONFIG_AD5686_SPI is not set
# CONFIG_AD5696_I2C is not set
# CONFIG_AD5755 is not set
# CONFIG_AD5758 is not set
# CONFIG_AD5761 is not set
# CONFIG_AD5764 is not set
# CONFIG_AD5766 is not set
# CONFIG_AD5770R is not set
# CONFIG_AD5791 is not set
# CONFIG_AD7293 is not set
# CONFIG_AD7303 is not set
# CONFIG_AD8460 is not set
# CONFIG_AD8801 is not set
# CONFIG_BD79703 is not set
# CONFIG_CIO_DAC is not set
# CONFIG_DPOT_DAC is not set
# CONFIG_DS4424 is not set
# CONFIG_LTC1660 is not set
# CONFIG_LTC2632 is not set
# CONFIG_LTC2664 is not set
# CONFIG_M62332 is not set
# CONFIG_MAX517 is not set
# CONFIG_MAX22007 is not set
# CONFIG_MAX5522 is not set
# CONFIG_MAX5821 is not set
# CONFIG_MCP4725 is not set
# CONFIG_MCP4728 is not set
# CONFIG_MCP47FEB02 is not set
# CONFIG_MCP4821 is not set
# CONFIG_MCP4922 is not set
# CONFIG_TI_DAC082S085 is not set
# CONFIG_TI_DAC5571 is not set
# CONFIG_TI_DAC7311 is not set
# CONFIG_TI_DAC7612 is not set
# CONFIG_VF610_DAC is not set
# end of Digital to analog converters

#
# IIO dummy driver
#
# end of IIO dummy driver

#
# Filters
#
# CONFIG_ADMV8818 is not set
# end of Filters

#
# Frequency Synthesizers DDS/PLL
#

#
# Clock Generator/Distribution
#
# CONFIG_AD9523 is not set
# end of Clock Generator/Distribution

#
# Phase-Locked Loop (PLL) frequency synthesizers
#
# CONFIG_ADF4350 is not set
# CONFIG_ADF4371 is not set
# CONFIG_ADF4377 is not set
# CONFIG_ADMFM2000 is not set
# CONFIG_ADMV1013 is not set
# CONFIG_ADMV1014 is not set
# CONFIG_ADMV4420 is not set
# CONFIG_ADRF6780 is not set
# end of Phase-Locked Loop (PLL) frequency synthesizers
# end of Frequency Synthesizers DDS/PLL

#
# Digital gyroscope sensors
#
# CONFIG_ADIS16080 is not set
# CONFIG_ADIS16130 is not set
# CONFIG_ADIS16136 is not set
# CONFIG_ADIS16260 is not set
# CONFIG_ADXRS290 is not set
# CONFIG_ADXRS450 is not set
# CONFIG_BMG160 is not set
# CONFIG_FXAS21002C is not set
CONFIG_HID_SENSOR_GYRO_3D=y
# CONFIG_MPU3050_I2C is not set
# CONFIG_IIO_ST_GYRO_3AXIS is not set
# CONFIG_ITG3200 is not set
# end of Digital gyroscope sensors

#
# Health Sensors
#

#
# Heart Rate Monitors
#
# CONFIG_AFE4403 is not set
# CONFIG_AFE4404 is not set
# CONFIG_MAX30100 is not set
# CONFIG_MAX30102 is not set
# end of Heart Rate Monitors
# end of Health Sensors

#
# Humidity sensors
#
# CONFIG_AM2315 is not set
# CONFIG_DHT11 is not set
# CONFIG_ENS210 is not set
# CONFIG_HDC100X is not set
# CONFIG_HDC2010 is not set
# CONFIG_HDC3020 is not set
CONFIG_HID_SENSOR_HUMIDITY=y
# CONFIG_HTS221 is not set
# CONFIG_HTU21 is not set
# CONFIG_SI7005 is not set
# CONFIG_SI7020 is not set
# end of Humidity sensors

#
# Inertial measurement units
#
# CONFIG_ADIS16400 is not set
# CONFIG_ADIS16460 is not set
# CONFIG_ADIS16475 is not set
# CONFIG_ADIS16480 is not set
# CONFIG_ADIS16550 is not set
# CONFIG_BMI160_I2C is not set
# CONFIG_BMI160_SPI is not set
# CONFIG_BMI270_I2C is not set
# CONFIG_BMI270_SPI is not set
# CONFIG_BMI323_I2C is not set
# CONFIG_BMI323_SPI is not set
# CONFIG_BOSCH_BNO055_SERIAL is not set
# CONFIG_BOSCH_BNO055_I2C is not set
# CONFIG_FXOS8700_I2C is not set
# CONFIG_FXOS8700_SPI is not set
# CONFIG_KMX61 is not set
# CONFIG_INV_ICM42600_I2C is not set
# CONFIG_INV_ICM42600_SPI is not set
# CONFIG_INV_ICM45600_I2C is not set
# CONFIG_INV_ICM45600_SPI is not set
# CONFIG_INV_MPU6050_I2C is not set
# CONFIG_INV_MPU6050_SPI is not set
# CONFIG_SMI240 is not set
# CONFIG_SMI330_I2C is not set
# CONFIG_SMI330_SPI is not set
# CONFIG_IIO_ST_LSM6DSX is not set
# CONFIG_IIO_ST_LSM9DS0 is not set
# end of Inertial measurement units

#
# Light sensors
#
# CONFIG_ACPI_ALS is not set
# CONFIG_ADJD_S311 is not set
# CONFIG_ADUX1020 is not set
# CONFIG_AL3000A is not set
# CONFIG_AL3010 is not set
# CONFIG_AL3320A is not set
# CONFIG_APDS9160 is not set
# CONFIG_APDS9300 is not set
# CONFIG_APDS9306 is not set
# CONFIG_APDS9960 is not set
# CONFIG_APDS9999 is not set
# CONFIG_AS73211 is not set
# CONFIG_BH1745 is not set
# CONFIG_BH1750 is not set
# CONFIG_BH1780 is not set
# CONFIG_CM32181 is not set
# CONFIG_CM3232 is not set
# CONFIG_CM3323 is not set
# CONFIG_CM3605 is not set
# CONFIG_CM36651 is not set
# CONFIG_GP2AP002 is not set
# CONFIG_GP2AP020A00F is not set
# CONFIG_SENSORS_ISL29018 is not set
# CONFIG_SENSORS_ISL29028 is not set
# CONFIG_ISL29125 is not set
# CONFIG_ISL76682 is not set
CONFIG_HID_SENSOR_ALS=y
CONFIG_HID_SENSOR_PROX=y
# CONFIG_JSA1212 is not set
# CONFIG_ROHM_BU27034 is not set
# CONFIG_RPR0521 is not set
# CONFIG_LTR390 is not set
# CONFIG_LTR501 is not set
# CONFIG_LTRF216A is not set
# CONFIG_LV0104CS is not set
# CONFIG_MAX44000 is not set
# CONFIG_MAX44009 is not set
# CONFIG_NOA1305 is not set
# CONFIG_OPT3001 is not set
# CONFIG_OPT4001 is not set
# CONFIG_OPT4060 is not set
# CONFIG_PA12203001 is not set
# CONFIG_SI1133 is not set
# CONFIG_SI1145 is not set
# CONFIG_STK3310 is not set
# CONFIG_ST_UVIS25 is not set
# CONFIG_TCS3414 is not set
# CONFIG_TCS3472 is not set
# CONFIG_SENSORS_TSL2563 is not set
# CONFIG_TSL2583 is not set
# CONFIG_TSL2591 is not set
# CONFIG_TSL2772 is not set
# CONFIG_TSL4531 is not set
# CONFIG_US5182D is not set
# CONFIG_VCNL4000 is not set
# CONFIG_VCNL4035 is not set
# CONFIG_VEML3235 is not set
# CONFIG_VEML3328 is not set
# CONFIG_VEML6030 is not set
# CONFIG_VEML6040 is not set
# CONFIG_VEML6046X00 is not set
# CONFIG_VEML6070 is not set
# CONFIG_VEML6075 is not set
# CONFIG_VL6180 is not set
# CONFIG_ZOPT2201 is not set
# end of Light sensors

#
# Magnetometer sensors
#
# CONFIG_AF8133J is not set
# CONFIG_AK8974 is not set
# CONFIG_AK8975 is not set
# CONFIG_AK09911 is not set
# CONFIG_ALS31300 is not set
# CONFIG_BMC150_MAGN_I2C is not set
# CONFIG_BMC150_MAGN_SPI is not set
# CONFIG_MAG3110 is not set
CONFIG_HID_SENSOR_MAGNETOMETER_3D=y
# CONFIG_MMC35240 is not set
# CONFIG_MMC5633 is not set
# CONFIG_MMC5983 is not set
# CONFIG_IIO_ST_MAGN_3AXIS is not set
# CONFIG_INFINEON_TLV493D is not set
# CONFIG_SENSORS_HMC5843_I2C is not set
# CONFIG_SENSORS_HMC5843_SPI is not set
# CONFIG_SENSORS_RM3100_I2C is not set
# CONFIG_SENSORS_RM3100_SPI is not set
# CONFIG_SI7210 is not set
# CONFIG_TI_TMAG5273 is not set
# CONFIG_YAMAHA_YAS530 is not set
# end of Magnetometer sensors

#
# Multiplexers
#
# CONFIG_IIO_MUX is not set
# end of Multiplexers

#
# Inclinometer sensors
#
CONFIG_HID_SENSOR_INCLINOMETER_3D=y
CONFIG_HID_SENSOR_DEVICE_ROTATION=y
# end of Inclinometer sensors

#
# Triggers - standalone
#
# CONFIG_IIO_SYSFS_TRIGGER is not set
# end of Triggers - standalone

#
# Linear and angular position sensors
#
CONFIG_HID_SENSOR_CUSTOM_INTEL_HINGE=y
# end of Linear and angular position sensors

#
# Digital potentiometers
#
# CONFIG_AD5110 is not set
# CONFIG_AD5272 is not set
# CONFIG_DS1803 is not set
# CONFIG_MAX5432 is not set
# CONFIG_MAX5481 is not set
# CONFIG_MAX5487 is not set
# CONFIG_MCP4018 is not set
# CONFIG_MCP4131 is not set
# CONFIG_MCP4531 is not set
# CONFIG_MCP41010 is not set
# CONFIG_TPL0102 is not set
# CONFIG_X9250 is not set
# end of Digital potentiometers

#
# Digital potentiostats
#
# CONFIG_LMP91000 is not set
# end of Digital potentiostats

#
# Pressure sensors
#
# CONFIG_ABP060MG is not set
# CONFIG_ABP2030PA_I2C is not set
# CONFIG_ABP2030PA_SPI is not set
# CONFIG_ROHM_BM1390 is not set
# CONFIG_BMP280 is not set
# CONFIG_DLHL60D is not set
# CONFIG_DPS310 is not set
CONFIG_HID_SENSOR_PRESS=y
# CONFIG_HP03 is not set
# CONFIG_HSC030PA is not set
# CONFIG_ICP10100 is not set
# CONFIG_MPL115_I2C is not set
# CONFIG_MPL115_SPI is not set
# CONFIG_MPL3115 is not set
# CONFIG_MPRLS0025PA_I2C is not set
# CONFIG_MPRLS0025PA_SPI is not set
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_SDP500 is not set
# CONFIG_IIO_ST_PRESS is not set
# CONFIG_T5403 is not set
# CONFIG_HP206C is not set
# CONFIG_ZPA2326 is not set
# CONFIG_ADP810 is not set
# end of Pressure sensors

#
# Lightning sensors
#
# CONFIG_AS3935 is not set
# end of Lightning sensors

#
# Proximity and distance sensors
#
# CONFIG_D3323AA is not set
# CONFIG_HX9023S is not set
# CONFIG_IRSD200 is not set
# CONFIG_ISL29501 is not set
# CONFIG_LIDAR_LITE_V2 is not set
# CONFIG_MB1232 is not set
# CONFIG_PING is not set
# CONFIG_RFD77402 is not set
# CONFIG_SRF04 is not set
# CONFIG_SX9310 is not set
# CONFIG_SX9324 is not set
# CONFIG_SX9360 is not set
# CONFIG_SX9500 is not set
# CONFIG_SRF08 is not set
# CONFIG_VCNL3020 is not set
# CONFIG_VL53L0X_I2C is not set
# CONFIG_VL53L1X_I2C is not set
# CONFIG_AW96103 is not set
# end of Proximity and distance sensors

#
# Resolver to digital converters
#
# CONFIG_AD2S90 is not set
# CONFIG_AD2S1200 is not set
# CONFIG_AD2S1210 is not set
# end of Resolver to digital converters

#
# Temperature sensors
#
# CONFIG_LTC2983 is not set
# CONFIG_MAXIM_THERMOCOUPLE is not set
CONFIG_HID_SENSOR_TEMP=y
# CONFIG_MLX90614 is not set
# CONFIG_MLX90632 is not set
# CONFIG_MLX90635 is not set
# CONFIG_TMP006 is not set
# CONFIG_TMP007 is not set
# CONFIG_TMP117 is not set
# CONFIG_TSYS01 is not set
# CONFIG_TSYS02D is not set
# CONFIG_MAX30208 is not set
# CONFIG_MAX31856 is not set
# CONFIG_MAX31865 is not set
# CONFIG_MCP9600 is not set
# end of Temperature sensors

# CONFIG_NTB is not set
# CONFIG_PWM is not set

#
# IRQ chip support
#
CONFIG_IRQCHIP=y
CONFIG_IRQ_MSI_LIB=y
# CONFIG_AL_FIC is not set
# CONFIG_XILINX_INTC is not set
# end of IRQ chip support

# CONFIG_IPACK_BUS is not set
CONFIG_RESET_CONTROLLER=y
# CONFIG_RESET_GPIO is not set
# CONFIG_RESET_INTEL_GW is not set
# CONFIG_RESET_SIMPLE is not set
# CONFIG_RESET_TI_SYSCON is not set
# CONFIG_RESET_TI_TPS380X is not set

#
# PHY Subsystem
#
CONFIG_GENERIC_PHY=y
# CONFIG_PHY_CAN_TRANSCEIVER is not set
CONFIG_PHY_GOOGLE_USB=y
CONFIG_USB_LGM_PHY=y
# CONFIG_PHY_NXP_PTN3222 is not set
# CONFIG_PHY_NXP_TJA1145 is not set

#
# PHY drivers for Broadcom platforms
#
# CONFIG_BCM_KONA_USB2_PHY is not set
# end of PHY drivers for Broadcom platforms

# CONFIG_PHY_CADENCE_TORRENT is not set
# CONFIG_PHY_CADENCE_DPHY is not set
# CONFIG_PHY_CADENCE_DPHY_RX is not set
# CONFIG_PHY_CADENCE_SIERRA is not set
# CONFIG_PHY_CADENCE_SALVO is not set
# CONFIG_PHY_INTEL_LGM_COMBO is not set
# CONFIG_PHY_INTEL_LGM_EMMC is not set
# CONFIG_PHY_PXA_28NM_HSIC is not set
# CONFIG_PHY_PXA_28NM_USB2 is not set
CONFIG_PHY_CPCAP_USB=y
# CONFIG_PHY_MAPPHONE_MDM6600 is not set
# CONFIG_PHY_OCELOT_SERDES is not set
CONFIG_PHY_QCOM_USB_HS=y
CONFIG_PHY_QCOM_USB_HSIC=y
CONFIG_PHY_SAMSUNG_USB2=y
# CONFIG_PHY_TI_DS125DF111 is not set
CONFIG_PHY_TUSB1210=y
# end of PHY Subsystem

# CONFIG_POWERCAP is not set
# CONFIG_MCB is not set

#
# Performance monitor support
#
# CONFIG_DWC_PCIE_PMU is not set
# end of Performance monitor support

CONFIG_RAS=y
CONFIG_USB4=y
CONFIG_USB4_CONFIGFS=y
# CONFIG_USB4_DEBUGFS_WRITE is not set
# CONFIG_USB4_DMA_TEST is not set
# CONFIG_USB4_STREAM is not set

#
# Android
#
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDERFS=y
CONFIG_ANDROID_BINDER_DEVICES="binder0,binder1"
# end of Android

CONFIG_LIBNVDIMM=y
CONFIG_BLK_DEV_PMEM=y
CONFIG_ND_CLAIM=y
CONFIG_ND_BTT=y
CONFIG_BTT=y
CONFIG_ND_PFN=y
CONFIG_NVDIMM_PFN=y
CONFIG_NVDIMM_DAX=y
CONFIG_OF_PMEM=y
# CONFIG_RAMDAX is not set
CONFIG_NVDIMM_KEYS=y
# CONFIG_NVDIMM_SECURITY_TEST is not set
CONFIG_DAX=y
CONFIG_DEV_DAX=y
# CONFIG_DEV_DAX_PMEM is not set
CONFIG_DEV_DAX_FSDEV=y
# CONFIG_DEV_DAX_KMEM is not set
CONFIG_NVMEM=y
CONFIG_NVMEM_SYSFS=y
CONFIG_NVMEM_LAYOUTS=y

#
# Layout Types
#
# CONFIG_NVMEM_LAYOUT_SL28_VPD is not set
# CONFIG_NVMEM_LAYOUT_ONIE_TLV is not set
# CONFIG_NVMEM_LAYOUT_U_BOOT_ENV is not set
# end of Layout Types

# CONFIG_NVMEM_RMEM is not set
# CONFIG_NVMEM_U_BOOT_ENV is not set

#
# HW tracing support
#
# CONFIG_STM is not set
# CONFIG_INTEL_TH is not set
# end of HW tracing support

# CONFIG_FPGA is not set
# CONFIG_FSI is not set
CONFIG_TEE=y
CONFIG_TEE_DMABUF_HEAPS=y
CONFIG_OPTEE_STATIC_PROTMEM_POOL=y
# CONFIG_MUX_CORE is not set
# CONFIG_SIOX is not set
# CONFIG_SLIMBUS is not set
# CONFIG_INTERCONNECT is not set
CONFIG_COUNTER=y
# CONFIG_INTEL_QEP is not set
# CONFIG_INTERRUPT_CNT is not set
CONFIG_MOST=y
CONFIG_MOST_USB_HDM=y
# CONFIG_MOST_CDEV is not set
# CONFIG_MOST_SND is not set
# CONFIG_PECI is not set
# CONFIG_HTE is not set
# end of Device Drivers

#
# File systems
#
CONFIG_DCACHE_WORD_ACCESS=y
CONFIG_VALIDATE_FS_PARSER=y
CONFIG_FS_IOMAP=y
CONFIG_FS_STACK=y
CONFIG_BUFFER_HEAD=y
CONFIG_LEGACY_DIRECT_IO=y
# CONFIG_EXT2_FS is not set
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT2=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
# CONFIG_EXT4_DEBUG is not set
CONFIG_JBD2=y
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=y
CONFIG_JFS_FS=y
CONFIG_JFS_POSIX_ACL=y
CONFIG_JFS_SECURITY=y
CONFIG_JFS_DEBUG=y
# CONFIG_JFS_STATISTICS is not set
CONFIG_XFS_FS=y
# CONFIG_XFS_SUPPORT_V4 is not set
# CONFIG_XFS_SUPPORT_ASCII_CI is not set
CONFIG_XFS_QUOTA=y
CONFIG_XFS_POSIX_ACL=y
CONFIG_XFS_RT=y
CONFIG_XFS_DRAIN_INTENTS=y
CONFIG_XFS_LIVE_HOOKS=y
CONFIG_XFS_MEMORY_BUFS=y
CONFIG_XFS_BTREE_IN_MEM=y
CONFIG_XFS_ONLINE_SCRUB=y
# CONFIG_XFS_ONLINE_SCRUB_STATS is not set
CONFIG_XFS_ONLINE_REPAIR=y
# CONFIG_XFS_WARN is not set
# CONFIG_XFS_DEBUG is not set
CONFIG_GFS2_FS=y
CONFIG_GFS2_FS_LOCKING_DLM=y
CONFIG_OCFS2_FS=y
CONFIG_OCFS2_FS_O2CB=y
CONFIG_OCFS2_FS_USERSPACE_CLUSTER=y
CONFIG_OCFS2_FS_STATS=y
# CONFIG_OCFS2_DEBUG_MASKLOG is not set
CONFIG_OCFS2_DEBUG_FS=y
CONFIG_BTRFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
# CONFIG_BTRFS_DEBUG is not set
CONFIG_BTRFS_ASSERT=y
# CONFIG_BTRFS_EXPERIMENTAL is not set
CONFIG_NILFS2_FS=y
CONFIG_F2FS_FS=y
CONFIG_F2FS_STAT_FS=y
CONFIG_F2FS_FS_XATTR=y
CONFIG_F2FS_FS_POSIX_ACL=y
CONFIG_F2FS_FS_SECURITY=y
CONFIG_F2FS_CHECK_FS=y
CONFIG_F2FS_FAULT_INJECTION=y
CONFIG_F2FS_FS_COMPRESSION=y
CONFIG_F2FS_FS_LZO=y
CONFIG_F2FS_FS_LZORLE=y
CONFIG_F2FS_FS_LZ4=y
CONFIG_F2FS_FS_LZ4HC=y
CONFIG_F2FS_FS_ZSTD=y
# CONFIG_F2FS_IOSTAT is not set
# CONFIG_F2FS_UNFAIR_RWSEM is not set
CONFIG_ZONEFS_FS=y
CONFIG_FS_DAX=y
CONFIG_FS_DAX_PMD=y
CONFIG_FS_POSIX_ACL=y
CONFIG_EXPORTFS=y
CONFIG_EXPORTFS_BLOCK_OPS=y
CONFIG_FILE_LOCKING=y
CONFIG_FS_ENCRYPTION=y
CONFIG_FS_ENCRYPTION_ALGS=y
CONFIG_FS_ENCRYPTION_INLINE_CRYPT=y
CONFIG_FS_VERITY=y
CONFIG_FS_VERITY_BUILTIN_SIGNATURES=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_QUOTA_DEBUG is not set
CONFIG_QUOTA_TREE=y
# CONFIG_QFMT_V1 is not set
CONFIG_QFMT_V2=y
CONFIG_QUOTACTL=y
CONFIG_AUTOFS_FS=y
CONFIG_FUSE_FS=y
CONFIG_CUSE=y
CONFIG_VIRTIO_FS=y
CONFIG_FUSE_DAX=y
# CONFIG_FUSE_PASSTHROUGH is not set
CONFIG_FUSE_IO_URING=y
CONFIG_OVERLAY_FS=y
CONFIG_OVERLAY_FS_REDIRECT_DIR=y
CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW=y
CONFIG_OVERLAY_FS_INDEX=y
# CONFIG_OVERLAY_FS_NFS_EXPORT is not set
# CONFIG_OVERLAY_FS_XINO_AUTO is not set
# CONFIG_OVERLAY_FS_METACOPY is not set
CONFIG_OVERLAY_FS_DEBUG=y

#
# Caches
#
CONFIG_NETFS_SUPPORT=y
# CONFIG_NETFS_STATS is not set
# CONFIG_NETFS_DEBUG is not set
CONFIG_FSCACHE=y
# CONFIG_FSCACHE_STATS is not set
CONFIG_CACHEFILES=y
# CONFIG_CACHEFILES_DEBUG is not set
# CONFIG_CACHEFILES_ERROR_INJECTION is not set
# end of Caches

#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=y
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
CONFIG_UDF_FS=y
# end of CD-ROM/DVD Filesystems

#
# DOS/FAT/EXFAT/NT Filesystems
#
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
# CONFIG_FAT_DEFAULT_UTF8 is not set
CONFIG_EXFAT_FS=y
CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8"
# CONFIG_NTFS_FS is not set
CONFIG_NTFS3_FS=y
# CONFIG_NTFS3_64BIT_CLUSTER is not set
CONFIG_NTFS3_LZX_XPRESS=y
CONFIG_NTFS3_FS_POSIX_ACL=y
# end of DOS/FAT/EXFAT/NT Filesystems

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_VMCORE=y
# CONFIG_PROC_VMCORE_DEVICE_DUMP is not set
CONFIG_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_PROC_CHILDREN=y
CONFIG_PROC_PID_ARCH_STATUS=y
CONFIG_KERNFS=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_TMPFS_XATTR=y
# CONFIG_TMPFS_INODE64 is not set
CONFIG_TMPFS_QUOTA=y
CONFIG_ARCH_SUPPORTS_HUGETLBFS=y
CONFIG_HUGETLBFS=y
# CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON is not set
CONFIG_HUGETLB_PAGE=y
CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP=y
CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING=y
CONFIG_ARCH_HAS_GIGANTIC_PAGE=y
CONFIG_CONFIGFS_FS=y
# end of Pseudo filesystems

CONFIG_MISC_FILESYSTEMS=y
CONFIG_ORANGEFS_FS=y
CONFIG_ADFS_FS=y
# CONFIG_ADFS_FS_RW is not set
CONFIG_AFFS_FS=y
CONFIG_ECRYPT_FS=y
CONFIG_ECRYPT_FS_MESSAGING=y
CONFIG_HFS_FS=y
CONFIG_HFSPLUS_FS=y
CONFIG_BEFS_FS=y
# CONFIG_BEFS_DEBUG is not set
CONFIG_BFS_FS=y
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_WRITEBUFFER=y
# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
CONFIG_JFFS2_SUMMARY=y
CONFIG_JFFS2_FS_XATTR=y
CONFIG_JFFS2_FS_POSIX_ACL=y
CONFIG_JFFS2_FS_SECURITY=y
CONFIG_JFFS2_COMPRESSION_OPTIONS=y
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_LZO=y
CONFIG_JFFS2_RTIME=y
CONFIG_JFFS2_RUBIN=y
# CONFIG_JFFS2_CMODE_NONE is not set
CONFIG_JFFS2_CMODE_PRIORITY=y
# CONFIG_JFFS2_CMODE_SIZE is not set
# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
CONFIG_UBIFS_FS=y
CONFIG_UBIFS_FS_ADVANCED_COMPR=y
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
CONFIG_UBIFS_FS_ZSTD=y
CONFIG_UBIFS_ATIME_SUPPORT=y
CONFIG_UBIFS_FS_XATTR=y
CONFIG_UBIFS_FS_SECURITY=y
# CONFIG_UBIFS_FS_AUTHENTICATION is not set
CONFIG_CRAMFS=y
CONFIG_CRAMFS_BLOCKDEV=y
CONFIG_CRAMFS_MTD=y
CONFIG_SQUASHFS=y
# CONFIG_SQUASHFS_FILE_CACHE is not set
CONFIG_SQUASHFS_FILE_DIRECT=y
CONFIG_SQUASHFS_DECOMP_MULTI=y
# CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set
# CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE is not set
CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI=y
# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set
# CONFIG_SQUASHFS_MOUNT_DECOMP_THREADS is not set
CONFIG_SQUASHFS_XATTR=y
# CONFIG_SQUASHFS_COMP_CACHE_FULL is not set
CONFIG_SQUASHFS_ZLIB=y
CONFIG_SQUASHFS_LZ4=y
CONFIG_SQUASHFS_LZO=y
CONFIG_SQUASHFS_XZ=y
CONFIG_SQUASHFS_ZSTD=y
CONFIG_SQUASHFS_4K_DEVBLK_SIZE=y
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
CONFIG_MINIX_FS=y
CONFIG_OMFS_FS=y
CONFIG_HPFS_FS=y
CONFIG_QNX4FS_FS=y
CONFIG_QNX6FS_FS=y
# CONFIG_QNX6FS_DEBUG is not set
CONFIG_ROMFS_FS=y
# CONFIG_ROMFS_BACKED_BY_BLOCK is not set
# CONFIG_ROMFS_BACKED_BY_MTD is not set
CONFIG_ROMFS_BACKED_BY_BOTH=y
CONFIG_ROMFS_ON_BLOCK=y
CONFIG_ROMFS_ON_MTD=y
CONFIG_PSTORE=y
CONFIG_PSTORE_DEFAULT_KMSG_BYTES=10240
CONFIG_PSTORE_COMPRESS=y
# CONFIG_PSTORE_CONSOLE is not set
# CONFIG_PSTORE_PMSG is not set
# CONFIG_PSTORE_RAM is not set
# CONFIG_PSTORE_BLK is not set
CONFIG_UFS_FS=y
CONFIG_UFS_FS_WRITE=y
# CONFIG_UFS_DEBUG is not set
CONFIG_EROFS_FS=y
# CONFIG_EROFS_FS_DEBUG is not set
CONFIG_EROFS_FS_XATTR=y
CONFIG_EROFS_FS_POSIX_ACL=y
CONFIG_EROFS_FS_SECURITY=y
# CONFIG_EROFS_FS_BACKED_BY_FILE is not set
CONFIG_EROFS_FS_ZIP=y
# CONFIG_EROFS_FS_ZIP_LZMA is not set
# CONFIG_EROFS_FS_ZIP_DEFLATE is not set
# CONFIG_EROFS_FS_ZIP_ZSTD is not set
# CONFIG_EROFS_FS_ZIP_ACCEL is not set
# CONFIG_EROFS_FS_PCPU_KTHREAD is not set
# CONFIG_EROFS_FS_PAGE_CACHE_SHARE is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
# CONFIG_NFS_V2 is not set
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
# CONFIG_NFS_SWAP is not set
CONFIG_NFS_V4_0=y
CONFIG_NFS_V4_2=y
CONFIG_PNFS_FILE_LAYOUT=y
CONFIG_PNFS_BLOCK=y
CONFIG_PNFS_FLEXFILE_LAYOUT=y
CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"
# CONFIG_NFS_V4_1_MIGRATION is not set
CONFIG_NFS_V4_SECURITY_LABEL=y
CONFIG_ROOT_NFS=y
CONFIG_NFS_FSCACHE=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFS_DISABLE_UDP_SUPPORT is not set
CONFIG_NFS_V4_2_READ_PLUS=y
CONFIG_NFSD=y
# CONFIG_NFSD_V2 is not set
CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y
CONFIG_NFSD_PNFS=y
CONFIG_NFSD_BLOCKLAYOUT=y
CONFIG_NFSD_SCSILAYOUT=y
CONFIG_NFSD_FLEXFILELAYOUT=y
CONFIG_NFSD_V4_2_INTER_SSC=y
CONFIG_NFSD_V4_SECURITY_LABEL=y
# CONFIG_NFSD_LEGACY_CLIENT_TRACKING is not set
# CONFIG_NFSD_V4_POSIX_ACLS is not set
CONFIG_GRACE_PERIOD=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y
# CONFIG_NFS_LOCALIO is not set
CONFIG_NFS_V4_2_SSC_HELPER=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y
CONFIG_SUNRPC_BACKCHANNEL=y
CONFIG_RPCSEC_GSS_KRB5=y
# CONFIG_SUNRPC_DEBUG is not set
# CONFIG_SUNRPC_XPRT_RDMA is not set
CONFIG_CEPH_FS=y
CONFIG_CEPH_FSCACHE=y
CONFIG_CEPH_FS_POSIX_ACL=y
# CONFIG_CEPH_FS_SECURITY_LABEL is not set
CONFIG_CIFS=y
# CONFIG_CIFS_STATS2 is not set
CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y
CONFIG_CIFS_UPCALL=y
CONFIG_CIFS_XATTR=y
CONFIG_CIFS_POSIX=y
CONFIG_CIFS_DEBUG=y
# CONFIG_CIFS_DEBUG2 is not set
# CONFIG_CIFS_DEBUG_DUMP_KEYS is not set
CONFIG_CIFS_DFS_UPCALL=y
CONFIG_CIFS_SWN_UPCALL=y
CONFIG_CIFS_SMB_DIRECT=y
CONFIG_CIFS_FSCACHE=y
# CONFIG_CIFS_ROOT is not set
# CONFIG_CIFS_COMPRESSION is not set
CONFIG_SMB_SERVER=y
# CONFIG_SMB_SERVER_SMBDIRECT is not set
# CONFIG_SMB_SERVER_CHECK_CAP_NET_ADMIN is not set
# CONFIG_SMB_SERVER_KERBEROS5 is not set
CONFIG_SMBDIRECT=y
CONFIG_SMBFS=y
# CONFIG_CODA_FS is not set
CONFIG_AFS_FS=y
# CONFIG_AFS_DEBUG is not set
CONFIG_AFS_FSCACHE=y
# CONFIG_AFS_DEBUG_CURSOR is not set
CONFIG_9P_FS=y
CONFIG_9P_FSCACHE=y
CONFIG_9P_FS_POSIX_ACL=y
CONFIG_9P_FS_SECURITY=y
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_737=y
CONFIG_NLS_CODEPAGE_775=y
CONFIG_NLS_CODEPAGE_850=y
CONFIG_NLS_CODEPAGE_852=y
CONFIG_NLS_CODEPAGE_855=y
CONFIG_NLS_CODEPAGE_857=y
CONFIG_NLS_CODEPAGE_860=y
CONFIG_NLS_CODEPAGE_861=y
CONFIG_NLS_CODEPAGE_862=y
CONFIG_NLS_CODEPAGE_863=y
CONFIG_NLS_CODEPAGE_864=y
CONFIG_NLS_CODEPAGE_865=y
CONFIG_NLS_CODEPAGE_866=y
CONFIG_NLS_CODEPAGE_869=y
CONFIG_NLS_CODEPAGE_936=y
CONFIG_NLS_CODEPAGE_950=y
CONFIG_NLS_CODEPAGE_932=y
CONFIG_NLS_CODEPAGE_949=y
CONFIG_NLS_CODEPAGE_874=y
CONFIG_NLS_ISO8859_8=y
CONFIG_NLS_CODEPAGE_1250=y
CONFIG_NLS_CODEPAGE_1251=y
CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_ISO8859_2=y
CONFIG_NLS_ISO8859_3=y
CONFIG_NLS_ISO8859_4=y
CONFIG_NLS_ISO8859_5=y
CONFIG_NLS_ISO8859_6=y
CONFIG_NLS_ISO8859_7=y
CONFIG_NLS_ISO8859_9=y
CONFIG_NLS_ISO8859_13=y
CONFIG_NLS_ISO8859_14=y
CONFIG_NLS_ISO8859_15=y
CONFIG_NLS_KOI8_R=y
CONFIG_NLS_KOI8_U=y
CONFIG_NLS_MAC_ROMAN=y
CONFIG_NLS_MAC_CELTIC=y
CONFIG_NLS_MAC_CENTEURO=y
CONFIG_NLS_MAC_CROATIAN=y
CONFIG_NLS_MAC_CYRILLIC=y
CONFIG_NLS_MAC_GAELIC=y
CONFIG_NLS_MAC_GREEK=y
CONFIG_NLS_MAC_ICELAND=y
CONFIG_NLS_MAC_INUIT=y
CONFIG_NLS_MAC_ROMANIAN=y
CONFIG_NLS_MAC_TURKISH=y
CONFIG_NLS_UTF8=y
CONFIG_NLS_UCS2_UTILS=y
CONFIG_DLM=y
# CONFIG_DLM_DEBUG is not set
CONFIG_UNICODE=y
CONFIG_IO_WQ=y
# end of File systems

#
# Security options
#
CONFIG_KEYS=y
CONFIG_KEYS_REQUEST_CACHE=y
CONFIG_PERSISTENT_KEYRINGS=y
CONFIG_BIG_KEYS=y
CONFIG_TRUSTED_KEYS=y
# CONFIG_TRUSTED_KEYS_TPM is not set
# CONFIG_TRUSTED_KEYS_TEE is not set

#
# No trust source selected!
#
CONFIG_ENCRYPTED_KEYS=y
# CONFIG_USER_DECRYPTED_DATA is not set
CONFIG_KEY_DH_OPERATIONS=y
CONFIG_KEY_NOTIFICATIONS=y
# CONFIG_SECURITY_DMESG_RESTRICT is not set
# CONFIG_PROC_MEM_ALWAYS_FORCE is not set
CONFIG_PROC_MEM_FORCE_PTRACE=y
# CONFIG_PROC_MEM_NO_FORCE is not set
CONFIG_SECURITY=y
CONFIG_HAS_SECURITY_AUDIT=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_INFINIBAND=y
CONFIG_SECURITY_NETWORK_XFRM=y
CONFIG_SECURITY_PATH=y
# CONFIG_INTEL_TXT is not set
CONFIG_LSM_MMAP_MIN_ADDR=65536
# CONFIG_STATIC_USERMODEHELPER is not set
CONFIG_SECURITY_SELINUX=y
CONFIG_SECURITY_SELINUX_BOOTPARAM=y
CONFIG_SECURITY_SELINUX_DEVELOP=y
CONFIG_SECURITY_SELINUX_AVC_STATS=y
CONFIG_SECURITY_SELINUX_SIDTAB_HASH_BITS=9
CONFIG_SECURITY_SELINUX_SID2STR_CACHE_SIZE=256
CONFIG_SECURITY_SELINUX_AVC_HASH_BITS=9
# CONFIG_SECURITY_SELINUX_DEBUG is not set
# CONFIG_SECURITY_SMACK is not set
CONFIG_SECURITY_TOMOYO=y
CONFIG_SECURITY_TOMOYO_MAX_ACCEPT_ENTRY=64
CONFIG_SECURITY_TOMOYO_MAX_AUDIT_LOG=32
CONFIG_SECURITY_TOMOYO_OMIT_USERSPACE_LOADER=y
CONFIG_SECURITY_TOMOYO_INSECURE_BUILTIN_SETTING=y
# CONFIG_SECURITY_APPARMOR is not set
# CONFIG_SECURITY_LOADPIN is not set
CONFIG_SECURITY_YAMA=y
CONFIG_SECURITY_SAFESETID=y
CONFIG_SECURITY_LOCKDOWN_LSM=y
CONFIG_SECURITY_LOCKDOWN_LSM_EARLY=y
CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE=y
# CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY is not set
# CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY is not set
CONFIG_SECURITY_LANDLOCK=y
# CONFIG_SECURITY_IPE is not set
CONFIG_INTEGRITY=y
CONFIG_INTEGRITY_SIGNATURE=y
CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
CONFIG_INTEGRITY_TRUSTED_KEYRING=y
CONFIG_INTEGRITY_AUDIT=y
CONFIG_IMA=y
CONFIG_IMA_MEASURE_PCR_IDX=10
CONFIG_IMA_LSM_RULES=y
CONFIG_IMA_NG_TEMPLATE=y
# CONFIG_IMA_SIG_TEMPLATE is not set
CONFIG_IMA_DEFAULT_TEMPLATE="ima-ng"
# CONFIG_IMA_DEFAULT_HASH_SHA1 is not set
CONFIG_IMA_DEFAULT_HASH_SHA256=y
# CONFIG_IMA_DEFAULT_HASH_SHA512 is not set
# CONFIG_IMA_DEFAULT_HASH_WP512 is not set
CONFIG_IMA_DEFAULT_HASH="sha256"
CONFIG_IMA_WRITE_POLICY=y
CONFIG_IMA_READ_POLICY=y
CONFIG_IMA_APPRAISE=y
# CONFIG_IMA_ARCH_POLICY is not set
# CONFIG_IMA_APPRAISE_BUILD_POLICY is not set
# CONFIG_IMA_APPRAISE_BOOTPARAM is not set
CONFIG_IMA_APPRAISE_MODSIG=y
# CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY is not set
# CONFIG_IMA_BLACKLIST_KEYRING is not set
# CONFIG_IMA_LOAD_X509 is not set
CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS=y
CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS=y
# CONFIG_IMA_DISABLE_HTABLE is not set
# CONFIG_IMA_STAGING is not set
# CONFIG_IMA_INIT_LATE_SYNC is not set
CONFIG_EVM=y
CONFIG_EVM_ATTR_FSUUID=y
CONFIG_EVM_ADD_XATTRS=y
# CONFIG_EVM_LOAD_X509 is not set
CONFIG_DEFAULT_SECURITY_SELINUX=y
# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
# CONFIG_DEFAULT_SECURITY_DAC is not set
CONFIG_LSM="landlock,lockdown,yama,safesetid,integrity,tomoyo,selinux,bpf"

#
# Kernel hardening options
#

#
# Memory initialization
#
CONFIG_CC_HAS_AUTO_VAR_INIT_PATTERN=y
CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO_BARE=y
CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO=y
# CONFIG_INIT_STACK_NONE is not set
# CONFIG_INIT_STACK_ALL_PATTERN is not set
CONFIG_INIT_STACK_ALL_ZERO=y
CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
# CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
CONFIG_CC_HAS_ZERO_CALL_USED_REGS=y
# CONFIG_ZERO_CALL_USED_REGS is not set
# end of Memory initialization

#
# Bounds checking
#
CONFIG_FORTIFY_SOURCE=y
CONFIG_HARDENED_USERCOPY=y
# CONFIG_HARDENED_USERCOPY_DEFAULT_ON is not set
# end of Bounds checking

#
# Hardening of kernel data structures
#
CONFIG_LIST_HARDENED=y
CONFIG_BUG_ON_DATA_CORRUPTION=y
# end of Hardening of kernel data structures

CONFIG_RANDSTRUCT_NONE=y
# end of Kernel hardening options
# end of Security options

CONFIG_ASYNC_CORE=y
CONFIG_ASYNC_MEMCPY=y
CONFIG_ASYNC_XOR=y
CONFIG_ASYNC_PQ=y
CONFIG_ASYNC_RAID6_RECOV=y
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_SIG=y
CONFIG_CRYPTO_SIG2=y
CONFIG_CRYPTO_SKCIPHER=y
CONFIG_CRYPTO_SKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_AKCIPHER2=y
CONFIG_CRYPTO_AKCIPHER=y
CONFIG_CRYPTO_KPP2=y
CONFIG_CRYPTO_KPP=y
CONFIG_CRYPTO_ACOMP2=y
CONFIG_CRYPTO_ACOMP=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_USER=y
# CONFIG_CRYPTO_SELFTESTS is not set
CONFIG_CRYPTO_NULL=y
CONFIG_CRYPTO_PCRYPT=y
# CONFIG_CRYPTO_CRYPTD is not set
CONFIG_CRYPTO_AUTHENC=y
CONFIG_CRYPTO_KRB5ENC=y
# CONFIG_CRYPTO_BENCHMARK is not set
CONFIG_CRYPTO_ENGINE=y
# end of Crypto core or helper

#
# Public-key cryptography
#
CONFIG_CRYPTO_RSA=y
CONFIG_CRYPTO_DH=y
# CONFIG_CRYPTO_DH_RFC7919_GROUPS is not set
CONFIG_CRYPTO_ECC=y
CONFIG_CRYPTO_ECDH=y
# CONFIG_CRYPTO_ECDSA is not set
CONFIG_CRYPTO_ECRDSA=y
CONFIG_CRYPTO_MLDSA=y
# end of Public-key cryptography

#
# Block ciphers
#
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_ANUBIS=y
CONFIG_CRYPTO_ARIA=y
CONFIG_CRYPTO_BLOWFISH=y
CONFIG_CRYPTO_BLOWFISH_COMMON=y
CONFIG_CRYPTO_CAMELLIA=y
CONFIG_CRYPTO_CAST_COMMON=y
CONFIG_CRYPTO_CAST5=y
CONFIG_CRYPTO_CAST6=y
CONFIG_CRYPTO_DES=y
CONFIG_CRYPTO_KHAZAD=y
CONFIG_CRYPTO_SEED=y
CONFIG_CRYPTO_SERPENT=y
CONFIG_CRYPTO_SM4=y
CONFIG_CRYPTO_SM4_GENERIC=y
CONFIG_CRYPTO_TEA=y
CONFIG_CRYPTO_TWOFISH=y
CONFIG_CRYPTO_TWOFISH_COMMON=y
# end of Block ciphers

#
# Length-preserving ciphers and modes
#
CONFIG_CRYPTO_ADIANTUM=y
CONFIG_CRYPTO_ARC4=y
CONFIG_CRYPTO_CHACHA20=y
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_CTR=y
CONFIG_CRYPTO_CTS=y
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_HCTR2=y
CONFIG_CRYPTO_LRW=y
CONFIG_CRYPTO_XCTR=y
CONFIG_CRYPTO_XTS=y
# end of Length-preserving ciphers and modes

#
# AEAD (authenticated encryption with associated data) ciphers
#
CONFIG_CRYPTO_AEGIS128=y
CONFIG_CRYPTO_CHACHA20POLY1305=y
CONFIG_CRYPTO_CCM=y
CONFIG_CRYPTO_GCM=y
CONFIG_CRYPTO_GENIV=y
CONFIG_CRYPTO_SEQIV=y
CONFIG_CRYPTO_ECHAINIV=y
CONFIG_CRYPTO_ESSIV=y
# end of AEAD (authenticated encryption with associated data) ciphers

#
# Hashes, digests, and MACs
#
# CONFIG_CRYPTO_BLAKE2B is not set
CONFIG_CRYPTO_CMAC=y
CONFIG_CRYPTO_HMAC=y
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
CONFIG_CRYPTO_RMD160=y
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_SHA512=y
CONFIG_CRYPTO_SHA3=y
# CONFIG_CRYPTO_SM3 is not set
CONFIG_CRYPTO_STREEBOG=y
CONFIG_CRYPTO_WP512=y
CONFIG_CRYPTO_XCBC=y
# CONFIG_CRYPTO_XXHASH is not set
# end of Hashes, digests, and MACs

#
# CRCs (cyclic redundancy checks)
#
# CONFIG_CRYPTO_CRC32C is not set
# CONFIG_CRYPTO_CRC32 is not set
# end of CRCs (cyclic redundancy checks)

#
# Compression
#
CONFIG_CRYPTO_DEFLATE=y
CONFIG_CRYPTO_LZO=y
CONFIG_CRYPTO_842=y
CONFIG_CRYPTO_LZ4=y
CONFIG_CRYPTO_LZ4HC=y
CONFIG_CRYPTO_ZSTD=y
# end of Compression

#
# Random number generation
#
# CONFIG_CRYPTO_DRBG is not set
# CONFIG_CRYPTO_JITTERENTROPY is not set
CONFIG_CRYPTO_KDF800108_CTR=y
# end of Random number generation

#
# Userspace interface (deprecated)
#
CONFIG_CRYPTO_USER_API=y
CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_CRYPTO_USER_API_SKCIPHER=y
CONFIG_CRYPTO_USER_API_RNG=y
CONFIG_CRYPTO_USER_API_AEAD=y
CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y
# end of Userspace interface (deprecated)

#
# Accelerated Cryptographic Algorithms for CPU (x86)
#
CONFIG_CRYPTO_AES_NI_INTEL=y
CONFIG_CRYPTO_BLOWFISH_X86_64=y
CONFIG_CRYPTO_CAMELLIA_X86_64=y
CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64=y
CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64=y
CONFIG_CRYPTO_CAST5_AVX_X86_64=y
CONFIG_CRYPTO_CAST6_AVX_X86_64=y
CONFIG_CRYPTO_SERPENT_SSE2_X86_64=y
CONFIG_CRYPTO_SERPENT_AVX_X86_64=y
CONFIG_CRYPTO_SERPENT_AVX2_X86_64=y
CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64=y
CONFIG_CRYPTO_SM4_AESNI_AVX2_X86_64=y
CONFIG_CRYPTO_TWOFISH_X86_64=y
CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=y
CONFIG_CRYPTO_TWOFISH_AVX_X86_64=y
CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64=y
# CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64 is not set
# CONFIG_CRYPTO_ARIA_GFNI_AVX512_X86_64 is not set
CONFIG_CRYPTO_AEGIS128_AESNI_SSE2=y
# end of Accelerated Cryptographic Algorithms for CPU (x86)

CONFIG_CRYPTO_HW=y
CONFIG_CRYPTO_DEV_PADLOCK=y
CONFIG_CRYPTO_DEV_PADLOCK_AES=y
CONFIG_CRYPTO_DEV_PADLOCK_SHA=y
# CONFIG_CRYPTO_DEV_ATMEL_ECC is not set
# CONFIG_CRYPTO_DEV_ATMEL_SHA204A is not set
CONFIG_CRYPTO_DEV_CCP=y
CONFIG_CRYPTO_DEV_CCP_DD=y
# CONFIG_CRYPTO_DEV_SP_CCP is not set
# CONFIG_CRYPTO_DEV_SP_PSP is not set
# CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set
CONFIG_CRYPTO_DEV_QAT=y
CONFIG_CRYPTO_DEV_QAT_DH895xCC=y
CONFIG_CRYPTO_DEV_QAT_C3XXX=y
CONFIG_CRYPTO_DEV_QAT_C62X=y
# CONFIG_CRYPTO_DEV_QAT_4XXX is not set
# CONFIG_CRYPTO_DEV_QAT_420XX is not set
# CONFIG_CRYPTO_DEV_QAT_6XXX is not set
CONFIG_CRYPTO_DEV_QAT_DH895xCCVF=y
CONFIG_CRYPTO_DEV_QAT_C3XXXVF=y
CONFIG_CRYPTO_DEV_QAT_C62XVF=y
# CONFIG_CRYPTO_DEV_QAT_ERROR_INJECTION is not set
CONFIG_CRYPTO_DEV_VIRTIO=y
# CONFIG_CRYPTO_DEV_SAFEXCEL is not set
# CONFIG_CRYPTO_DEV_CCREE is not set
# CONFIG_CRYPTO_DEV_AMLOGIC_GXL is not set
CONFIG_ASYMMETRIC_KEY_TYPE=y
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
CONFIG_X509_CERTIFICATE_PARSER=y
CONFIG_PKCS8_PRIVATE_KEY_PARSER=y
CONFIG_PKCS7_MESSAGE_PARSER=y
# CONFIG_PKCS7_WAIVE_AUTHATTRS_REJECTION_FOR_MLDSA is not set
CONFIG_PKCS7_TEST_KEY=y
CONFIG_SIGNED_PE_FILE_VERIFICATION=y
# CONFIG_FIPS_SIGNATURE_SELFTEST is not set

#
# Certificates for signature checking
#
CONFIG_MODULE_SIG_KEY="certs/signing_key.pem"
# CONFIG_MODULE_SIG_KEY_TYPE_RSA is not set
CONFIG_MODULE_SIG_KEY_TYPE_MLDSA_44=y
# CONFIG_MODULE_SIG_KEY_TYPE_MLDSA_65 is not set
# CONFIG_MODULE_SIG_KEY_TYPE_MLDSA_87 is not set
CONFIG_SYSTEM_TRUSTED_KEYRING=y
CONFIG_SYSTEM_TRUSTED_KEYS=""
# CONFIG_SYSTEM_EXTRA_CERTIFICATE is not set
CONFIG_SECONDARY_TRUSTED_KEYRING=y
# CONFIG_SECONDARY_TRUSTED_KEYRING_SIGNED_BY_BUILTIN is not set
# CONFIG_SYSTEM_BLACKLIST_KEYRING is not set
CONFIG_OPENSSL_SUPPORTS_ML_DSA=y
# end of Certificates for signature checking

CONFIG_CRYPTO_KRB5=y
# CONFIG_CRYPTO_KRB5_SELFTESTS is not set
CONFIG_BINARY_PRINTF=y

#
# Library routines
#
CONFIG_LINEAR_RANGES=y
# CONFIG_PACKING is not set
CONFIG_BITREVERSE=y
CONFIG_GENERIC_BITREVERSE=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_NET_UTILS=y
# CONFIG_CORDIC is not set
# CONFIG_PRIME_NUMBERS is not set
CONFIG_RATIONAL=y
CONFIG_GENERIC_IOMAP=y
CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
CONFIG_ARCH_HAS_FAST_MULTIPLIER=y
CONFIG_ARCH_USE_SYM_ANNOTATIONS=y
CONFIG_CRC8=y
CONFIG_CRC16=y
CONFIG_CRC_CCITT=y
CONFIG_CRC_ITU_T=y
CONFIG_CRC_T10DIF=y
CONFIG_CRC_T10DIF_ARCH=y
CONFIG_CRC32=y
CONFIG_CRC32_ARCH=y
CONFIG_CRC64=y
CONFIG_CRC64_ARCH=y
CONFIG_CRC_OPTIMIZATIONS=y
CONFIG_CRYPTO_HASH_INFO=y
CONFIG_CRYPTO_LIB_UTILS=y
CONFIG_CRYPTO_LIB_AES=y
CONFIG_CRYPTO_LIB_AES_ARCH=y
CONFIG_CRYPTO_LIB_AES_CBC=y
CONFIG_CRYPTO_LIB_AES_CBC_MACS=y
CONFIG_CRYPTO_LIB_AES_CCM=y
CONFIG_CRYPTO_LIB_AES_CTR=y
CONFIG_CRYPTO_LIB_AES_ECB=y
CONFIG_CRYPTO_LIB_AES_GCM=y
CONFIG_CRYPTO_LIB_AES_XTS=y
CONFIG_CRYPTO_LIB_ARC4=y
CONFIG_CRYPTO_LIB_GF128MUL=y
CONFIG_CRYPTO_LIB_BLAKE2B=y
CONFIG_CRYPTO_LIB_BLAKE2S_ARCH=y
CONFIG_CRYPTO_LIB_CHACHA=y
CONFIG_CRYPTO_LIB_CHACHA_ARCH=y
CONFIG_CRYPTO_LIB_CURVE25519=y
CONFIG_CRYPTO_LIB_CURVE25519_ARCH=y
CONFIG_CRYPTO_LIB_CURVE25519_GENERIC=y
CONFIG_CRYPTO_LIB_DES=y
CONFIG_CRYPTO_LIB_GF128HASH=y
CONFIG_CRYPTO_LIB_GF128HASH_ARCH=y
CONFIG_CRYPTO_LIB_MD5=y
CONFIG_CRYPTO_LIB_MLDSA=y
CONFIG_CRYPTO_LIB_NH=y
CONFIG_CRYPTO_LIB_NH_ARCH=y
CONFIG_CRYPTO_LIB_POLY1305=y
CONFIG_CRYPTO_LIB_POLY1305_ARCH=y
CONFIG_CRYPTO_LIB_POLY1305_GENERIC=y
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=11
CONFIG_CRYPTO_LIB_CHACHA20POLY1305=y
CONFIG_CRYPTO_LIB_SHA1=y
CONFIG_CRYPTO_LIB_SHA1_ARCH=y
CONFIG_CRYPTO_LIB_SHA256=y
CONFIG_CRYPTO_LIB_SHA256_ARCH=y
CONFIG_CRYPTO_LIB_SHA512=y
CONFIG_CRYPTO_LIB_SHA512_ARCH=y
CONFIG_CRYPTO_LIB_SHA3=y
CONFIG_XOR_BLOCKS=y
CONFIG_XOR_BLOCKS_ARCH=y
CONFIG_RAID6_PQ=y
CONFIG_RAID6_PQ_ARCH=y
# CONFIG_RAID6_PQ_BENCHMARK is not set
CONFIG_XXHASH=y
# CONFIG_RANDOM32_SELFTEST is not set
CONFIG_842_COMPRESS=y
CONFIG_842_DECOMPRESS=y
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_LZ4_COMPRESS=y
CONFIG_LZ4HC_COMPRESS=y
CONFIG_LZ4_DECOMPRESS=y
CONFIG_ZSTD_COMMON=y
CONFIG_ZSTD_COMPRESS=y
CONFIG_ZSTD_DECOMPRESS=y
CONFIG_XZ_DEC=y
CONFIG_XZ_DEC_X86=y
CONFIG_XZ_DEC_POWERPC=y
CONFIG_XZ_DEC_ARM=y
CONFIG_XZ_DEC_ARMTHUMB=y
CONFIG_XZ_DEC_ARM64=y
CONFIG_XZ_DEC_SPARC=y
CONFIG_XZ_DEC_RISCV=y
# CONFIG_XZ_DEC_MICROLZMA is not set
CONFIG_XZ_DEC_BCJ=y
# CONFIG_XZ_DEC_TEST is not set
CONFIG_DECOMPRESS_GZIP=y
CONFIG_DECOMPRESS_BZIP2=y
CONFIG_DECOMPRESS_LZMA=y
CONFIG_DECOMPRESS_XZ=y
CONFIG_DECOMPRESS_LZO=y
CONFIG_DECOMPRESS_LZ4=y
CONFIG_DECOMPRESS_ZSTD=y
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_REED_SOLOMON=y
CONFIG_REED_SOLOMON_DEC8=y
CONFIG_TEXTSEARCH=y
CONFIG_TEXTSEARCH_KMP=y
CONFIG_TEXTSEARCH_BM=y
CONFIG_TEXTSEARCH_FSM=y
CONFIG_INTERVAL_TREE=y
CONFIG_INTERVAL_TREE_SPAN_ITER=y
CONFIG_XARRAY_MULTI=y
CONFIG_ASSOCIATIVE_ARRAY=y
CONFIG_CLOSURES=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_IOPORT_MAP=y
CONFIG_HAS_DMA=y
CONFIG_DMA_OPS_HELPERS=y
CONFIG_NEED_SG_DMA_FLAGS=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_DMA_DECLARE_COHERENT=y
CONFIG_SWIOTLB=y
# CONFIG_SWIOTLB_DYNAMIC is not set
CONFIG_DMA_NEED_SYNC=y
# CONFIG_DMA_RESTRICTED_POOL is not set
CONFIG_DMA_CMA=y
# CONFIG_DMA_NUMA_CMA is not set

#
# Default contiguous memory area size:
#
CONFIG_CMA_SIZE_MBYTES=0
CONFIG_CMA_SIZE_PERCENTAGE=0
# CONFIG_CMA_SIZE_SEL_MBYTES is not set
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
# CONFIG_CMA_SIZE_SEL_MIN is not set
CONFIG_CMA_SIZE_SEL_MAX=y
CONFIG_CMA_ALIGNMENT=8
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_DMA_MAP_BENCHMARK is not set
CONFIG_SGL_ALLOC=y
CONFIG_CHECK_SIGNATURE=y
# CONFIG_CPUMASK_OFFSTACK is not set
CONFIG_CPU_RMAP=y
CONFIG_DQL=y
CONFIG_GLOB=y
CONFIG_NLATTR=y
CONFIG_CLZ_TAB=y
CONFIG_IRQ_POLL=y
CONFIG_MPILIB=y
CONFIG_SIGNATURE=y
CONFIG_DIMLIB=y
CONFIG_LIBFDT=y
CONFIG_OID_REGISTRY=y
CONFIG_VDSO_DATASTORE=y
CONFIG_GENERIC_GETTIMEOFDAY=y
CONFIG_GENERIC_VDSO_OVERFLOW_PROTECT=y
CONFIG_VDSO_GETRANDOM=y
CONFIG_FONT_SUPPORT=y
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
CONFIG_SG_POOL=y
CONFIG_ARCH_HAS_PMEM_API=y
CONFIG_MEMREGION=y
CONFIG_ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION=y
CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y
CONFIG_ARCH_HAS_COPY_MC=y
CONFIG_ARCH_STACKWALK=y
CONFIG_STACKDEPOT=y
CONFIG_STACKDEPOT_ALWAYS_INIT=y
CONFIG_STACKDEPOT_MAX_FRAMES=64
CONFIG_REF_TRACKER=y
CONFIG_SBITMAP=y
# CONFIG_LWQ_TEST is not set
# end of Library routines

CONFIG_FIRMWARE_TABLE=y
CONFIG_UNION_FIND=y

#
# Kernel hacking
#

#
# printk and dmesg options
#
CONFIG_PRINTK_TIME=y
CONFIG_PRINTK_CALLER=y
# CONFIG_STACKTRACE_BUILD_ID is not set
CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7
CONFIG_CONSOLE_LOGLEVEL_QUIET=4
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
# CONFIG_BOOT_PRINTK_DELAY is not set
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DYNAMIC_DEBUG_CORE=y
CONFIG_SYMBOLIC_ERRNAME=y
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_BUGVERBOSE_DETAILED=y
# end of printk and dmesg options

CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_MISC=y

#
# Compile-time checks and compiler options
#
CONFIG_DEBUG_INFO=y
CONFIG_AS_HAS_NON_CONST_ULEB128=y
# CONFIG_DEBUG_INFO_NONE is not set
# CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT is not set
CONFIG_DEBUG_INFO_DWARF4=y
# CONFIG_DEBUG_INFO_DWARF5 is not set
# CONFIG_DEBUG_INFO_REDUCED is not set
CONFIG_DEBUG_INFO_COMPRESSED_NONE=y
# CONFIG_DEBUG_INFO_COMPRESSED_ZLIB is not set
# CONFIG_DEBUG_INFO_COMPRESSED_ZSTD is not set
# CONFIG_DEBUG_INFO_SPLIT is not set
# CONFIG_DEBUG_INFO_BTF is not set
CONFIG_PAHOLE_HAS_LANG_EXCLUDE=y
# CONFIG_GDB_SCRIPTS is not set
CONFIG_FRAME_WARN=2048
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_READABLE_ASM is not set
# CONFIG_HEADERS_INSTALL is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
CONFIG_SECTION_MISMATCH_WARN_ONLY=y
# CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B is not set
CONFIG_OBJTOOL=y
# CONFIG_OBJTOOL_WERROR is not set
CONFIG_NOINSTR_VALIDATION=y
# CONFIG_VMLINUX_MAP is not set
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
# end of Compile-time checks and compiler options

#
# Generic Kernel Debugging Instruments
#
# CONFIG_MAGIC_SYSRQ is not set
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_FS_ALLOW_ALL=y
# CONFIG_DEBUG_FS_ALLOW_NONE is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_ARCH_HAS_UBSAN=y
CONFIG_UBSAN=y
# CONFIG_UBSAN_TRAP is not set
CONFIG_CC_HAS_UBSAN_BOUNDS_STRICT=y
CONFIG_UBSAN_BOUNDS=y
CONFIG_UBSAN_BOUNDS_STRICT=y
CONFIG_UBSAN_SHIFT=y
# CONFIG_UBSAN_DIV_ZERO is not set
# CONFIG_UBSAN_BOOL is not set
# CONFIG_UBSAN_ENUM is not set
# CONFIG_UBSAN_ALIGNMENT is not set
# CONFIG_TEST_UBSAN is not set
CONFIG_HAVE_ARCH_KCSAN=y
CONFIG_HAVE_KCSAN_COMPILER=y
# end of Generic Kernel Debugging Instruments

#
# Networking Debugging
#
CONFIG_NET_DEV_REFCNT_TRACKER=y
CONFIG_NET_NS_REFCNT_TRACKER=y
CONFIG_DEBUG_NET=y
# CONFIG_DEBUG_NET_SMALL_RTNL is not set
# end of Networking Debugging

#
# Memory Debugging
#
CONFIG_PAGE_EXTENSION=y
# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_SLUB_DEBUG=y
# CONFIG_SLUB_DEBUG_ON is not set
CONFIG_SLUB_RCU_DEBUG=y
CONFIG_PAGE_OWNER=y
CONFIG_PAGE_TABLE_CHECK=y
CONFIG_PAGE_TABLE_CHECK_ENFORCED=y
CONFIG_PAGE_POISONING=y
# CONFIG_DEBUG_PAGE_REF is not set
# CONFIG_DEBUG_RODATA_TEST is not set
CONFIG_ARCH_HAS_DEBUG_WX=y
CONFIG_DEBUG_WX=y
CONFIG_ARCH_HAS_PTDUMP=y
CONFIG_PTDUMP=y
CONFIG_PTDUMP_DEBUGFS=y
CONFIG_HAVE_DEBUG_KMEMLEAK=y
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_PER_VMA_LOCK_STATS is not set
# CONFIG_MEM_ALLOC_PROFILING is not set
CONFIG_DEBUG_OBJECTS=y
# CONFIG_DEBUG_OBJECTS_SELFTEST is not set
CONFIG_DEBUG_OBJECTS_FREE=y
CONFIG_DEBUG_OBJECTS_TIMERS=y
CONFIG_DEBUG_OBJECTS_WORK=y
CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y
CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
# CONFIG_SHRINKER_DEBUG is not set
CONFIG_DEBUG_STACK_USAGE=y
CONFIG_SCHED_STACK_END_CHECK=y
CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE=y
CONFIG_DEBUG_VFS=y
CONFIG_DEBUG_VM_IRQSOFF=y
CONFIG_DEBUG_VM=y
CONFIG_DEBUG_VM_MAPLE_TREE=y
CONFIG_DEBUG_VM_RB=y
CONFIG_DEBUG_VM_PGFLAGS=y
CONFIG_DEBUG_VM_PGTABLE=y
CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
CONFIG_DEBUG_VIRTUAL=y
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_DEBUG_PER_CPU_MAPS=y
CONFIG_DEBUG_KMAP_LOCAL=y
CONFIG_ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP=y
CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP=y
CONFIG_HAVE_ARCH_KASAN=y
CONFIG_HAVE_ARCH_KASAN_VMALLOC=y
CONFIG_CC_HAS_KASAN_GENERIC=y
CONFIG_CC_HAS_KASAN_SW_TAGS=y
CONFIG_CC_HAS_WORKING_NOSANITIZE_ADDRESS=y
CONFIG_KASAN=y
CONFIG_CC_HAS_KASAN_MEMINTRINSIC_PREFIX=y
CONFIG_KASAN_GENERIC=y
# CONFIG_KASAN_OUTLINE is not set
CONFIG_KASAN_INLINE=y
CONFIG_KASAN_STACK=y
CONFIG_KASAN_VMALLOC=y
# CONFIG_KASAN_EXTRA_INFO is not set
CONFIG_HAVE_ARCH_KFENCE=y
CONFIG_KFENCE=y
CONFIG_KFENCE_SAMPLE_INTERVAL=100
CONFIG_KFENCE_NUM_OBJECTS=255
# CONFIG_KFENCE_DEFERRABLE is not set
CONFIG_KFENCE_STATIC_KEYS=y
CONFIG_KFENCE_STRESS_TEST_FAULTS=0
CONFIG_HAVE_ARCH_KMSAN=y
# end of Memory Debugging

# CONFIG_DEBUG_SHIRQ is not set

#
# Debug Oops, Lockups and Hangs
#
CONFIG_PANIC_ON_OOPS=y
CONFIG_PANIC_TIMEOUT=86400
CONFIG_LOCKUP_DETECTOR=y
CONFIG_SOFTLOCKUP_DETECTOR=y
# CONFIG_SOFTLOCKUP_DETECTOR_INTR_STORM is not set
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=1
CONFIG_HAVE_HARDLOCKUP_DETECTOR_BUDDY=y
CONFIG_HARDLOCKUP_DETECTOR=y
# CONFIG_HARDLOCKUP_DETECTOR_PREFER_BUDDY is not set
CONFIG_HARDLOCKUP_DETECTOR_PERF=y
# CONFIG_HARDLOCKUP_DETECTOR_BUDDY is not set
# CONFIG_HARDLOCKUP_DETECTOR_ARCH is not set
CONFIG_HARDLOCKUP_DETECTOR_COUNTS_HRTIMER=y
CONFIG_HARDLOCKUP_CHECK_TIMESTAMP=y
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y
CONFIG_DETECT_HUNG_TASK=y
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=140
CONFIG_BOOTPARAM_HUNG_TASK_PANIC=1
# CONFIG_DETECT_HUNG_TASK_BLOCKER is not set
CONFIG_WQ_WATCHDOG=y
CONFIG_BOOTPARAM_WQ_STALL_PANIC=0
# CONFIG_WQ_CPU_INTENSIVE_REPORT is not set
# CONFIG_TEST_LOCKUP is not set
# end of Debug Oops, Lockups and Hangs

#
# Scheduler Debugging
#
CONFIG_SCHED_INFO=y
CONFIG_SCHEDSTATS=y
# end of Scheduler Debugging

CONFIG_DEBUG_PREEMPT=y
# CONFIG_DEBUG_ATOMIC is not set

#
# Lock Debugging (spinlocks, mutexes, etc...)
#
CONFIG_LOCK_DEBUGGING_SUPPORT=y
CONFIG_PROVE_LOCKING=y
CONFIG_PROVE_RAW_LOCK_NESTING=y
# CONFIG_LOCK_STAT is not set
CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y
CONFIG_DEBUG_RWSEMS=y
CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_LOCKDEP=y
CONFIG_LOCKDEP_BITS=20
CONFIG_LOCKDEP_CHAINS_BITS=20
CONFIG_LOCKDEP_STACK_TRACE_BITS=20
CONFIG_LOCKDEP_STACK_TRACE_HASH_BITS=14
CONFIG_LOCKDEP_CIRCULAR_QUEUE_BITS=12
# CONFIG_DEBUG_LOCKDEP is not set
CONFIG_DEBUG_ATOMIC_SLEEP=y
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
# CONFIG_LOCK_TORTURE_TEST is not set
# CONFIG_WW_MUTEX_SELFTEST is not set
# CONFIG_SCF_TORTURE_TEST is not set
CONFIG_CSD_LOCK_WAIT_DEBUG=y
# CONFIG_CSD_LOCK_WAIT_DEBUG_DEFAULT is not set
# end of Lock Debugging (spinlocks, mutexes, etc...)

CONFIG_TRACE_IRQFLAGS=y
CONFIG_TRACE_IRQFLAGS_NMI=y
CONFIG_NMI_CHECK_CPU=y
CONFIG_DEBUG_IRQFLAGS=y
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_KOBJECT is not set
# CONFIG_DEBUG_KOBJECT_RELEASE is not set

#
# Debug kernel data structures
#
CONFIG_DEBUG_LIST=y
CONFIG_DEBUG_PLIST=y
CONFIG_DEBUG_SG=y
CONFIG_DEBUG_NOTIFIERS=y
# CONFIG_DEBUG_CLOSURES is not set
CONFIG_DEBUG_MAPLE_TREE=y
# end of Debug kernel data structures

#
# RCU Debugging
#
CONFIG_PROVE_RCU=y
# CONFIG_RCU_SCALE_TEST is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_REF_SCALE_TEST is not set
CONFIG_RCU_CPU_STALL_TIMEOUT=100
CONFIG_RCU_EXP_CPU_STALL_TIMEOUT=0
# CONFIG_RCU_CPU_STALL_CPUTIME is not set
# CONFIG_RCU_TRACE is not set
CONFIG_RCU_EQS_DEBUG=y
# end of RCU Debugging

# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set
# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set
# CONFIG_LATENCYTOP is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_NOP_TRACER=y
CONFIG_HAVE_RETHOOK=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y
CONFIG_HAVE_FTRACE_REGS_HAVING_PT_REGS=y
CONFIG_HAVE_DYNAMIC_FTRACE_NO_PATCHABLE=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_JMP=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_FENTRY=y
CONFIG_HAVE_OBJTOOL_MCOUNT=y
CONFIG_HAVE_OBJTOOL_NOP_MCOUNT=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_HAVE_BUILDTIME_MCOUNT_SORT=y
CONFIG_TRACE_CLOCK=y
CONFIG_RING_BUFFER=y
CONFIG_EVENT_TRACING=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_PREEMPTIRQ_TRACEPOINTS=y
CONFIG_TRACING=y
CONFIG_GENERIC_TRACER=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
CONFIG_TRACEFS_AUTOMOUNT_DEPRECATED=y
# CONFIG_BOOTTIME_TRACING is not set
# CONFIG_FUNCTION_TRACER is not set
# CONFIG_STACK_TRACER is not set
# CONFIG_IRQSOFF_TRACER is not set
# CONFIG_PREEMPT_TRACER is not set
# CONFIG_SCHED_TRACER is not set
# CONFIG_HWLAT_TRACER is not set
# CONFIG_OSNOISE_TRACER is not set
# CONFIG_TIMERLAT_TRACER is not set
# CONFIG_MMIOTRACE is not set
# CONFIG_FTRACE_SYSCALLS is not set
# CONFIG_TRACER_SNAPSHOT is not set
CONFIG_BRANCH_PROFILE_NONE=y
# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
CONFIG_BLK_DEV_IO_TRACE=y
# CONFIG_PROBE_EVENTS_DUMP_FETCHARG is not set
CONFIG_UPROBE_EVENTS=y
CONFIG_EPROBE_EVENTS=y
CONFIG_BPF_EVENTS=y
CONFIG_DYNAMIC_EVENTS=y
CONFIG_PROBE_EVENTS=y
# CONFIG_SYNTH_EVENTS is not set
# CONFIG_USER_EVENTS is not set
# CONFIG_HIST_TRIGGERS is not set
CONFIG_TRACE_EVENT_INJECT=y
# CONFIG_TRACEPOINT_BENCHMARK is not set
# CONFIG_RING_BUFFER_BENCHMARK is not set
# CONFIG_TRACE_EVAL_MAP_FILE is not set
# CONFIG_FTRACE_STARTUP_TEST is not set
# CONFIG_RING_BUFFER_STARTUP_TEST is not set
CONFIG_RING_BUFFER_VALIDATE_TIME_DELTAS=y
# CONFIG_RING_BUFFER_PERSISTENT_INJECT is not set
# CONFIG_PREEMPTIRQ_DELAY_TEST is not set
# CONFIG_RV is not set
# CONFIG_TRACE_REMOTE_TEST is not set
CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
# CONFIG_SAMPLES is not set
CONFIG_HAVE_SAMPLE_FTRACE_DIRECT=y
CONFIG_HAVE_SAMPLE_FTRACE_DIRECT_MULTI=y
CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y
# CONFIG_STRICT_DEVMEM is not set

#
# x86 Debugging
#
CONFIG_EARLY_PRINTK_USB=y
CONFIG_X86_VERBOSE_BOOTUP=y
CONFIG_EARLY_PRINTK=y
CONFIG_EARLY_PRINTK_DBGP=y
# CONFIG_EARLY_PRINTK_USB_XDBC is not set
# CONFIG_DEBUG_TLBFLUSH is not set
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
# CONFIG_X86_DECODER_SELFTEST is not set
CONFIG_IO_DELAY_0X80=y
# CONFIG_IO_DELAY_0XED is not set
# CONFIG_IO_DELAY_UDELAY is not set
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEBUG_BOOT_PARAMS=y
# CONFIG_CPA_DEBUG is not set
CONFIG_DEBUG_ENTRY=y
# CONFIG_DEBUG_NMI_SELFTEST is not set
CONFIG_X86_DEBUG_FPU=y
# CONFIG_PUNIT_ATOM_DEBUG is not set
CONFIG_UNWINDER_ORC=y
# CONFIG_UNWINDER_FRAME_POINTER is not set
# end of x86 Debugging

#
# Kernel Testing and Coverage
#
# CONFIG_KUNIT is not set
# CONFIG_NOTIFIER_ERROR_INJECTION is not set
CONFIG_FAULT_INJECTION=y
CONFIG_FAILSLAB=y
CONFIG_FAIL_PAGE_ALLOC=y
CONFIG_FAULT_INJECTION_USERCOPY=y
CONFIG_FAIL_MAKE_REQUEST=y
CONFIG_FAIL_IO_TIMEOUT=y
CONFIG_FAIL_FUTEX=y
CONFIG_FAULT_INJECTION_DEBUG_FS=y
# CONFIG_FAIL_MMC_REQUEST is not set
# CONFIG_FAIL_SKB_REALLOC is not set
CONFIG_FAULT_INJECTION_CONFIGFS=y
# CONFIG_FAULT_INJECTION_STACKTRACE_FILTER is not set
CONFIG_ARCH_HAS_KCOV=y
CONFIG_KCOV=y
CONFIG_KCOV_ENABLE_COMPARISONS=y
CONFIG_KCOV_INSTRUMENT_ALL=y
CONFIG_KCOV_IRQ_AREA_SIZE=0x40000
# CONFIG_KCOV_SELFTEST is not set
CONFIG_RUNTIME_TESTING_MENU=y
# CONFIG_TEST_DHRY is not set
# CONFIG_LKDTM is not set
# CONFIG_TEST_DIV64 is not set
# CONFIG_TEST_MULDIV64 is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_TEST_REF_TRACKER is not set
# CONFIG_RBTREE_TEST is not set
# CONFIG_REED_SOLOMON_TEST is not set
# CONFIG_INTERVAL_TREE_TEST is not set
# CONFIG_PERCPU_TEST is not set
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_ASYNC_RAID6_TEST is not set
# CONFIG_TEST_HEXDUMP is not set
# CONFIG_TEST_KSTRTOX is not set
# CONFIG_TEST_BITMAP is not set
# CONFIG_TEST_XARRAY is not set
# CONFIG_TEST_MAPLE_TREE is not set
# CONFIG_TEST_RHASHTABLE is not set
# CONFIG_TEST_IDA is not set
# CONFIG_TEST_LKM is not set
# CONFIG_TEST_BITOPS is not set
# CONFIG_TEST_VMALLOC is not set
# CONFIG_TEST_WORKQUEUE is not set
# CONFIG_TEST_BPF is not set
# CONFIG_FIND_BIT_BENCHMARK is not set
# CONFIG_REGION_ALLOC_BENCHMARK is not set
# CONFIG_TEST_FIRMWARE is not set
# CONFIG_TEST_SYSCTL is not set
# CONFIG_CONTEXT_ANALYSIS_TEST is not set
# CONFIG_TEST_UDELAY is not set
# CONFIG_TEST_STATIC_KEYS is not set
# CONFIG_TEST_DYNAMIC_DEBUG is not set
# CONFIG_TEST_KMOD is not set
# CONFIG_TEST_KALLSYMS is not set
# CONFIG_TEST_DEBUG_VIRTUAL is not set
# CONFIG_TEST_MEMCAT_P is not set
# CONFIG_TEST_MEMINIT is not set
# CONFIG_TEST_HMM is not set
# CONFIG_TEST_FREE_PAGES is not set
# CONFIG_TEST_CLOCKSOURCE_WATCHDOG is not set
# CONFIG_TEST_OBJPOOL is not set
CONFIG_ARCH_USE_MEMTEST=y
# CONFIG_MEMTEST is not set
# end of Kernel Testing and Coverage

#
# Rust hacking
#
# end of Rust hacking
# end of Kernel hacking

CONFIG_IO_URING_ZCRX=y
CONFIG_IO_URING_BPF=y
KernelConfigManager ci-qemu-upstream
KernelRepo git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
ReproCID 0
ReproOpts
ReproSyzID 0
SyzkallerCommit a9a1fc32d4dcfddbb2a0d32be190e90417d7777a
TargetArch amd64
TargetOS linux

Outputs:
Reproduced ✅
EquivalenceAnalysis
The reproducer successfully triggered the expected crash. The crash signature matches the original bug description, with the same warning in `__mod_zone_page_state` triggered during CPU offline (`page_alloc_cpu_dead` -> `mlock_folio_batch` -> `__munlock_folio` -> `__zone_stat_mod_folio`). The warning indicates that `__mod_zone_page_state` is being called with preemption and interrupts enabled, which violates its constraints. The slight difference in the call trace (absence of `mlock_drain_remote`) is likely due to inlining or minor kernel version differences, but the root cause and the bug are identical.
OtherCrashReports
ReproC
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"

// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.

#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>

// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)

// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu)                                                \
	do {                                                           \
		cpu_set_t mask;                                        \
		CPU_ZERO(&mask);                                       \
		CPU_SET(cpu, &mask);                                   \
		if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
			perror("sched_setaffinity");                   \
		}                                                      \
	} while (0)

// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)

// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val)                                               \
	do {                                                             \
		while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
			;                                                \
	} while (0)

// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)

// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).

static inline double timer_elapsed_sec(struct timespec* start)
{
	struct timespec now;
	if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
		perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
		exit(1);
	}
	return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}

// Initialize a monotonic timer variable.
#define TIMER_START(t)                                          \
	struct timespec t;                                      \
	if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) {         \
		perror("clock_gettime(CLOCK_MONOTONIC) start"); \
		exit(1);                                        \
	}

// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))

// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
	int state;
} event_t;

static void event_init(event_t* ev)
{
	ev->state = 0;
}
static void event_reset(event_t* ev)
{
	ev->state = 0;
}

static void event_set(event_t* ev)
{
	if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
		fprintf(stderr, "event already set\n");
		exit(1);
	}
	__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
	syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}

static void event_wait(event_t* ev)
{
	while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
		syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}

// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
	int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
	if (uffd == -1)
		return -1;
	struct uffdio_api api = {.api = UFFD_API, .features = 0};
	if (ioctl(uffd, UFFDIO_API, &api) == -1) {
		close(uffd);
		return -1;
	}
	struct uffdio_register reg = {
	    .range = {.start = (uintptr_t)addr, .len = len},
	    .mode = UFFDIO_REGISTER_MODE_MISSING};
	if (ioctl(uffd, UFFDIO_REGISTER, &reg) == -1) {
		close(uffd);
		return -1;
	}
	return uffd;
}

// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
//    pause a thread accessing that memory until you handle the fault, creating a reliable
//    and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
//    immediately. This is essential for understanding the exact interleaving of events
//    when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
//    or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
//    Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
//        TIMER_START(start);
//        while (TIMER_NOT_EXPIRED(start, 10.0)) {
//            // Your race logic here
//        }

#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

volatile int step = 0;
void *addr;

void *thread0(void *arg) {
    PIN_TO_CPU(0);
    
    WAIT_ON(&step, 1);
    
    // Fault in the page on CPU 0.
    // It gets added to CPU 0's lru_add batch, but not yet on the LRU list.
    *(volatile char *)addr = 1;
    printf("[+] thread0: faulted in page on CPU 0\n");
    
    SIGNAL(&step, 2);
    
    // Spin to prevent CPU 0 from draining its lru_add batch.
    WAIT_ON(&step, 5);
    
    return NULL;
}

void *thread1(void *arg) {
    PIN_TO_CPU(1);
    
    WAIT_ON(&step, 2);
    
    // mlock the page on CPU 1.
    // It adds the page to CPU 1's mlock_fbatch with LRU_FOLIO, then drains it.
    // __mlock_folio sees the page is not on LRU (still in CPU 0's batch) and does nothing.
    int res = mlock(addr, 4096);
    if (res < 0) {
        printf("[-] Failed to mlock: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] mlock successful.\n");
    
    // munmap the page on CPU 1.
    // Since the VMA is locked, it calls munlock_vma_folio, which adds the page
    // to CPU 1's mlock_fbatch with NO flags. munmap does not drain the batch.
    res = munmap(addr, 4096);
    if (res < 0) {
        printf("[-] Failed to munmap: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] munmap successful.\n");
    
    SIGNAL(&step, 3);
    
    // Sleep until the test finishes.
    WAIT_ON(&step, 5);
    
    return NULL;
}

int main() {
    SETUP_UNBUFFERED_IO();
    
    // Pin main thread to CPU 2+ to avoid interfering with CPU 0 and 1.
    // If CPU 2 is not available, it will just fail and run anywhere.
    cpu_set_t set;
    CPU_ZERO(&set);
    for (int i = 2; i < 8; i++) {
        CPU_SET(i, &set);
    }
    int res = sched_setaffinity(0, sizeof(set), &set);
    if (res < 0) {
        printf("[-] Failed to sched_setaffinity (ignoring): %s\n", strerror(errno));
    } else {
        printf("[+] sched_setaffinity successful.\n");
    }
    
    // Ensure CPU 1 is online initially.
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "1\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    if (addr == MAP_FAILED) {
        printf("[-] Failed to mmap: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] mmap successful.\n");
    
    pthread_t t0, t1;
    res = pthread_create(&t0, NULL, thread0, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_create t0: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_create t0 successful.\n");
    
    res = pthread_create(&t1, NULL, thread1, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_create t1: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_create t1 successful.\n");
    
    SIGNAL(&step, 1);
    
    WAIT_ON(&step, 3);
    
    // Offline CPU 1.
    // This triggers page_alloc_cpu_dead -> mlock_drain_remote on a surviving CPU.
    // mlock_drain_remote calls __munlock_folio, which sees the page is not on LRU,
    // skips taking the LRU lock, and calls __zone_stat_mod_folio with preemption enabled,
    // triggering the warning.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "0\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    // Wait a bit to ensure the asynchronous warning is triggered and printed.
    sleep(1);
    
    SIGNAL(&step, 5);
    
    res = pthread_join(t0, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_join t0: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_join t0 successful.\n");
    
    res = pthread_join(t1, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_join t1: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_join t1 successful.\n");
    
    // Restore CPU 1.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "1\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    printf("[+] Done\n");
    return 0;
}
ReproducedBugTitle
WARNING in __mod_zone_page_state
ReproducedCrashReport
smpboot: CPU 1 is now offline
------------[ cut here ]------------
IS_ENABLED(CONFIG_PREEMPT_COUNT) && __lockdep_enabled && (preempt_count() == 0 && this_cpu_read(hardirqs_enabled))
WARNING: mm/vmstat.c:361 at __mod_zone_page_state+0xfc/0x140 mm/vmstat.c:361, CPU#0: syz-executor334/5899
Modules linked in:
CPU: 0 UID: 0 PID: 5899 Comm: syz-executor334 Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__mod_zone_page_state+0xfc/0x140 mm/vmstat.c:361
Code: c7 af 09 65 43 88 1c 34 5b 41 5c 41 5d 41 5e 41 5f 5d e9 c7 ac b2 09 cc 48 89 df 4c 89 fe 89 ea e8 59 00 00 00 31 db eb ce 90 <0f> 0b 90 eb 8b 48 c7 c7 40 d6 e6 8e 4c 89 f6 e8 30 2c fc 02 e9 34
RSP: 0000:ffffc9000354f890 EFLAGS: 00010202
RAX: 0000000000000001 RBX: ffffffffffffffff RCX: ffff888117054b00
RDX: ffffffffffffffff RSI: 0000000000000008 RDI: ffff88817fffc140
RBP: 0000000000000008 R08: ffffea00047ac9c7 R09: 1ffffd40008f5938
R10: dffffc0000000000 R11: fffff940008f5939 R12: ffffffff939bb700
R13: dffffc0000000000 R14: 0000000000000008 R15: ffff88817fffc140
FS:  000055557544d400(0000) GS:ffff8881a4c86000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055ef7c002388 CR3: 00000001867be000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 __zone_stat_mod_folio include/linux/vmstat.h:410 [inline]
 __munlock_folio mm/mlock.c:144 [inline]
 mlock_folio_batch+0x1a9c/0x3c00 mm/mlock.c:204
 page_alloc_cpu_dead+0x23/0x100 mm/page_alloc.c:6468
 cpuhp_invoke_callback+0x434/0x810 kernel/cpu.c:194
 __cpuhp_invoke_callback_range kernel/cpu.c:972 [inline]
 cpuhp_invoke_callback_range kernel/cpu.c:996 [inline]
 cpuhp_down_callbacks kernel/cpu.c:1386 [inline]
 _cpu_down+0x343/0x840 kernel/cpu.c:1457
 cpu_down_maps_locked kernel/cpu.c:1483 [inline]
 cpu_down kernel/cpu.c:1491 [inline]
 cpu_device_down+0x82/0xc0 kernel/cpu.c:1508
 device_offline+0x2d2/0x3c0 drivers/base/core.c:4283
 online_store+0x123/0x1a0 drivers/base/core.c:2883
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fae41a5a05e
Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
RSP: 002b:00007ffcba1a9468 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 000055557544d400 RCX: 00007fae41a5a05e
RDX: 0000000000000002 RSI: 00007fae41a9f0ff RDI: 0000000000000003
RBP: 00007fae41aa15e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fae41aa1578
R13: 00007fae41a9f09a R14: 00007fae41a9f0b9 R15: 0000000000000002
 </TASK>

Crash report:
smpboot: CPU 1 is now offline
------------[ cut here ]------------
IS_ENABLED(CONFIG_PREEMPT_COUNT) && __lockdep_enabled && (preempt_count() == 0 && this_cpu_read(hardirqs_enabled))
WARNING: mm/vmstat.c:361 at __mod_zone_page_state+0x96/0x190 mm/vmstat.c:361, CPU#0: syz.0.301/7156
Modules linked in:
CPU: 0 UID: 0 PID: 7156 Comm: syz.0.301 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__mod_zone_page_state+0x96/0x190 mm/vmstat.c:361
Code: d0 00 00 00 8b 05 7e 0b ed 0e 85 c0 74 1f 65 8b 05 e7 56 32 12 65 0b 05 30 10 32 12 75 0f 65 8b 05 33 52 32 12 85 c0 74 04 90 <0f> 0b 90 48 c7 c7 40 e3 ff 8b e8 9b 69 71 09 65 48 0f be 5d 00 48
RSP: 0000:ffffc900033ef8c0 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000000 RCX: 1ffffffff2289b6c
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88807ffd69b8
RBP: ffffffff948bfd88 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffffffffffffffff
R13: 0000000000000008 R14: ffff88807ffd6940 R15: ffffffff948bfd80
FS:  0000000000000000(0000) GS:ffff888096982000(0063) knlGS:00000000f5486b40
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000f5453ff4 CR3: 0000000053822000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 __zone_stat_mod_folio include/linux/vmstat.h:410 [inline]
 __munlock_folio mm/mlock.c:144 [inline]
 mlock_folio_batch+0xf97/0x36e0 mm/mlock.c:204
 mlock_drain_remote+0xe5/0x140 mm/mlock.c:230
 page_alloc_cpu_dead+0x16/0x130 mm/page_alloc.c:6468
 cpuhp_invoke_callback+0x3b4/0x9a0 kernel/cpu.c:194
 __cpuhp_invoke_callback_range+0x158/0x1d0 kernel/cpu.c:972
 cpuhp_invoke_callback_range kernel/cpu.c:996 [inline]
 cpuhp_down_callbacks kernel/cpu.c:1386 [inline]
 _cpu_down+0x523/0x1020 kernel/cpu.c:1457
 cpu_down_maps_locked kernel/cpu.c:1483 [inline]
 cpu_down kernel/cpu.c:1491 [inline]
 cpu_device_down+0x82/0xc0 kernel/cpu.c:1508
 device_offline drivers/base/core.c:4283 [inline]
 device_offline+0x2f4/0x400 drivers/base/core.c:4267
 online_store+0xd1/0x180 drivers/base/core.c:2883
 dev_attr_store+0x58/0x80 drivers/base/core.c:2509
 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x6af/0x1050 fs/read_write.c:687
 ksys_write+0x12a/0x250 fs/read_write.c:739
 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline]
 __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291
 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316
 entry_SYSENTER_compat_after_hwframe+0x84/0x8e
RIP: 0023:0xf7fc5fec
Code: Unable to access opcode bytes at 0xf7fc5fc2.
RSP: 002b:00000000f548650c EFLAGS: 00000292 ORIG_RAX: 0000000000000004
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000080000180
RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/08/27 19:17 flow repro-c
31m Results:
map[EquivalenceAnalysis:The reproducer successfully triggered the expected crash. The crash signature matches the original bug description, with the same warning in `__mod_zone_page_state` triggered during CPU offline (`page_alloc_cpu_dead` -> `mlock_folio_batch` -> `__munlock_folio` -> `__zone_stat_mod_folio`). The warning indicates that `__mod_zone_page_state` is being called with preemption and interrupts enabled, which violates its constraints. The slight difference in the call trace (absence of `mlock_drain_remote`) is likely due to inlining or minor kernel version differences, but the root cause and the bug are identical. OtherCrashReports:<nil> ReproC:// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"

// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.

#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>

// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)

// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu)                                                \
	do {                                                           \
		cpu_set_t mask;                                        \
		CPU_ZERO(&mask);                                       \
		CPU_SET(cpu, &mask);                                   \
		if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
			perror("sched_setaffinity");                   \
		}                                                      \
	} while (0)

// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)

// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val)                                               \
	do {                                                             \
		while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
			;                                                \
	} while (0)

// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)

// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).

static inline double timer_elapsed_sec(struct timespec* start)
{
	struct timespec now;
	if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
		perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
		exit(1);
	}
	return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}

// Initialize a monotonic timer variable.
#define TIMER_START(t)                                          \
	struct timespec t;                                      \
	if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) {         \
		perror("clock_gettime(CLOCK_MONOTONIC) start"); \
		exit(1);                                        \
	}

// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))

// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
	int state;
} event_t;

static void event_init(event_t* ev)
{
	ev->state = 0;
}
static void event_reset(event_t* ev)
{
	ev->state = 0;
}

static void event_set(event_t* ev)
{
	if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
		fprintf(stderr, "event already set\n");
		exit(1);
	}
	__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
	syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}

static void event_wait(event_t* ev)
{
	while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
		syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}

// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
	int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
	if (uffd == -1)
		return -1;
	struct uffdio_api api = {.api = UFFD_API, .features = 0};
	if (ioctl(uffd, UFFDIO_API, &api) == -1) {
		close(uffd);
		return -1;
	}
	struct uffdio_register reg = {
	    .range = {.start = (uintptr_t)addr, .len = len},
	    .mode = UFFDIO_REGISTER_MODE_MISSING};
	if (ioctl(uffd, UFFDIO_REGISTER, &reg) == -1) {
		close(uffd);
		return -1;
	}
	return uffd;
}

// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
//    pause a thread accessing that memory until you handle the fault, creating a reliable
//    and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
//    immediately. This is essential for understanding the exact interleaving of events
//    when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
//    or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
//    Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
//        TIMER_START(start);
//        while (TIMER_NOT_EXPIRED(start, 10.0)) {
//            // Your race logic here
//        }

#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

volatile int step = 0;
void *addr;

void *thread0(void *arg) {
    PIN_TO_CPU(0);
    
    WAIT_ON(&step, 1);
    
    // Fault in the page on CPU 0.
    // It gets added to CPU 0's lru_add batch, but not yet on the LRU list.
    *(volatile char *)addr = 1;
    printf("[+] thread0: faulted in page on CPU 0\n");
    
    SIGNAL(&step, 2);
    
    // Spin to prevent CPU 0 from draining its lru_add batch.
    WAIT_ON(&step, 5);
    
    return NULL;
}

void *thread1(void *arg) {
    PIN_TO_CPU(1);
    
    WAIT_ON(&step, 2);
    
    // mlock the page on CPU 1.
    // It adds the page to CPU 1's mlock_fbatch with LRU_FOLIO, then drains it.
    // __mlock_folio sees the page is not on LRU (still in CPU 0's batch) and does nothing.
    int res = mlock(addr, 4096);
    if (res < 0) {
        printf("[-] Failed to mlock: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] mlock successful.\n");
    
    // munmap the page on CPU 1.
    // Since the VMA is locked, it calls munlock_vma_folio, which adds the page
    // to CPU 1's mlock_fbatch with NO flags. munmap does not drain the batch.
    res = munmap(addr, 4096);
    if (res < 0) {
        printf("[-] Failed to munmap: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] munmap successful.\n");
    
    SIGNAL(&step, 3);
    
    // Sleep until the test finishes.
    WAIT_ON(&step, 5);
    
    return NULL;
}

int main() {
    SETUP_UNBUFFERED_IO();
    
    // Pin main thread to CPU 2+ to avoid interfering with CPU 0 and 1.
    // If CPU 2 is not available, it will just fail and run anywhere.
    cpu_set_t set;
    CPU_ZERO(&set);
    for (int i = 2; i < 8; i++) {
        CPU_SET(i, &set);
    }
    int res = sched_setaffinity(0, sizeof(set), &set);
    if (res < 0) {
        printf("[-] Failed to sched_setaffinity (ignoring): %s\n", strerror(errno));
    } else {
        printf("[+] sched_setaffinity successful.\n");
    }
    
    // Ensure CPU 1 is online initially.
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "1\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    if (addr == MAP_FAILED) {
        printf("[-] Failed to mmap: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] mmap successful.\n");
    
    pthread_t t0, t1;
    res = pthread_create(&t0, NULL, thread0, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_create t0: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_create t0 successful.\n");
    
    res = pthread_create(&t1, NULL, thread1, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_create t1: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_create t1 successful.\n");
    
    SIGNAL(&step, 1);
    
    WAIT_ON(&step, 3);
    
    // Offline CPU 1.
    // This triggers page_alloc_cpu_dead -> mlock_drain_remote on a surviving CPU.
    // mlock_drain_remote calls __munlock_folio, which sees the page is not on LRU,
    // skips taking the LRU lock, and calls __zone_stat_mod_folio with preemption enabled,
    // triggering the warning.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "0\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    // Wait a bit to ensure the asynchronous warning is triggered and printed.
    sleep(1);
    
    SIGNAL(&step, 5);
    
    res = pthread_join(t0, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_join t0: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_join t0 successful.\n");
    
    res = pthread_join(t1, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_join t1: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_join t1 successful.\n");
    
    // Restore CPU 1.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "1\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    printf("[+] Done\n");
    return 0;
} Reproduced:true ReproducedBugTitle:WARNING in __mod_zone_page_state ReproducedCrashReport:smpboot: CPU 1 is now offline
------------[ cut here ]------------
IS_ENABLED(CONFIG_PREEMPT_COUNT) && __lockdep_enabled && (preempt_count() == 0 && this_cpu_read(hardirqs_enabled))
WARNING: mm/vmstat.c:361 at __mod_zone_page_state+0xfc/0x140 mm/vmstat.c:361, CPU#0: syz-executor334/5899
Modules linked in:
CPU: 0 UID: 0 PID: 5899 Comm: syz-executor334 Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__mod_zone_page_state+0xfc/0x140 mm/vmstat.c:361
Code: c7 af 09 65 43 88 1c 34 5b 41 5c 41 5d 41 5e 41 5f 5d e9 c7 ac b2 09 cc 48 89 df 4c 89 fe 89 ea e8 59 00 00 00 31 db eb ce 90 <0f> 0b 90 eb 8b 48 c7 c7 40 d6 e6 8e 4c 89 f6 e8 30 2c fc 02 e9 34
RSP: 0000:ffffc9000354f890 EFLAGS: 00010202
RAX: 0000000000000001 RBX: ffffffffffffffff RCX: ffff888117054b00
RDX: ffffffffffffffff RSI: 0000000000000008 RDI: ffff88817fffc140
RBP: 0000000000000008 R08: ffffea00047ac9c7 R09: 1ffffd40008f5938
R10: dffffc0000000000 R11: fffff940008f5939 R12: ffffffff939bb700
R13: dffffc0000000000 R14: 0000000000000008 R15: ffff88817fffc140
FS:  000055557544d400(0000) GS:ffff8881a4c86000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055ef7c002388 CR3: 00000001867be000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 __zone_stat_mod_folio include/linux/vmstat.h:410 [inline]
 __munlock_folio mm/mlock.c:144 [inline]
 mlock_folio_batch+0x1a9c/0x3c00 mm/mlock.c:204
 page_alloc_cpu_dead+0x23/0x100 mm/page_alloc.c:6468
 cpuhp_invoke_callback+0x434/0x810 kernel/cpu.c:194
 __cpuhp_invoke_callback_range kernel/cpu.c:972 [inline]
 cpuhp_invoke_callback_range kernel/cpu.c:996 [inline]
 cpuhp_down_callbacks kernel/cpu.c:1386 [inline]
 _cpu_down+0x343/0x840 kernel/cpu.c:1457
 cpu_down_maps_locked kernel/cpu.c:1483 [inline]
 cpu_down kernel/cpu.c:1491 [inline]
 cpu_device_down+0x82/0xc0 kernel/cpu.c:1508
 device_offline+0x2d2/0x3c0 drivers/base/core.c:4283
 online_store+0x123/0x1a0 drivers/base/core.c:2883
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fae41a5a05e
Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
RSP: 002b:00007ffcba1a9468 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 000055557544d400 RCX: 00007fae41a5a05e
RDX: 0000000000000002 RSI: 00007fae41a9f0ff RDI: 0000000000000003
RBP: 00007fae41aa15e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fae41aa1578
R13: 00007fae41a9f09a R14: 00007fae41a9f0b9 R15: 0000000000000002
 </TASK>
]

1/1 2026/08/27 19:17 action kernel-checkouter
0m Results:
map[KernelSrc:/app/workdir/cache/src/26586918616cdc514e21c66cb948fcb557bc2c75]

2/1 2026/08/27 19:17 action kernel-builder
0m Results:
map[KernelObj:/app/workdir/cache/build/f105f29819000bd15776461fa9709c1788aeafe6]

3/1 2026/08/27 19:17 action codesearch-prepare
0m Results:
map[Index:codesearch-index]

4/1 2026/08/27 19:17 agent initial-researcher
10m Model:
deep-reasoning

Instruction:
You are a security researcher with deep Linux kernel background.
Your goal is to analyze a Linux kernel bug description and propose a strategy to reproduce it
with a minimal, standalone C program for the strictly defensive purpose of verifying a bugfix.

=== TOOL SELECTION GUIDELINES ===
- When looking up C function or struct definitions, prefer codesearch-definition-source
  and codesearch-struct-layout first.
- Fall back to read-file or grepper only if symbol lookup fails or when inspecting macros,
  headers, or non-C files.

=== CRITICAL PROHIBITIONS ===
- Do NOT propose an exploit. Focus solely on minimal technical reproduction of the bug state.
- Do NOT write long explanations. Keep your analysis and strategy proposal concise.
- Do NOT assume that the target bug has already been fixed just because a git commit title
  or description mentions a similar bug or fix. Commit messages often reference related issues
  or partial fixes. Proceed with proposing a reproduction strategy regardless of historical fix commits.
Prefer calling several tools at the same time to save round-trips.

Prompt:
Bug Description: WARNING in __mod_zone_page_state

smpboot: CPU 1 is now offline
------------[ cut here ]------------
IS_ENABLED(CONFIG_PREEMPT_COUNT) && __lockdep_enabled && (preempt_count() == 0 && this_cpu_read(hardirqs_enabled))
WARNING: mm/vmstat.c:361 at __mod_zone_page_state+0x96/0x190 mm/vmstat.c:361, CPU#0: syz.0.301/7156
Modules linked in:
CPU: 0 UID: 0 PID: 7156 Comm: syz.0.301 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__mod_zone_page_state+0x96/0x190 mm/vmstat.c:361
Code: d0 00 00 00 8b 05 7e 0b ed 0e 85 c0 74 1f 65 8b 05 e7 56 32 12 65 0b 05 30 10 32 12 75 0f 65 8b 05 33 52 32 12 85 c0 74 04 90 <0f> 0b 90 48 c7 c7 40 e3 ff 8b e8 9b 69 71 09 65 48 0f be 5d 00 48
RSP: 0000:ffffc900033ef8c0 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000000 RCX: 1ffffffff2289b6c
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88807ffd69b8
RBP: ffffffff948bfd88 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffffffffffffffff
R13: 0000000000000008 R14: ffff88807ffd6940 R15: ffffffff948bfd80
FS:  0000000000000000(0000) GS:ffff888096982000(0063) knlGS:00000000f5486b40
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000f5453ff4 CR3: 0000000053822000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 __zone_stat_mod_folio include/linux/vmstat.h:410 [inline]
 __munlock_folio mm/mlock.c:144 [inline]
 mlock_folio_batch+0xf97/0x36e0 mm/mlock.c:204
 mlock_drain_remote+0xe5/0x140 mm/mlock.c:230
 page_alloc_cpu_dead+0x16/0x130 mm/page_alloc.c:6468
 cpuhp_invoke_callback+0x3b4/0x9a0 kernel/cpu.c:194
 __cpuhp_invoke_callback_range+0x158/0x1d0 kernel/cpu.c:972
 cpuhp_invoke_callback_range kernel/cpu.c:996 [inline]
 cpuhp_down_callbacks kernel/cpu.c:1386 [inline]
 _cpu_down+0x523/0x1020 kernel/cpu.c:1457
 cpu_down_maps_locked kernel/cpu.c:1483 [inline]
 cpu_down kernel/cpu.c:1491 [inline]
 cpu_device_down+0x82/0xc0 kernel/cpu.c:1508
 device_offline drivers/base/core.c:4283 [inline]
 device_offline+0x2f4/0x400 drivers/base/core.c:4267
 online_store+0xd1/0x180 drivers/base/core.c:2883
 dev_attr_store+0x58/0x80 drivers/base/core.c:2509
 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x6af/0x1050 fs/read_write.c:687
 ksys_write+0x12a/0x250 fs/read_write.c:739
 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline]
 __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291
 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316
 entry_SYSENTER_compat_after_hwframe+0x84/0x8e
RIP: 0023:0xf7fc5fec
Code: Unable to access opcode bytes at 0xf7fc5fc2.
RSP: 002b:00000000f548650c EFLAGS: 00000292 ORIG_RAX: 0000000000000004
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000080000180
RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

Reply:
### Bug Analysis

The warning `WARNING in __mod_zone_page_state` is triggered because `__mod_zone_page_state()` expects preemption (or interrupts) to be disabled when updating per-CPU vmstat counters, but it is called with preemption enabled.

The call trace shows this happens during CPU offline:
1. `_cpu_down()` invokes the CPU hotplug callback `page_alloc_cpu_dead()` on a **surviving** CPU with preemption enabled.
2. `page_alloc_cpu_dead()` calls `mlock_drain_remote(cpu)` to drain the dead CPU's `mlock_fbatch`.
3. `mlock_drain_remote()` calls `mlock_folio_batch()` without disabling preemption.
4. `mlock_folio_batch()` processes a folio added via `munlock_folio()` and calls `__munlock_folio()`.
5. `__munlock_folio()` checks if the folio is on the LRU list via `folio_test_clear_lru()`. If it is, it locks the LRU lock (which disables interrupts) and proceeds safely.
6. However, if the folio is **not** on the LRU list, `folio_test_clear_lru()` returns false. `__munlock_folio()` skips taking the LRU lock and jumps directly to `munlock:`, calling `__zone_stat_mod_folio()` with preemption still enabled, triggering the warning.

To reproduce this, we need a folio that is added to `mlock_fbatch` via `munlock_folio()`, but is **not** on the LRU list when `mlock_drain_remote()` processes it. We can achieve this by exploiting the per-CPU `lru_add` batch:
1. **Thread 0 (CPU 0)** faults in a new page. The page is added to CPU 0's `lru_add` batch, but is not yet on the actual LRU list. Thread 0 then spins to prevent its batch from draining.
2. **Thread 1 (CPU 1)** calls `mlock()` on the page. `mlock()` adds the page to CPU 1's `mlock_fbatch` and drains it. `__mlock_folio()` sees the page is not on the LRU list and does nothing.
3. **Thread 1 (CPU 1)** calls `munmap()`. Since the VMA is locked, `munmap()` calls `munlock_vma_folio()`, which adds the page to CPU 1's `mlock_fbatch` with NO flags. `munmap()` does not drain the batch.
4. **Main Thread** offlines CPU 1. A surviving CPU executes `mlock_drain_remote(1)`, processes the folio, sees it's still not on the LRU list (still in CPU 0's batch), and calls `__zone_stat_mod_folio()` with preemption enabled.

### Minimal C Reproducer

```c
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <sched.h>
#include <string.h>

volatile int step = 0;
void *addr;

void pin_to_cpu(int cpu) {
    cpu_set_t set;
    CPU_ZERO(&set);
    CPU_SET(cpu, &set);
    if (sched_setaffinity(0, sizeof(set), &set) < 0) {
        perror("sched_setaffinity");
        exit(1);
    }
}

void *thread0(void *arg) {
    pin_to_cpu(0);
    
    while (step != 1) {}
    
    // Fault in the page on CPU 0.
    // It gets added to CPU 0's lru_add batch, but not yet on the LRU list.
    *(volatile char *)addr = 1;
    
    step = 2;
    
    // Spin to prevent CPU 0 from draining its lru_add batch.
    while (step != 5) {}
    
    return NULL;
}

void *thread1(void *arg) {
    pin_to_cpu(1);
    
    while (step != 2) {}
    
    // mlock the page on CPU 1.
    // It adds the page to CPU 1's mlock_fbatch with LRU_FOLIO, then drains it.
    // __mlock_folio sees the page is not on LRU (still in CPU 0's batch) and does nothing.
    if (mlock(addr, 4096) < 0) {
        perror("mlock");
    }
    
    // munmap the page on CPU 1.
    // Since the VMA is locked, it calls munlock_vma_folio, which adds the page
    // to CPU 1's mlock_fbatch with NO flags. munmap does not drain the batch.
    munmap(addr, 4096);
    
    step = 3;
    
    // Spin until this CPU goes offline.
    while (1) {}
    
    return NULL;
}

int main() {
    // Ensure CPU 1 is online initially.
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "1\n", 2);
        close(fd);
    }
    
    addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    if (addr == MAP_FAILED) {
        perror("mmap");
        return 1;
    }
    
    pthread_t t0, t1;
    pthread_create(&t0, NULL, thread0, NULL);
    pthread_create(&t1, NULL, thread1, NULL);
    
    step = 1;
    
    while (step != 3) {}
    
    // Offline CPU 1.
    // This triggers page_alloc_cpu_dead -> mlock_drain_remote on a surviving CPU.
    // mlock_drain_remote calls __munlock_folio, which sees the page is not on LRU,
    // skips taking the LRU lock, and calls __zone_stat_mod_folio with preemption enabled,
    // triggering the warning.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "0\n", 2);
        close(fd);
    }
    
    step = 5;
    pthread_join(t0, NULL);
    
    // Restore CPU 1.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "1\n", 2);
        close(fd);
    }
    
    return 0;
}
```

5/2 2026/08/27 19:17 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 4470
							output: 34
							thoughts: 343
						

Thoughts:
**My Thought Process Regarding the `WARNING in __mod_zone_page_state` Bug**

Right, so I've been looking into this `WARNING in __mod_zone_page_state` that's cropping up, and it seems to be rooted in the process of taking a CPU offline. The warning itself is quite specific: it fires when the `CONFIG_PREEMPT_COUNT` option is enabled, lockdep is active, and crucially, the preempt count is zero while hard interrupts are enabled on the current CPU. This combination immediately suggests a race condition or a lock ordering issue, especially within memory management and CPU hotplugging contexts.

The call trace is exceptionally helpful here. It clearly shows the sequence of events leading to this warning: `__mod_zone_page_state` is called by `__zone_stat_mod_folio`, which is ultimately invoked by `__munlock_folio`. This, in turn, is part of `mlock_folio_batch`, called by `mlock_drain_remote`. The critical part is that `mlock_drain_remote` is triggered by `page_alloc_cpu_dead`, and the trace continues up through `cpuhp_invoke_callback` to `_cpu_down`, `cpu_device_down`, `device_offline`, `online_store`, `sysfs_kf_write`, `vfs_write`. This entire chain points to a write operation to `/sys/devices/system/cpu/cpuX/online` – essentially, the user-space action of attempting to offline a CPU.

So, the core problem appears to be: when a CPU is being taken offline via the sysfs interface, the `page_alloc_cpu_dead` callback is invoked. This callback needs to perform some operations related to memory locking, specifically by calling `mlock_drain_remote`. This function then proceeds to drain remote locks, calling `mlock_folio_batch`. The batch processing of munlocking folios (`__munlock_folio`) then leads to modifications of zone statistics (`__zone_stat_mod_folio`), and it's within this modification function (`__mod_zone_page_state`) that the warning is triggered. The conditions for the warning—`preempt_count() == 0 && this_cpu_read(hardirqs_enabled)`—suggest that at the moment zone statistics are being updated, the CPU is in a state where it *should* be able to handle interrupts (hardirqs are enabled) but is also *not* in a preempted state. This is a sensitive point where certain memory management operations, especially those involving global or per-CPU statistics that might be accessed by other contexts, could become problematic if not properly serialized or handled.

My initial hypothesis is that `mlock_drain_remote` might be attempting to access or modify per-CPU memory statistics or structures on the CPU that is *being taken down* from a context that doesn't fully account for the ongoing shutdown process, or vice-versa. The `lockdep` warning strongly implies a violation of lock ordering or a potential deadlock scenario if the system were configured differently, but in this specific case, it's manifesting as a warning about state inconsistency *during* the CPU offline operation. The fact that `preempt_count()` is zero and `hardirqs_enabled` is true at the point of the warning within `__mod_zone_page_state` is the key. It implies that the code path within `__zone_stat_mod_folio` is being executed in a context where interrupts are enabled, but the state being modified (likely related to page allocation statistics) is being accessed in a way that the kernel's instrumentation flags as problematic when preempt count is zero and interrupts are enabled. I need to delve deeper into the specifics of `mlock_drain_remote` and `page_alloc_cpu_dead` to understand precisely what state they are trying to modify and why it clashes with the `__mod_zone_page_state` checks.


6/2 2026/08/27 19:17 tool grepper
0m Args:
map[Expression:__mod_zone_page_state PathPrefix:mm/vmstat.c]

Results:
map[Output:mm/vmstat.c=321=void set_pgdat_percpu_threshold(pg_data_t *pgdat,
--
mm/vmstat.c-345- */
mm/vmstat.c:346:void __mod_zone_page_state(struct zone *zone, enum zone_stat_item item,
mm/vmstat.c-347-			   long delta)
--
mm/vmstat.c-374-}
mm/vmstat.c:375:EXPORT_SYMBOL(__mod_zone_page_state);
mm/vmstat.c-376-
mm/vmstat.c=377=void __mod_node_page_state(struct pglist_data *pgdat, enum node_stat_item item,
--
mm/vmstat.c-395-
mm/vmstat.c:396:	/* See __mod_zone_page_state() */
mm/vmstat.c-397-	preempt_disable_nested();
--
mm/vmstat.c=436=void __inc_zone_state(struct zone *zone, enum zone_stat_item item)
--
mm/vmstat.c-441-
mm/vmstat.c:442:	/* See __mod_zone_page_state() */
mm/vmstat.c-443-	preempt_disable_nested();
--
mm/vmstat.c=457=void __inc_node_state(struct pglist_data *pgdat, enum node_stat_item item)
--
mm/vmstat.c-464-
mm/vmstat.c:465:	/* See __mod_zone_page_state() */
mm/vmstat.c-466-	preempt_disable_nested();
--
mm/vmstat.c=492=void __dec_zone_state(struct zone *zone, enum zone_stat_item item)
--
mm/vmstat.c-497-
mm/vmstat.c:498:	/* See __mod_zone_page_state() */
mm/vmstat.c-499-	preempt_disable_nested();
--
mm/vmstat.c=513=void __dec_node_state(struct pglist_data *pgdat, enum node_stat_item item)
--
mm/vmstat.c-520-
mm/vmstat.c:521:	/* See __mod_zone_page_state() */
mm/vmstat.c-522-	preempt_disable_nested();
--
mm/vmstat.c=691=void mod_zone_page_state(struct zone *zone, enum zone_stat_item item,
--
mm/vmstat.c-696-	local_irq_save(flags);
mm/vmstat.c:697:	__mod_zone_page_state(zone, item, delta);
mm/vmstat.c-698-	local_irq_restore(flags);
]

7/2 2026/08/27 19:17 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 5584
							output: 34
							thoughts: 19
						

Thoughts:
**My Thought Process on `vmstat.c`**

Okay, so I'm diving into the `vmstat.c` file, specifically targeting around line 361. This is where I expect to find the core logic for how the `vmstat` command gathers and presents virtual memory statistics. My goal is to understand the mechanics behind the output I see when I run `vmstat`. I'm thinking about what kind of data structures are likely being used to hold this information – probably arrays or structures to track memory usage, CPU states, I/O activity, etc. I'm also curious about the system calls involved. Is it directly reading from `/proc`? Is it using `sysinfo`? Or perhaps more granular system calls related to specific kernel structures? I'll be looking for how it translates raw kernel data into the human-readable metrics that `vmstat` is known for, like free memory, swap usage, CPU run queues, and disk I/O counts. Understanding this section will be key to grasping the overall data acquisition and processing pipeline of the utility.


8/2 2026/08/27 19:17 tool read-file
0m Args:
map[File:mm/vmstat.c FirstLine:340 LineCount:40]

Results:
map[Contents: 340:	
 341:	/*
 342:	 * For use when we know that interrupts are disabled,
 343:	 * or when we know that preemption is disabled and that
 344:	 * particular counter cannot be updated from interrupt context.
 345:	 */
 346:	void __mod_zone_page_state(struct zone *zone, enum zone_stat_item item,
 347:				   long delta)
 348:	{
 349:		struct per_cpu_zonestat __percpu *pcp = zone->per_cpu_zonestats;
 350:		s8 __percpu *p = pcp->vm_stat_diff + item;
 351:		long x;
 352:		long t;
 353:	
 354:		/*
 355:		 * Accurate vmstat updates require a RMW. On !PREEMPT_RT kernels,
 356:		 * atomicity is provided by IRQs being disabled -- either explicitly
 357:		 * or via local_lock_irq. On PREEMPT_RT, local_lock_irq only disables
 358:		 * CPU migrations and preemption potentially corrupts a counter so
 359:		 * disable preemption.
 360:		 */
 361:		preempt_disable_nested();
 362:	
 363:		x = delta + __this_cpu_read(*p);
 364:	
 365:		t = __this_cpu_read(pcp->stat_threshold);
 366:	
 367:		if (unlikely(abs(x) > t)) {
 368:			zone_page_state_add(x, zone, item);
 369:			x = 0;
 370:		}
 371:		__this_cpu_write(*p, x);
 372:	
 373:		preempt_enable_nested();
 374:	}
 375:	EXPORT_SYMBOL(__mod_zone_page_state);
 376:	
 377:	void __mod_node_page_state(struct pglist_data *pgdat, enum node_stat_item item,
 378:					long delta)
 379:	{
]

9/2 2026/08/27 19:17 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 6232
							output: 26
							thoughts: 54
						

Thoughts:
**My Thought Process on Investigating the Warning**

Right, I've spotted a warning originating at `preempt_disable_nested()`. My immediate instinct, knowing this system, is to question whether this is a simple function call or something more complex. It's highly probable that `preempt_disable_nested()` isn't a direct, standalone operation but rather a macro. Macros, as I know, often encapsulate conditional logic, checks, or even multiple operations.

Therefore, my next step is to confirm this suspicion and understand precisely *what* this macro is doing. I need to dig into the definition of `preempt_disable_nested()` to see if it's indeed performing checks – specifically, I'm expecting it to verify the current state of interrupt disabling and/or preemption disabling. This kind of check within a macro is a common pattern for enforcing certain invariants or providing debugging information about the system's state when these critical operations are attempted. I'll need to examine its source code to understand its internal logic.


10/2 2026/08/27 19:17 tool grepper
0m Args:
map[Expression:define preempt_disable_nested PathPrefix:]

Results:
map[Output:include/linux/preempt.h=391=static inline void preempt_notifier_init(struct preempt_notifier *notifier,
--
include/linux/preempt.h-482-/* Macro to avoid header recursion hell vs. lockdep */
include/linux/preempt.h:483:#define preempt_disable_nested()				\
include/linux/preempt.h-484-do {								\
]

11/2 2026/08/27 19:17 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 6407
							output: 36
							thoughts: 21
						

Thoughts:
**My Thought Process**

Okay, so I'm diving into `include/linux/preempt.h`, specifically targeting around line 483. My immediate goal is to understand the underlying logic and mechanics of preemptive scheduling within the Linux kernel. I'm expecting to find definitions, macros, or functions that dictate how the kernel handles preemption – that is, the ability of a higher-priority task to interrupt a lower-priority task that is currently running.

As an expert in this domain, I'm not just looking for a surface-level explanation. I'm keen on the *nuances*. What are the conditions under which preemption is allowed or disallowed? How are these states managed? Are there specific architectures or configurations that influence this behavior, and if so, how is that reflected in the code? I'll be looking for flags, bitmasks, or specific function calls that signal whether a process can be preempted, or if it's in a critical section that needs protection. I’m also curious about the performance implications – how does this particular section of code contribute to or affect the overall responsiveness and throughput of the system? I’ll be paying close attention to any interdependencies with other kernel subsystems, such as locking mechanisms or interrupt handling. The goal is to grasp the intricate dance of task switching and resource management that this header file is instrumental in orchestrating.


12/2 2026/08/27 19:18 tool read-file
0m Args:
map[File:include/linux/preempt.h FirstLine:480 LineCount:20]

Results:
map[Contents: 480:	 *  - RMW per CPU variable updates like vmstat.
 481:	 */
 482:	/* Macro to avoid header recursion hell vs. lockdep */
 483:	#define preempt_disable_nested()				\
 484:	do {								\
 485:		if (IS_ENABLED(CONFIG_PREEMPT_RT))			\
 486:			preempt_disable();				\
 487:		else							\
 488:			lockdep_assert_preemption_disabled();		\
 489:	} while (0)
 490:	
 491:	/**
 492:	 * preempt_enable_nested - Undo the effect of preempt_disable_nested()
 493:	 */
 494:	static __always_inline void preempt_enable_nested(void)
 495:	{
 496:		if (IS_ENABLED(CONFIG_PREEMPT_RT))
 497:			preempt_enable();
 498:	}
 499:	
]

13/2 2026/08/27 19:18 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 6736
							output: 36
							thoughts: 214
						

Thoughts:
**My Thought Process Unraveling a Preemption Warning**

Okay, so I'm digging into this warning message, and it's pointing directly at `lockdep_assert_preemption_disabled()`. My initial thought is that this assertion is meant to catch situations where preemption *is* disabled, but clearly, it's firing when it shouldn't be, or rather, when the *condition it's checking for* isn't met.

Then I look closer at the warning itself: `IS_ENABLED(CONFIG_PREEMPT_COUNT) && __lockdep_enabled && (preempt_count() == 0 && this_cpu_read(hardirqs_enabled))`. This is key. It's telling me that the problematic state is when `preempt_count()` is zero *and* `hardirqs_enabled` is true. What does that mean in practice? It means preemption is *not* disabled, and interrupts are also *not* disabled. This is precisely the scenario where `lockdep_assert_preemption_disabled()` *shouldn't* be asserting. It's finding a state where preemption is enabled but the assertion expects it to be disabled.

Now, I need to trace back *how* we got to this state. I examine the call trace provided: `page_alloc_cpu_dead` -> `mlock_drain_remote` -> `mlock_folio_batch` -> `__munlock_folio` -> `__zone_stat_mod_folio` -> `__mod_zone_page_state`. This gives me the sequence of events leading up to the problematic assertion. My immediate focus shifts to the topmost function in this stack, `page_alloc_cpu_dead`, as that's the entry point to this specific code path. I need to understand what `page_alloc_cpu_dead` is doing that could lead to this permissive preemption state during what might be expected to be a critical section.


14/2 2026/08/27 19:18 tool read-file
0m Args:
map[File:mm/page_alloc.c FirstLine:6450 LineCount:40]

Results:
map[Contents:6450:		VM_WARN_ON_ONCE(!IS_ALIGNED(page_to_pfn(page), nr_pages));
6451:		VM_WARN_ON_ONCE(order > MAX_PAGE_ORDER);
6452:	
6453:		for (i = 0; i < nr_pages; i++) {
6454:			clear_page_tag_ref(page + i);
6455:			set_page_count(page + i, 0);
6456:			ClearPageReserved(page + i);
6457:		}
6458:		adjust_managed_page_count(page, nr_pages);
6459:		__free_frozen_pages(page, order, FPI_NONE);
6460:	}
6461:	EXPORT_SYMBOL(free_reserved_pages);
6462:	
6463:	static int page_alloc_cpu_dead(unsigned int cpu)
6464:	{
6465:		struct zone *zone;
6466:	
6467:		lru_add_drain_cpu(cpu);
6468:		mlock_drain_remote(cpu);
6469:		drain_pages(cpu);
6470:	
6471:		/*
6472:		 * Spill the event counters of the dead processor
6473:		 * into the current processors event counters.
6474:		 * This artificially elevates the count of the current
6475:		 * processor.
6476:		 */
6477:		vm_events_fold_cpu(cpu);
6478:	
6479:		/*
6480:		 * Zero the differential counters of the dead processor
6481:		 * so that the vm statistics are consistent.
6482:		 *
6483:		 * This is only okay since the processor is dead and cannot
6484:		 * race with what we are doing.
6485:		 */
6486:		cpu_vm_stats_fold(cpu);
6487:	
6488:		for_each_populated_zone(zone)
6489:			zone_pcp_update(zone, 0);
]

15/2 2026/08/27 19:18 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 7558
							output: 34
							thoughts: 37
						

Thoughts:
**My Thought Process for `page_alloc_cpu_dead` and `mlock_drain_remote`**

Alright, so I've encountered this `page_alloc_cpu_dead` function, and my immediate instinct is to understand its downstream effects. My gaze naturally falls on the call to `mlock_drain_remote(cpu)`. This isn't just a random function call; it's a signal that something significant is happening in relation to memory locking and potentially resource reclamation associated with a specific CPU that's being marked as "dead" or unavailable.

My next logical step is to dive deep into `mlock_drain_remote(cpu)`. I need to dissect what this function *actually* does. My mind is already formulating questions:

*   What exactly is being "drained"? Is it locked memory pages, or perhaps something else entirely?
*   Why is this operation being performed specifically when a CPU is "dead"? Does this imply a need to release resources held by that CPU before it's completely out of commission?
*   What are the implications for memory integrity and availability when this draining process occurs? Are there any potential race conditions or performance bottlenecks I should be aware of?
*   What is the `cpu` parameter representing here? Is it a specific CPU ID, or a more abstract representation of a CPU state?

My expertise tells me that memory management, especially around CPU transitions and resource cleanup, is a critical area prone to subtle bugs. Therefore, understanding the precise semantics of `mlock_drain_remote` is paramount to ensure the overall stability and correctness of the memory allocation subsystem. I need to trace its execution path, examine its arguments, and understand its return values, if any, to build a comprehensive picture of its role within the `page_alloc_cpu_dead` sequence.


16/2 2026/08/27 19:18 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:220 LineCount:20]

Results:
map[Contents: 220:		local_unlock(&mlock_fbatch.lock);
 221:	}
 222:	
 223:	void mlock_drain_remote(int cpu)
 224:	{
 225:		struct folio_batch *fbatch;
 226:	
 227:		WARN_ON_ONCE(cpu_online(cpu));
 228:		fbatch = &per_cpu(mlock_fbatch.fbatch, cpu);
 229:		if (folio_batch_count(fbatch))
 230:			mlock_folio_batch(fbatch);
 231:	}
 232:	
 233:	bool need_mlock_drain(int cpu)
 234:	{
 235:		return folio_batch_count(&per_cpu(mlock_fbatch.fbatch, cpu));
 236:	}
 237:	
 238:	/**
 239:	 * mlock_folio - mlock a folio already on (or temporarily off) LRU
]

17/2 2026/08/27 19:18 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 7908
							output: 34
							thoughts: 34
						

Thoughts:
**My Thought Process on `mlock_drain_remote`**

Right, so I'm looking at this `mlock_drain_remote` function. My immediate instinct is to trace its execution flow, and the first thing I see is that it immediately calls `mlock_folio_batch` with a `fbatch` argument. This tells me that the core locking logic for a batch of folios is likely encapsulated within `mlock_folio_batch`. Therefore, to understand what `mlock_drain_remote` is actually *doing* in terms of memory locking, I need to dive into the implementation of `mlock_folio_batch`. That's the next logical step in my analysis.


18/2 2026/08/27 19:18 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:190 LineCount:30]

Results:
map[Contents: 190:		struct folio *folio;
 191:		int i;
 192:	
 193:		for (i = 0; i < folio_batch_count(fbatch); i++) {
 194:			folio = fbatch->folios[i];
 195:			mlock = (unsigned long)folio & (LRU_FOLIO | NEW_FOLIO);
 196:			folio = (struct folio *)((unsigned long)folio - mlock);
 197:			fbatch->folios[i] = folio;
 198:	
 199:			if (mlock & LRU_FOLIO)
 200:				lruvec = __mlock_folio(folio, lruvec);
 201:			else if (mlock & NEW_FOLIO)
 202:				lruvec = __mlock_new_folio(folio, lruvec);
 203:			else
 204:				lruvec = __munlock_folio(folio, lruvec);
 205:		}
 206:	
 207:		if (lruvec)
 208:			lruvec_unlock_irq(lruvec);
 209:		folios_put(fbatch);
 210:	}
 211:	
 212:	void mlock_drain_local(void)
 213:	{
 214:		struct folio_batch *fbatch;
 215:	
 216:		local_lock(&mlock_fbatch.lock);
 217:		fbatch = this_cpu_ptr(&mlock_fbatch.fbatch);
 218:		if (folio_batch_count(fbatch))
 219:			mlock_folio_batch(fbatch);
]

19/2 2026/08/27 19:18 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 8438
							output: 34
							thoughts: 35
						

Thoughts:
**My Thought Process**

Okay, so I'm looking at this `mlock_folio_batch` function and its primary action seems to be calling `__munlock_folio` with the `folio` and `lruvec` arguments. My immediate instinct here, given my understanding of memory management and folio operations, is to delve into the specifics of *how* `__munlock_folio` handles the unlocking process. I need to understand the underlying mechanics of what happens when a folio is officially unmarked as locked. This will likely involve examining page table manipulations, reference counting, and potentially how this interacts with the LRU (Least Recently Used) list management, given that `lruvec` is being passed. My goal is to get a granular view of the state changes within the kernel's memory subsystem as a result of this function call.


20/2 2026/08/27 19:18 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:130 LineCount:30]

Results:
map[Contents: 130:		isolated = true;
 131:		lruvec = folio_lruvec_relock_irq(folio, lruvec);
 132:	
 133:		if (folio_test_unevictable(folio)) {
 134:			/* Then mlock_count is maintained, but might undercount */
 135:			if (folio->mlock_count)
 136:				folio->mlock_count--;
 137:			if (folio->mlock_count)
 138:				goto out;
 139:		}
 140:		/* else assume that was the last mlock: reclaim will fix it if not */
 141:	
 142:	munlock:
 143:		if (folio_test_clear_mlocked(folio)) {
 144:			__zone_stat_mod_folio(folio, NR_MLOCK, -nr_pages);
 145:			if (isolated || !folio_test_unevictable(folio))
 146:				__count_vm_events(UNEVICTABLE_PGMUNLOCKED, nr_pages);
 147:			else
 148:				__count_vm_events(UNEVICTABLE_PGSTRANDED, nr_pages);
 149:		}
 150:	
 151:		/* folio_evictable() has to be checked *after* clearing Mlocked */
 152:		if (isolated && folio_test_unevictable(folio) && folio_evictable(folio)) {
 153:			lruvec_del_folio(lruvec, folio);
 154:			folio_clear_unevictable(folio);
 155:			lruvec_add_folio(lruvec, folio);
 156:			__count_vm_events(UNEVICTABLE_PGRESCUED, nr_pages);
 157:		}
 158:	out:
 159:		if (isolated)
]

21/2 2026/08/27 19:18 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 9018
							output: 34
							thoughts: 140
						

Thoughts:
**My Thought Process Unraveling the `__munlock_folio` and `folio_lruvec_relock_irq` Interaction**

Alright, let's trace this flow, starting with `__munlock_folio`. I see that it immediately calls `__zone_stat_mod_folio(folio, NR_MLOCK, -nr_pages)`. This is straightforward enough; it's about updating some statistics related to locked pages. However, my attention is immediately drawn to a subsequent line: `lruvec = folio_lruvec_relock_irq(folio, lruvec);`. This is where things get interesting, and I need to dig deeper.

My immediate thought is: "Why would `__munlock_folio` need to re-acquire a lock and disable interrupts *after* potentially modifying statistics?" The name `folio_lruvec_relock_irq` strongly suggests a locking operation, specifically acquiring a spinlock and masking interrupts. This seems like a rather heavy-handed operation if the primary goal is simply to release a lock or update stats.

So, I pause and think, "Is this re-locking always happening? What are the conditions for `folio_lruvec_relock_irq` to actually perform the lock and interrupt disable?" I recall the typical behavior of such functions. It's unlikely to acquire a lock and disable interrupts unconditionally. There must be a condition.

My next step is to examine the implementation of `folio_lruvec_relock_irq` itself. I'm looking for the specific logic that determines whether the lock and interrupt disabling actually occur. I'm betting that it's not a simple always-on behavior. I'm specifically checking for conditions like:

*   Is the `folio` currently in an "isolated" state? The term "isolated" often implies a need for stronger synchronization.
*   Does the `lruvec` pointer actually *change* during the call to `folio_lruvec_relock_irq`? If the `lruvec` is already the correct one, perhaps the re-locking isn't necessary.

My hypothesis is forming: the re-locking and interrupt disabling within `folio_lruvec_relock_irq` are conditional. They are likely only invoked when certain state changes occur or when the `folio` requires special handling, such as when it's being moved or its LRU status is being significantly altered in a way that necessitates strict synchronization.

To solidify this, I need to go back to the very beginning of `__munlock_folio`. I need to understand the state of `folio` and `lruvec` *before* the call to `folio_lruvec_relock_irq`. If, for example, `__munlock_folio` has already performed its core unlocking logic and has guaranteed that the folio is no longer in a state requiring strict LRU management, then the `folio_lruvec_relock_irq` call might be a no-op, or it might be there for robustness in specific edge cases. Conversely, if `__munlock_folio` *always* ends up in a state that triggers the re-locking logic, then my initial suspicion about the necessity of that re-locking might be misplaced, and it's just part of the established safe path for that function.


22/2 2026/08/27 19:18 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:100 LineCount:35]

Results:
map[Contents: 100:		return lruvec;
 101:	}
 102:	
 103:	static struct lruvec *__mlock_new_folio(struct folio *folio, struct lruvec *lruvec)
 104:	{
 105:		VM_BUG_ON_FOLIO(folio_test_lru(folio), folio);
 106:	
 107:		lruvec = folio_lruvec_relock_irq(folio, lruvec);
 108:	
 109:		/* As above, this is a little surprising, but possible */
 110:		if (unlikely(folio_evictable(folio)))
 111:			goto out;
 112:	
 113:		folio_set_unevictable(folio);
 114:		folio->mlock_count = !!folio_test_mlocked(folio);
 115:		__count_vm_events(UNEVICTABLE_PGCULLED, folio_nr_pages(folio));
 116:	out:
 117:		lruvec_add_folio(lruvec, folio);
 118:		folio_set_lru(folio);
 119:		return lruvec;
 120:	}
 121:	
 122:	static struct lruvec *__munlock_folio(struct folio *folio, struct lruvec *lruvec)
 123:	{
 124:		int nr_pages = folio_nr_pages(folio);
 125:		bool isolated = false;
 126:	
 127:		if (!folio_test_clear_lru(folio))
 128:			goto munlock;
 129:	
 130:		isolated = true;
 131:		lruvec = folio_lruvec_relock_irq(folio, lruvec);
 132:	
 133:		if (folio_test_unevictable(folio)) {
 134:			/* Then mlock_count is maintained, but might undercount */
]

23/2 2026/08/27 19:18 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 9737
							output: 27
							thoughts: 418
						

Thoughts:
**My Thought Process Regarding `mlock_folio_batch` and Potential Race Conditions**

Okay, I've been digging into the `mlock_folio_batch` function, and a specific scenario has caught my attention that seems to suggest a potential race condition, particularly concerning interrupt handling. My initial observation is that if the `!folio_test_clear_lru(folio)` condition evaluates to true, the code immediately jumps to the `munlock` label. This is significant because, as I see it, this jump bypasses the lock acquisition and interrupt disabling that *should* occur.

Let's trace this path more closely. The code snippet shows:

```c
	if (!folio_test_clear_lru(folio))
		goto munlock;

	isolated = true;
	lruvec = folio_lruvec_relock_irq(folio, lruvec);
...
munlock:
	if (folio_test_clear_mlocked(folio)) {
		__zone_stat_mod_folio(folio, NR_MLOCK, -nr_pages);
...
```

If `!folio_test_clear_lru(folio)` is true, then `isolated` remains `false`, and critically, `lruvec` is *not* relocked by `folio_lruvec_relock_irq`. This means interrupts would *not* be disabled at that point, especially if `lruvec` was initially NULL.

Now, I recall that `mlock_folio_batch` itself begins with `lruvec` being initialized to `NULL`. If the *very first* folio processed in the batch has its `mlock` count as 0 (leading to a call to `__munlock_folio`), and the `!folio_test_clear_lru(folio)` condition is met, we jump directly to `munlock`.

The consequence of this jump is that `__zone_stat_mod_folio(folio, NR_MLOCK, -nr_pages)` is called. This function, in turn, calls `__mod_zone_page_state`. The crucial point here is that *interrupts are not disabled* because we skipped the `folio_lruvec_relock_irq` call due to the early `goto`.

Furthermore, my concern extends to preemption. I'm thinking about the context in which `mlock_folio_batch` might be invoked. If this path is taken, and preemption is not explicitly disabled elsewhere, a race could occur. I'm checking if `page_alloc_cpu_dead`, which is called from `cpuhp_invoke_callback`, disables interrupts or preempts. I need to examine the implementation of `page_alloc_cpu_dead` to confirm whether interrupts are handled there, as this could be another point of vulnerability if the early `goto` bypasses necessary protections. My current understanding is that `page_alloc_cpu_dead` is called when a CPU is going offline, and it's essential to ensure that operations within `mlock_folio_batch` that modify zone statistics are protected against concurrent interruptions or preemptions if they occur during CPU hotplug events.


24/2 2026/08/27 19:18 tool grepper
0m Args:
map[Expression:page_alloc_cpu_dead PathPrefix:]

Results:
map[Output:mm/folio.c=822=static bool cpu_needs_drain(unsigned int cpu)
--
mm/folio.c-838- * Doesn't need any cpu hotplug locking because we do rely on per-cpu
mm/folio.c:839: * kworkers being shut down before our page_alloc_cpu_dead callback is
mm/folio.c-840- * executed on the offlined cpu.
--
mm/page_alloc.c=6461=EXPORT_SYMBOL(free_reserved_pages);
mm/page_alloc.c-6462-
mm/page_alloc.c:6463:static int page_alloc_cpu_dead(unsigned int cpu)
mm/page_alloc.c-6464-{
--
mm/page_alloc.c=6503=void __init page_alloc_init_cpuhp(void)
--
mm/page_alloc.c-6509-					page_alloc_cpu_online,
mm/page_alloc.c:6510:					page_alloc_cpu_dead);
mm/page_alloc.c-6511-	WARN_ON(ret < 0);
]

25/2 2026/08/27 19:18 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10464
							output: 34
							thoughts: 251
						

Thoughts:
**My Thought Process Regarding the `page_alloc_cpu_dead` Callback and Preemption Issues**

It seems I've stumbled upon a rather intricate bug related to CPU hotplugging and memory management, specifically within the `page_alloc_cpu_dead` callback. My initial understanding was that `page_alloc_cpu_dead` gets registered as a CPU hotplug callback. I recalled that generally, CPU hotplug callbacks related to memory allocation (like `CPUHP_PAGE_ALLOC` or similar) are executed with preemption enabled. The exception to this rule are those in the `CPUHP_AP_` range, which are handled on the *dying* CPU with interrupts disabled.

However, my reasoning immediately corrected itself: `page_alloc_cpu_dead` is a *dead* callback, meaning it's invoked on the *surviving* CPU, not the one being taken offline. This distinction is crucial. I then traced the execution path further, realizing `cpuhp_invoke_callback` is the function called from `_cpu_down`.

This led me to examine the warning message itself: `preempt_count() == 0 && this_cpu_read(hardirqs_enabled)`. This clearly indicates that preemption is, in fact, enabled, and hard interrupts are also enabled when this problematic code path is hit.

So, the core of the bug appears to be within `__munlock_folio`. Under specific conditions – namely, when `!folio_test_clear_lru(folio)` and `lruvec` is NULL – `__munlock_folio` can end up calling `__zone_stat_mod_folio` while preemption is active. This is problematic because operations that modify zone statistics should ideally be protected from preemption to maintain data integrity.

My immediate question then became: how can a folio be present in `mlock_fbatch` but *not* be on the LRU (Least Recently Used) list? `mlock_fbatch` is a batch of folios that are being processed for mlocking, and it's populated by the `mlock_folio` function. This disconnect suggests a potential race condition or a flaw in how folios are managed between mlocking and their LRU status during a CPU going offline. I need to dig deeper into the interaction between `mlock_folio`, the `mlock_fbatch`, and the LRU tracking mechanism to fully understand this discrepancy.


26/2 2026/08/27 19:18 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:230 LineCount:40]

Results:
map[Contents: 230:			mlock_folio_batch(fbatch);
 231:	}
 232:	
 233:	bool need_mlock_drain(int cpu)
 234:	{
 235:		return folio_batch_count(&per_cpu(mlock_fbatch.fbatch, cpu));
 236:	}
 237:	
 238:	/**
 239:	 * mlock_folio - mlock a folio already on (or temporarily off) LRU
 240:	 * @folio: folio to be mlocked.
 241:	 */
 242:	void mlock_folio(struct folio *folio)
 243:	{
 244:		struct folio_batch *fbatch;
 245:	
 246:		local_lock(&mlock_fbatch.lock);
 247:		fbatch = this_cpu_ptr(&mlock_fbatch.fbatch);
 248:	
 249:		if (!folio_test_set_mlocked(folio)) {
 250:			int nr_pages = folio_nr_pages(folio);
 251:	
 252:			zone_stat_mod_folio(folio, NR_MLOCK, nr_pages);
 253:			__count_vm_events(UNEVICTABLE_PGMLOCKED, nr_pages);
 254:		}
 255:	
 256:		folio_get(folio);
 257:		if (!folio_batch_add(fbatch, mlock_lru(folio)) ||
 258:		    !folio_may_be_lru_cached(folio) || lru_cache_disabled())
 259:			mlock_folio_batch(fbatch);
 260:		local_unlock(&mlock_fbatch.lock);
 261:	}
 262:	
 263:	/**
 264:	 * mlock_new_folio - mlock a newly allocated folio not yet on LRU
 265:	 * @folio: folio to be mlocked, either normal or a THP head.
 266:	 */
 267:	void mlock_new_folio(struct folio *folio)
 268:	{
 269:		struct folio_batch *fbatch;
]

27/2 2026/08/27 19:18 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 11353
							output: 26
							thoughts: 45
						

Thoughts:
**My Thought Process Regarding `mlock_folio` and its Interaction with the LRU Cache**

Ah, I've just encountered a piece of code involving `mlock_folio`. My immediate thought is to understand *how* this function integrates with the broader memory management infrastructure. Specifically, I'm looking at the fact that `mlock_folio` adds the folio to `mlock_fbatch`, and this addition is immediately followed by a call to `mlock_lru(folio)`. This sequence strikes me as significant.

My internal monologue then shifts to: "Okay, if `mlock_lru(folio)` is being called right after the folio is added to `mlock_fbatch`, then the behavior and purpose of `mlock_lru` in this context must be crucial to grasp." I need to understand what `mlock_lru` *does* with this newly added folio. Is it about positioning it within the Least Recently Used (LRU) cache? Is it about marking it for some specific eviction policy? The dependency is clear: `mlock_folio` is relying on `mlock_lru` to perform some action related to its LRU status or placement. Therefore, my next logical step is to dive into the implementation of `mlock_lru(folio)` to fully comprehend the implications of this operation within `mlock_folio`.


28/2 2026/08/27 19:18 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:define mlock_lru PathPrefix:]

Results:
map[Output:]

29/2 2026/08/27 19:18 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 11422
							output: 31
							thoughts: 13
						

Thoughts:
**My Thought Process on `mlock_lru`**

Alright, so the first thing that comes to my mind when I see `mlock_lru` is, "Okay, what exactly is this function designed to do?" My immediate instinct is to dive into the implementation details to understand its purpose and mechanism. I'm thinking about the core functionalities: it likely deals with memory locking, and the `lru` part strongly suggests a Least Recently Used eviction strategy. So, I'm anticipating a process where pages are pinned in memory, but there's also a mechanism to decide *which* pages to evict when memory pressure arises.

My brain is already framing the questions:
*   **What's the trigger for `mlock_lru`?** Is it called proactively, or is it a response to a specific event or condition?
*   **What are the parameters it takes?** The name itself doesn't give much away about inputs, so I'm eager to see what data it operates on or what configuration it accepts.
*   **How does it interact with the underlying memory management system?** I'm assuming it's leveraging system calls (like `mlock()`, `mlockall()`, or similar) but the LRU aspect points to a user-space or kernel-level policy managing *which* pages get the `mlock` treatment.
*   **What is the "LRU" implementation here?** Is it a simple linked list, a more sophisticated data structure, or some approximation? How does it track usage? Is it per-process, global, or something else?
*   **What are the potential performance implications?** Locking memory can be beneficial for predictable performance, but an inefficient LRU or excessive locking could lead to memory starvation or contention. I'm already mentally benchmarking the potential overhead.
*   **What are the error handling mechanisms?** Memory operations can fail. What happens if `mlock` fails? What if the LRU data structure encounters an issue?

Essentially, my primary goal is to dissect `mlock_lru` to understand its role in the broader system. I'm looking for its precise behavior, its dependencies, and its impact, with a keen eye for any potential optimizations or pitfalls that an expert in memory management would immediately recognize. I'm not just reading the code; I'm interrogating it to grasp the *why* and the *how* behind its existence.


30/2 2026/08/27 19:18 tool grepper
0m Args:
map[Expression:mlock_lru PathPrefix:mm/mlock.c]

Results:
map[Output:mm/mlock.c=122=static struct lruvec *__munlock_folio(struct folio *folio, struct lruvec *lruvec)
--
mm/mlock.c-168-#define NEW_FOLIO 0x2
mm/mlock.c:169:static inline struct folio *mlock_lru(struct folio *folio)
mm/mlock.c-170-{
--
mm/mlock.c=242=void mlock_folio(struct folio *folio)
--
mm/mlock.c-256-	folio_get(folio);
mm/mlock.c:257:	if (!folio_batch_add(fbatch, mlock_lru(folio)) ||
mm/mlock.c-258-	    !folio_may_be_lru_cached(folio) || lru_cache_disabled())
]

31/2 2026/08/27 19:18 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 11678
							output: 34
							thoughts: 13
						

Thoughts:
**My Thought Process on `mlock_lru`**

My initial impulse is to deeply understand the intricacies of `mlock_lru`. I want to get to the absolute core of its definition, to grasp not just what it *is*, but *why* it is and *how* it functions at its most fundamental level. I'm not looking for a superficial overview; I'm diving deep, seeking the foundational principles that govern its existence and operation within the system.


32/2 2026/08/27 19:18 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:165 LineCount:20]

Results:
map[Contents: 165:	 * Flags held in the low bits of a struct folio pointer on the mlock_fbatch.
 166:	 */
 167:	#define LRU_FOLIO 0x1
 168:	#define NEW_FOLIO 0x2
 169:	static inline struct folio *mlock_lru(struct folio *folio)
 170:	{
 171:		return (struct folio *)((unsigned long)folio + LRU_FOLIO);
 172:	}
 173:	
 174:	static inline struct folio *mlock_new(struct folio *folio)
 175:	{
 176:		return (struct folio *)((unsigned long)folio + NEW_FOLIO);
 177:	}
 178:	
 179:	/*
 180:	 * mlock_folio_batch() is derived from folio_batch_move_lru(): perhaps that can
 181:	 * make use of such folio pointer flags in future, but for now just keep it for
 182:	 * mlock.  We could use three separate folio batches instead, but one feels
 183:	 * better (munlocking a full folio batch does not need to drain mlocking folio
 184:	 * batches first).
]

33/2 2026/08/27 19:18 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 12052
							output: 30
							thoughts: 48
						

Thoughts:
**My Thought Process Regarding Folio Locking and Unlocking**

As I delve into the intricacies of memory management and specifically how folios are handled, a crucial detail regarding their flags has surfaced, prompting this detailed reflection.

Initially, I observed the function `mlock_folio`. My understanding, or at least my initial hypothesis, was that `mlock_folio` would indeed incorporate the folio into the system with a specific flag, which I deduced to be `LRU_FOLIO`. This makes intuitive sense; when a folio is locked (meaning it's being actively held in memory due to an explicit lock request), it's often beneficial for the system to be aware of its presence within the Least Recently Used (LRU) eviction policy, perhaps to prioritize its retention or track its usage patterns.

However, a subsequent examination of `munlock_folio` led to a moment of critical re-evaluation. I noticed that `munlock_folio`, the counterpart to `mlock_folio`, appears to add the folio back into the management system, but *without* any flags. This struck me as an immediate discrepancy, as I had expected unlocking to potentially mirror the locking behavior in some way, or at least maintain some trace of its prior locked state. The absence of any flags, particularly the `LRU_FOLIO` flag I had assumed was relevant, suggested a fundamentally different handling of folios upon unlocking.

This observation immediately triggered a directive to investigate further. My thought process then shifted to a direct examination of the `munlock_folio` implementation. I needed to confirm my observation and understand *why* this apparent difference in flag handling exists. Is it a deliberate design choice? Is there a performance implication? Or perhaps a nuanced aspect of the memory management subsystem that I'm not fully appreciating yet? This leads me directly to the next step: "Let's check `munlock_folio`." This signifies my intention to trace the code, examine the data structures, and understand the precise logic governing the state of a folio when its lock is released. I need to see how the flags are manipulated (or, in this case, seemingly disregarded) to ensure my understanding is accurate and complete, especially given my expertise in this domain.


34/2 2026/08/27 19:19 tool grepper
0m Args:
map[Expression:munlock_folio PathPrefix:mm/mlock.c]

Results:
map[Output:mm/mlock.c=103=static struct lruvec *__mlock_new_folio(struct folio *folio, struct lruvec *lruvec)
--
mm/mlock.c-121-
mm/mlock.c:122:static struct lruvec *__munlock_folio(struct folio *folio, struct lruvec *lruvec)
mm/mlock.c-123-{
--
mm/mlock.c=186=static void mlock_folio_batch(struct folio_batch *fbatch)
--
mm/mlock.c-203-		else
mm/mlock.c:204:			lruvec = __munlock_folio(folio, lruvec);
mm/mlock.c-205-	}
--
mm/mlock.c=267=void mlock_new_folio(struct folio *folio)
--
mm/mlock.c-286-/**
mm/mlock.c:287: * munlock_folio - munlock a folio
mm/mlock.c-288- * @folio: folio to be munlocked, either normal or a THP head.
mm/mlock.c-289- */
mm/mlock.c:290:void munlock_folio(struct folio *folio)
mm/mlock.c-291-{
--
mm/mlock.c-296-	/*
mm/mlock.c:297:	 * folio_test_clear_mlocked(folio) must be left to __munlock_folio(),
mm/mlock.c-298-	 * which will check whether the folio is multiply mlocked.
--
mm/mlock.c=350=static int mlock_pte_range(pmd_t *pmd, unsigned long addr,
--
mm/mlock.c-373-		else
mm/mlock.c:374:			munlock_folio(folio);
mm/mlock.c-375-		goto out;
--
mm/mlock.c-398-		else
mm/mlock.c:399:			munlock_folio(folio);
mm/mlock.c-400-
]

35/2 2026/08/27 19:19 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 12673
							output: 34
							thoughts: 12
						

Thoughts:
**My Thought Process on `munlock_folio`**

My immediate concern is to understand precisely what `munlock_folio` entails. I need to delve into its definition to grasp its functionality, its purpose within the larger system, and its potential implications. This isn't just a quick glance; I'm aiming for a deep understanding. I want to know what data structures it operates on, what memory regions it manages, and under what conditions it is invoked. Is it a low-level memory management primitive? Does it relate to memory locking for performance or security reasons? Is it part of a specific subsystem or module? Understanding these foundational aspects is crucial before I can even begin to consider its behavior, its interactions with other components, or any potential issues it might present. It's about building a complete mental model of this entity.


36/2 2026/08/27 19:19 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:285 LineCount:25]

Results:
map[Contents: 285:	
 286:	/**
 287:	 * munlock_folio - munlock a folio
 288:	 * @folio: folio to be munlocked, either normal or a THP head.
 289:	 */
 290:	void munlock_folio(struct folio *folio)
 291:	{
 292:		struct folio_batch *fbatch;
 293:	
 294:		local_lock(&mlock_fbatch.lock);
 295:		fbatch = this_cpu_ptr(&mlock_fbatch.fbatch);
 296:		/*
 297:		 * folio_test_clear_mlocked(folio) must be left to __munlock_folio(),
 298:		 * which will check whether the folio is multiply mlocked.
 299:		 */
 300:		folio_get(folio);
 301:		if (!folio_batch_add(fbatch, folio) ||
 302:		    !folio_may_be_lru_cached(folio) || lru_cache_disabled())
 303:			mlock_folio_batch(fbatch);
 304:		local_unlock(&mlock_fbatch.lock);
 305:	}
 306:	
 307:	static inline unsigned int folio_mlock_step(struct folio *folio,
 308:			pte_t *pte, unsigned long addr, unsigned long end)
 309:	{
]

37/2 2026/08/27 19:19 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 13104
							output: 34
							thoughts: 371
						

Thoughts:
**My Thought Process Regarding `munlock_folio` and Memory Locking Operations**

Okay, let me walk through my current line of thinking. I've been examining the behavior of `munlock_folio` and its interaction with the `fbatch` structure.

My initial observation is that when `munlock_folio` is called, it adds the folio in question to the `fbatch` structure, but crucially, it does so *without any flags*. This detail is important because it dictates how `mlock_folio_batch` will subsequently handle it.

So, when `mlock_folio_batch` processes this folio from the batch, it proceeds to call `__munlock_folio`. Now, within `__munlock_folio`, there's a conditional check: `if (!folio_test_clear_lru(folio))`. If this condition evaluates to true, meaning the folio is *not* on the LRU list, the execution jumps to the `munlock:` label. At this point, a call is made to `__zone_stat_mod_folio(folio, NR_MLOCK, -nr_pages)`.

This is where my internal alarm bells started to ring. If `!folio_test_clear_lru(folio)` is true, it explicitly tells me that the folio is *not* currently part of the LRU list. Yet, `munlock_folio` is being invoked on this folio. My confusion arises from the fact that `__munlock_folio` is modifying zone statistics in this scenario, which seems counterintuitive if the folio isn't even managed by the LRU.

My next step was to trace the execution path of `__munlock_folio` and, by extension, `mlock_folio_batch`. I see that `mlock_folio_batch` is ultimately called from `mlock_drain_remote`. The context for this call is during a CPU offline event. Specifically, `mlock_drain_remote` is invoked on the *surviving* CPU when another CPU is going offline.

Tracing further back, `mlock_drain_remote` itself is called from `page_alloc_cpu_dead`, which in turn is invoked via `cpuhp_invoke_callback`. This led me to question the preemption state within `page_alloc_cpu_dead`. My current understanding is that `page_alloc_cpu_dead` is executed with preemption *enabled*.

However, this observation then triggered another thought: I recalled that `mlock_drain_local` employs `local_lock(&mlock_fbatch.lock)`. This locking mechanism inherently disables preemption (or interrupts on non-RT systems). The stark contrast is that `mlock_drain_remote`, the function I'm currently focused on, *does not* appear to use this `local_lock`. This absence of explicit local locking in `mlock_drain_remote` is a critical point I'm currently re-examining. I need to revisit the exact implementation of `mlock_drain_remote` to be absolutely certain about its locking behavior and its implications for preemption and the state of the `fbatch`.


38/2 2026/08/27 19:19 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:220 LineCount:15]

Results:
map[Contents: 220:		local_unlock(&mlock_fbatch.lock);
 221:	}
 222:	
 223:	void mlock_drain_remote(int cpu)
 224:	{
 225:		struct folio_batch *fbatch;
 226:	
 227:		WARN_ON_ONCE(cpu_online(cpu));
 228:		fbatch = &per_cpu(mlock_fbatch.fbatch, cpu);
 229:		if (folio_batch_count(fbatch))
 230:			mlock_folio_batch(fbatch);
 231:	}
 232:	
 233:	bool need_mlock_drain(int cpu)
 234:	{
]

39/2 2026/08/27 19:19 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 13710
							output: 31
							thoughts: 420
						

Thoughts:
**My Thought Process Unraveling a Locking Anomaly**

Okay, so I'm digging into this `mlock_drain_remote` function, and my initial understanding was way off. I thought it was acquiring some kind of lock, but it's actually *not*. It simply delegates to `mlock_folio_batch`. My focus then shifted to what `mlock_folio_batch` was doing.

My investigation revealed a critical point: `mlock_folio_batch` can call `__munlock_folio`. Inside `__munlock_folio`, there's a conditional branch based on `folio_test_clear_lru(folio)`. If this condition is *false* (meaning `!folio_test_clear_lru(folio)` is true), it proceeds to call `__zone_stat_mod_folio` *without* taking any locks at all. This immediately raised a red flag because `__zone_stat_mod_folio` relies on specific locking assumptions.

I then examined the *other* branch. If `folio_test_clear_lru(folio)` is *true*, it calls `folio_lruvec_relock_irq(folio, lruvec)`. This function *does* acquire the `lruvec` spinlock, and importantly, it *disables interrupts*. This means that when `__zone_stat_mod_folio` is called in *this specific scenario*, interrupts are indeed disabled.

The crucial disconnect became apparent when I compared this to the entry point, `mlock_drain_remote`. It doesn't disable preemption or interrupts itself. Therefore, when `mlock_folio_batch` is invoked directly from `mlock_drain_remote`, and the `!folio_test_clear_lru(folio)` path is taken, `__zone_stat_mod_folio` ends up being called with *both* preemption and interrupts enabled. This directly violates the expectations of `__mod_zone_page_state` (which `__zone_stat_mod_folio` calls internally), leading to the warning I'm seeing because it *expects* preemption to be disabled.

This then prompted me to consider a different execution path: what if `mlock_folio_batch` was called from `mlock_drain_local` instead? I know that `mlock_drain_local` starts by calling `local_lock(&mlock_fbatch.lock)`. I need to confirm the exact behavior of `local_lock` here. If `mlock_fbatch.lock` is indeed a `local_lock_t`, then `local_lock` *does* disable preemption. And if it's a `local_lock_irq`, it would also disable interrupts on non-RT systems. So, this alternative call site might have a different locking context, which is what I'm about to investigate by checking the definition of `mlock_fbatch`.


40/2 2026/08/27 19:19 tool grepper
0m Args:
map[Expression:mlock_fbatch PathPrefix:mm/mlock.c]

Results:
map[Output:mm/mlock.c-30-
mm/mlock.c:31:struct mlock_fbatch {
mm/mlock.c-32-	local_lock_t lock;
--
mm/mlock.c-35-
mm/mlock.c:36:static DEFINE_PER_CPU(struct mlock_fbatch, mlock_fbatch) = {
mm/mlock.c-37-	.lock = INIT_LOCAL_LOCK(lock),
--
mm/mlock.c=122=static struct lruvec *__munlock_folio(struct folio *folio, struct lruvec *lruvec)
--
mm/mlock.c-164-/*
mm/mlock.c:165: * Flags held in the low bits of a struct folio pointer on the mlock_fbatch.
mm/mlock.c-166- */
--
mm/mlock.c=212=void mlock_drain_local(void)
--
mm/mlock.c-215-
mm/mlock.c:216:	local_lock(&mlock_fbatch.lock);
mm/mlock.c:217:	fbatch = this_cpu_ptr(&mlock_fbatch.fbatch);
mm/mlock.c-218-	if (folio_batch_count(fbatch))
mm/mlock.c-219-		mlock_folio_batch(fbatch);
mm/mlock.c:220:	local_unlock(&mlock_fbatch.lock);
mm/mlock.c-221-}
--
mm/mlock.c=223=void mlock_drain_remote(int cpu)
--
mm/mlock.c-227-	WARN_ON_ONCE(cpu_online(cpu));
mm/mlock.c:228:	fbatch = &per_cpu(mlock_fbatch.fbatch, cpu);
mm/mlock.c-229-	if (folio_batch_count(fbatch))
--
mm/mlock.c=233=bool need_mlock_drain(int cpu)
mm/mlock.c-234-{
mm/mlock.c:235:	return folio_batch_count(&per_cpu(mlock_fbatch.fbatch, cpu));
mm/mlock.c-236-}
--
mm/mlock.c=242=void mlock_folio(struct folio *folio)
--
mm/mlock.c-245-
mm/mlock.c:246:	local_lock(&mlock_fbatch.lock);
mm/mlock.c:247:	fbatch = this_cpu_ptr(&mlock_fbatch.fbatch);
mm/mlock.c-248-
--
mm/mlock.c-259-		mlock_folio_batch(fbatch);
mm/mlock.c:260:	local_unlock(&mlock_fbatch.lock);
mm/mlock.c-261-}
--
mm/mlock.c=267=void mlock_new_folio(struct folio *folio)
--
mm/mlock.c-271-
mm/mlock.c:272:	local_lock(&mlock_fbatch.lock);
mm/mlock.c:273:	fbatch = this_cpu_ptr(&mlock_fbatch.fbatch);
mm/mlock.c-274-	folio_set_mlocked(folio);
--
mm/mlock.c-282-		mlock_folio_batch(fbatch);
mm/mlock.c:283:	local_unlock(&mlock_fbatch.lock);
mm/mlock.c-284-}
--
mm/mlock.c=290=void munlock_folio(struct folio *folio)
--
mm/mlock.c-293-
mm/mlock.c:294:	local_lock(&mlock_fbatch.lock);
mm/mlock.c:295:	fbatch = this_cpu_ptr(&mlock_fbatch.fbatch);
mm/mlock.c-296-	/*
--
mm/mlock.c-303-		mlock_folio_batch(fbatch);
mm/mlock.c:304:	local_unlock(&mlock_fbatch.lock);
mm/mlock.c-305-}
]

41/2 2026/08/27 19:19 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 15267
							output: 34
							thoughts: 342
						

Thoughts:
**My Thought Process Unraveling `mlock` and Preemption**

Okay, so I've been digging into this `mlock` code, specifically how it interacts with preemption and memory state tracking. My initial observation was that `local_lock` effectively disables preemption. This seemed straightforward: if any of the functions like `mlock_folio_batch`, `munlock_folio`, `mlock_new_folio`, or `mlock_folio` are called while `local_lock` is held, preemption is off. This, in turn, explains why I wasn't seeing warnings from `__mod_zone_page_state` – the `preempt_count()` would be greater than zero.

But then I hit a bit of a snag with `mlock_drain_remote`. This function, unlike the others I just mentioned, *doesn't* call `local_lock`. It proceeds to call `mlock_folio_batch` directly. My first question was, "Why the inconsistency? Why bypass `local_lock` here?"

My immediate thought was that `mlock_drain_remote` must be dealing with something *remote*, and `local_lock` only operates on the local CPU's lock. This seemed like a logical distinction.

However, a deeper dive made me pause. `mlock_drain_remote` is *executed* on the local CPU, even though it might be interacting with a "remote" `mlock_fbatch`. If it's running locally, shouldn't it still disable preemption to protect itself? What was it protecting against?

Then the context of `mlock_drain_remote` clicked. It's actually called during CPU offline events. Ah, that's the key! When a CPU is going offline, it's essentially no longer active in the preemption sense. So, there's no immediate need for `local_lock` to prevent concurrent access from other running tasks on that *specific* CPU because, well, there aren't any actively running tasks to contend with.

But the plot thickens. `mlock_folio_batch`, which *is* called by `mlock_drain_remote`, eventually leads to `__munlock_folio`. And `__munlock_folio` calls `__zone_stat_mod_folio`, which in turn calls `__mod_zone_page_state`. And *this* is where it gets interesting again.

My understanding is that `__mod_zone_page_state` isn't just for some global memory state; it specifically updates the *local* CPU's vmstat counters. This means that even though `mlock_drain_remote` might be operating in a context of a CPU going offline and doesn't need `local_lock` for preemption protection on *that* CPU's future operations, the subsequent calls *do* modify per-CPU state relevant to the CPU that's *currently* executing the drain. This implies that even in this offline scenario, we're still touching and updating the local CPU's statistics. I need to re-examine the exact implementation of `__mod_zone_page_state` to confirm how it precisely accesses and modifies these per-CPU structures.


42/2 2026/08/27 19:19 tool read-file
0m Args:
map[File:mm/vmstat.c FirstLine:345 LineCount:30]

Results:
map[Contents: 345:	 */
 346:	void __mod_zone_page_state(struct zone *zone, enum zone_stat_item item,
 347:				   long delta)
 348:	{
 349:		struct per_cpu_zonestat __percpu *pcp = zone->per_cpu_zonestats;
 350:		s8 __percpu *p = pcp->vm_stat_diff + item;
 351:		long x;
 352:		long t;
 353:	
 354:		/*
 355:		 * Accurate vmstat updates require a RMW. On !PREEMPT_RT kernels,
 356:		 * atomicity is provided by IRQs being disabled -- either explicitly
 357:		 * or via local_lock_irq. On PREEMPT_RT, local_lock_irq only disables
 358:		 * CPU migrations and preemption potentially corrupts a counter so
 359:		 * disable preemption.
 360:		 */
 361:		preempt_disable_nested();
 362:	
 363:		x = delta + __this_cpu_read(*p);
 364:	
 365:		t = __this_cpu_read(pcp->stat_threshold);
 366:	
 367:		if (unlikely(abs(x) > t)) {
 368:			zone_page_state_add(x, zone, item);
 369:			x = 0;
 370:		}
 371:		__this_cpu_write(*p, x);
 372:	
 373:		preempt_enable_nested();
 374:	}
]

43/2 2026/08/27 19:19 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 16091
							output: 32
							thoughts: 539
						

Thoughts:
**My Thought Process Regarding Per-CPU Variable Atomicity and Locking**

Ah, I see it now! I've been examining the `__mod_zone_page_state` function, and it's crystal clear that it relies on `__this_cpu_read` and `__this_cpu_write`. My immediate thought is that these operations, especially when used in a read-modify-write sequence, inherently demand that preemption (or interrupts) be disabled. The danger, as I see it, is that without such protection, a task could migrate to another CPU between the read and the write, or be preempted by another task that concurrently modifies the very same per-CPU variable. This would lead to corrupted state and, crucially, lost updates.

While `__this_cpu_read` and `__this_cpu_write` themselves might appear as single instructions and thus *theoretically* safe on their own under certain circumstances, the code here is `x = delta + __this_cpu_read(*p);` followed by `__this_cpu_write(*p, x);`. This is undeniably a read-modify-write pattern. If preemption is enabled, the critical window exists between the read and the write. Another task could intercede, modify `*p`, and my intended update would be lost. This is precisely why `preempt_disable_nested()` exists and why it includes assertions to ensure preemption (or interrupts) are indeed disabled.

This leads me to a critical juncture: `mlock_drain_remote` *must* disable preemption or interrupts before invoking `mlock_folio_batch`. Alternatively, `mlock_folio_batch` itself needs to provide this protection, or perhaps `__munlock_folio` should be the one to handle it.

Now, let's focus on `__munlock_folio`. Typically, it *does* disable interrupts because it calls `folio_lruvec_relock_irq(folio, lruvec)`. However, I've stumbled upon a specific condition: if `!folio_test_clear_lru(folio)` evaluates to true, the call to `folio_lruvec_relock_irq` is skipped. Instead, the execution proceeds directly to the `munlock:` label, where `__zone_stat_mod_folio` is invoked.

My next question then becomes: why would `!folio_test_clear_lru(folio)` be true? This condition signifies that the folio is *not* currently on the LRU list. A folio might be absent from the LRU list if it was isolated, if it's a newly created folio, or if it was explicitly removed from the LRU. In such a scenario, `__munlock_folio` logically doesn't need to lock the LRU vector. However, it *still* needs to update the zone statistic, and as we've established, this operation absolutely requires preemption or interrupts to be disabled for safety.

My lingering concern is whether `mlock_drain_remote` is the *sole* caller of `mlock_folio_batch` that might be doing so without preemption disabled. I need to meticulously check all other call sites of `mlock_folio_batch` to confirm this potential vulnerability.


44/2 2026/08/27 19:19 tool grepper
0m Args:
map[Expression:mlock_folio_batch PathPrefix:mm/mlock.c]

Results:
map[Output:mm/mlock.c=174=static inline struct folio *mlock_new(struct folio *folio)
--
mm/mlock.c-179-/*
mm/mlock.c:180: * mlock_folio_batch() is derived from folio_batch_move_lru(): perhaps that can
mm/mlock.c-181- * make use of such folio pointer flags in future, but for now just keep it for
--
mm/mlock.c-185- */
mm/mlock.c:186:static void mlock_folio_batch(struct folio_batch *fbatch)
mm/mlock.c-187-{
--
mm/mlock.c=212=void mlock_drain_local(void)
--
mm/mlock.c-218-	if (folio_batch_count(fbatch))
mm/mlock.c:219:		mlock_folio_batch(fbatch);
mm/mlock.c-220-	local_unlock(&mlock_fbatch.lock);
--
mm/mlock.c=223=void mlock_drain_remote(int cpu)
--
mm/mlock.c-229-	if (folio_batch_count(fbatch))
mm/mlock.c:230:		mlock_folio_batch(fbatch);
mm/mlock.c-231-}
--
mm/mlock.c=242=void mlock_folio(struct folio *folio)
--
mm/mlock.c-258-	    !folio_may_be_lru_cached(folio) || lru_cache_disabled())
mm/mlock.c:259:		mlock_folio_batch(fbatch);
mm/mlock.c-260-	local_unlock(&mlock_fbatch.lock);
--
mm/mlock.c=267=void mlock_new_folio(struct folio *folio)
--
mm/mlock.c-281-	    !folio_may_be_lru_cached(folio) || lru_cache_disabled())
mm/mlock.c:282:		mlock_folio_batch(fbatch);
mm/mlock.c-283-	local_unlock(&mlock_fbatch.lock);
--
mm/mlock.c=290=void munlock_folio(struct folio *folio)
--
mm/mlock.c-302-	    !folio_may_be_lru_cached(folio) || lru_cache_disabled())
mm/mlock.c:303:		mlock_folio_batch(fbatch);
mm/mlock.c-304-	local_unlock(&mlock_fbatch.lock);
]

45/2 2026/08/27 19:19 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17340
							output: 33
							thoughts: 124
						

Thoughts:
**My Thought Process Regarding `mlock` Functions and Preemption**

Alright, so I've been tracing the `mlock_drain_local`, `mlock_folio`, `mlock_new_folio`, and `munlock_folio` functions. My initial observation is that they all converge on calling `mlock_folio_batch`. And importantly, when they call `mlock_folio_batch`, they're holding the `local_lock(&mlock_fbatch.lock)`.

Now, this `local_lock` – the name itself suggests it's localized, and my immediate thought is that it must be disabling preemption. This makes sense, right? If I'm holding a lock and I don't want the kernel to switch away to another task, disabling preemption is the standard mechanism for that. It ensures atomicity within a critical section, especially in a multi-threaded or multi-processor environment.

But then, a little flicker of doubt creeps in. Does `local_lock` *definitively* disable preemption? It's a fundamental concept, but I want to be absolutely certain, especially given the context of memory locking where performance and correctness are paramount. So, my next step is to dive directly into the definition of `local_lock`. I need to see the source code to confirm the exact behavior and verify my assumption about preemption.


46/2 2026/08/27 19:19 tool grepper
0m Args:
map[Expression:define local_lock PathPrefix:include/linux/local_lock.h]

Results:
map[Output:include/linux/local_lock.h-10- */
include/linux/local_lock.h:11:#define local_lock_init(lock)		__local_lock_init(lock)
include/linux/local_lock.h-12-
--
include/linux/local_lock.h-16- */
include/linux/local_lock.h:17:#define local_lock(lock)		__local_lock(__this_cpu_local_lock(lock))
include/linux/local_lock.h-18-
--
include/linux/local_lock.h-22- */
include/linux/local_lock.h:23:#define local_lock_irq(lock)		__local_lock_irq(__this_cpu_local_lock(lock))
include/linux/local_lock.h-24-
--
include/linux/local_lock.h-30- */
include/linux/local_lock.h:31:#define local_lock_irqsave(lock, flags)				\
include/linux/local_lock.h-32-	__local_lock_irqsave(__this_cpu_local_lock(lock), flags)
--
include/linux/local_lock.h-70-
include/linux/local_lock.h:71:#define local_lock_is_locked(lock)	__local_lock_is_locked(lock)
include/linux/local_lock.h-72-
--
include/linux/local_lock.h=92=DEFINE_LOCK_GUARD_1(local_lock_irqsave, local_lock_t __percpu,
--
include/linux/local_lock.h-96-
include/linux/local_lock.h:97:#define local_lock_nested_bh(_lock)				\
include/linux/local_lock.h-98-	__local_lock_nested_bh(__this_cpu_local_lock(_lock))
]

47/2 2026/08/27 19:19 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17964
							output: 34
							thoughts: 592
						

Thoughts:
**My Thought Process Regarding Preemption and Locking in `mlock_drain_remote`**

Okay, let me walk through my internal reasoning here, focusing on the intricacies of preemption and locking, especially around `mlock_drain_remote`.

Initially, I'm thinking about the standard behavior of `local_lock`. I know that on non-real-time (non-RT) systems, `local_lock` disables preemption. On RT systems, it acquires a per-CPU spinlock. This leads me to the conclusion that in *most* scenarios where `local_lock` is used, preemption is already handled – it's disabled.

However, a critical observation then surfaces: `mlock_drain_remote` *doesn't* disable preemption. This immediately triggers a "wait, why not?" reaction. My initial assumption, based on the common pattern, is that it *should*.

My investigation then leads me to the call site of `mlock_drain_remote`: `page_alloc_cpu_dead`. I re-verify that `page_alloc_cpu_dead` itself does *not* disable preemption. This reinforces my initial thought: if the caller doesn't disable preemption, then `mlock_drain_remote` *should* be doing it.

But then a counter-argument arises, and I start to re-evaluate. `mlock_drain_remote` is specifically designed to operate on a *remote* CPU's `mlock_fbatch`. Since the remote CPU is dead, I reason that there's no need to protect against concurrent access from *that specific remote CPU*. This is where the nuance comes in.

However, my thought process quickly pivots to the *local* CPU. Even though the remote CPU is dead, the code running on the *local* CPU within `mlock_drain_remote` is still susceptible to preemption. Specifically, I recall that `mlock_folio_batch` (which `mlock_drain_remote` indirectly uses) calls `__munlock_folio`. And `__munlock_folio` (or similar functions like `__mlock_folio`) updates the *local* CPU's vmstat counters.

This brings me to another critical point: updating local CPU counters. I know, from experience, that updating these counters is generally *not* safe without ensuring that preemption is disabled on the local CPU. A preemption could occur mid-update, leading to corrupted statistics. Therefore, my conclusion solidifies: `mlock_drain_remote` *must* disable preemption to safely update these local vmstat counters.

Having established that `mlock_drain_remote` *needs* to disable preemption, I move to the next logical question: "Is simply disabling preemption enough?" This leads me to consider alternative locking mechanisms. I specifically think about `local_lock(&mlock_fbatch.lock)`. My understanding is that this function would lock the *local* CPU's `mlock_fbatch.lock`.

But this is where the "remote" aspect of `mlock_drain_remote` becomes crucial again. Since it's operating on the *remote* CPU's `mlock_fbatch`, simply locking the local `mlock_fbatch.lock` wouldn't be sufficient, and it's not even the correct lock to acquire. The target is the remote data structure, and the concern is local preemption, not remote concurrency.

Then I refine my understanding of `mlock_folio_batch`. It takes a `struct folio_batch *fbatch`. It iterates through the folios, calling `__munlock_folio` (or `__mlock_folio`), and then `folios_put`. My previous reasoning about updating local vmstat counters within `__munlock_folio` still stands. So, even if it's operating on the remote CPU's `fbatch` and doesn't need to lock the *remote* CPU's `mlock_fbatch.lock` (because the CPU is dead), it *absolutely needs* to disable preemption on the *local* CPU because of the local vmstat updates. My conclusion is that `mlock_drain_remote` should probably disable preemption directly.

Finally, I consider a more complex scenario: what if `mlock_folio_batch` is called *while preemption is already disabled*? What happens if it then calls `lruvec_unlock_irq(lruvec)`? This prompts me to delve into the implementation of `mlock_folio_batch` itself to fully understand the interaction between its operations and the preemption state, and how `lruvec_unlock_irq` behaves in such a context. This is the current frontier of my thought process, aiming for a complete picture of the preemption and locking behavior.


48/2 2026/08/27 19:19 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:186 LineCount:30]

Results:
map[Contents: 186:	static void mlock_folio_batch(struct folio_batch *fbatch)
 187:	{
 188:		struct lruvec *lruvec = NULL;
 189:		unsigned long mlock;
 190:		struct folio *folio;
 191:		int i;
 192:	
 193:		for (i = 0; i < folio_batch_count(fbatch); i++) {
 194:			folio = fbatch->folios[i];
 195:			mlock = (unsigned long)folio & (LRU_FOLIO | NEW_FOLIO);
 196:			folio = (struct folio *)((unsigned long)folio - mlock);
 197:			fbatch->folios[i] = folio;
 198:	
 199:			if (mlock & LRU_FOLIO)
 200:				lruvec = __mlock_folio(folio, lruvec);
 201:			else if (mlock & NEW_FOLIO)
 202:				lruvec = __mlock_new_folio(folio, lruvec);
 203:			else
 204:				lruvec = __munlock_folio(folio, lruvec);
 205:		}
 206:	
 207:		if (lruvec)
 208:			lruvec_unlock_irq(lruvec);
 209:		folios_put(fbatch);
 210:	}
 211:	
 212:	void mlock_drain_local(void)
 213:	{
 214:		struct folio_batch *fbatch;
 215:	
]

49/2 2026/08/27 19:19 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 19035
							output: 33
							thoughts: 2020
						

Thoughts:
**My Thought Process Unraveling a Tricky Race Condition**

So, I'm digging into this `mlock_folio_batch` call and its interaction with `lruvec_unlock_irq`. Initially, I thought `lruvec_unlock_irq` would simply re-enable interrupts. But then I remembered it's actually a `spin_unlock_irq`, which means it not only re-enables interrupts but also decrements the preemption counter. This is crucial because if `mlock_folio_batch` was invoked under `local_lock` (which only disables preemption), the subsequent `lruvec_unlock_irq` would re-enable interrupts but preemption would *still* be disabled.

My confusion deepened when I considered the `folio_lruvec_relock_irq` function. It uses `spin_lock_irq`, effectively disabling interrupts. Then, `lruvec_unlock_irq` would re-enable them. This whole dance seems fine if preemption was *already* disabled before the `spin_lock_irq`.

However, the real problem emerges when `mlock_drain_remote` is called with preemption *enabled*, and the `lruvec` is NULL. In such a scenario, `__munlock_folio` might skip the `folio_lruvec_relock_irq` step. This means `__zone_stat_mod_folio` could be called with preemption *still enabled*, which is incorrect. My initial thought to fix this was to simply disable preemption in `mlock_drain_remote`, ensuring `__zone_stat_mod_folio` is always called with preemption disabled.

Now, the million-dollar question: how do I actually reproduce this bug? The core issue seems to hinge on a folio being added to `mlock_fbatch` via `munlock_folio` under specific conditions:

1.  **CPU Offline During Batch Processing:** A folio gets into the `mlock_fbatch` on one CPU, but then that CPU goes offline *before* the batch is fully processed.
2.  **Remote Draining:** The surviving CPU then calls `mlock_drain_remote` to process the pending folios from the now-dead CPU's batch.
3.  **The Folio's LRU State:** Crucially, when `mlock_folio_batch` eventually processes this folio, the condition `!folio_test_clear_lru(folio)` must be true. This means the folio *was not* on the LRU list when `__munlock_folio` (which is called by `mlock_folio_batch`) was executed.

My immediate question then became: how can a folio be `munlock_folio`'d without being on the LRU list? My initial hypothesis was that `munlock_folio` is called from contexts like `mlock_pte_range` or `munlock_vma_pages_range`. If a folio was isolated from the LRU list (say, for migration or compaction) and then `munlock_folio` was called concurrently, it wouldn't have the LRU flag set. This scenario, where a folio is isolated and then `munlock_folio` is called on it, seems like a plausible way to end up with the folio in the `mlock_fbatch` without the LRU flag. Reproducing this exact race condition involving CPU offline, `munlock_folio`, and page isolation felt like it could be quite challenging.

I then wondered if simpler user-space triggers might exist, like using `mlock` and `munlock` system calls and then forcing a CPU offline. I even considered checking for existing syzbot reproducer scripts, though none were immediately apparent in the crash log.

Diving deeper into `munlock_folio`, I realized it's called by `__munlock_folio`, which in turn is called by `mlock_folio_batch`. The condition `!folio_test_clear_lru(folio)` being true means the folio *was not* on the LRU list *at the point `__munlock_folio` was executed*. I explored various scenarios where a page might not be on the LRU list: allocation, isolation for migration/compaction, or during freeing. However, pages being freed wouldn't typically be in `mlock_fbatch`. Pages from special mappings like `tmpfs` are on LRU. Device pages are a bit different, but `mlock` has specific handling.

My breakthrough came when I reconsidered `folio_test_clear_lru(folio)`. This function *atomically tests and clears* the LRU flag. If it returns `true`, it means the folio *was* on the LRU list, and the subsequent code path correctly re-acquires the LRU lock and disables interrupts. The bug, therefore, *only* manifests when `folio_test_clear_lru(folio)` returns `false`. This confirms that the folio *must not* have been on the LRU list when `__munlock_folio` was entered.

So, the question remains: how do we get a folio into the `mlock_fbatch` via `munlock_folio` *without* the LRU flag set? The scenarios I considered earlier – like isolation for migration or compaction during concurrent `munlock` operations – still seem like the most probable avenues. Any process that could isolate a page from the LRU list while it's mapped and then have `munlock` called on it, combined with a CPU going offline, appears to be the key to triggering this. This points towards complex interactions with page migration, NUMA balancing, or explicit page isolation mechanisms.


50/2 2026/08/27 19:20 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:75 LineCount:25]

Results:
map[Contents:  75:			if (folio_test_unevictable(folio)) {
  76:				lruvec_del_folio(lruvec, folio);
  77:				folio_clear_unevictable(folio);
  78:				lruvec_add_folio(lruvec, folio);
  79:	
  80:				__count_vm_events(UNEVICTABLE_PGRESCUED,
  81:						  folio_nr_pages(folio));
  82:			}
  83:			goto out;
  84:		}
  85:	
  86:		if (folio_test_unevictable(folio)) {
  87:			if (folio_test_mlocked(folio))
  88:				folio->mlock_count++;
  89:			goto out;
  90:		}
  91:	
  92:		lruvec_del_folio(lruvec, folio);
  93:		folio_clear_active(folio);
  94:		folio_set_unevictable(folio);
  95:		folio->mlock_count = !!folio_test_mlocked(folio);
  96:		lruvec_add_folio(lruvec, folio);
  97:		__count_vm_events(UNEVICTABLE_PGCULLED, folio_nr_pages(folio));
  98:	out:
  99:		folio_set_lru(folio);
]

51/2 2026/08/27 19:20 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 21450
							output: 33
							thoughts: 12
						

Thoughts:
**My Thought Process Regarding `__mlock_folio`**

My initial reaction upon seeing the `__mlock_folio` function signature was one of immediate curiosity and a desire to understand its core purpose. The double underscore prefix, `__`, immediately suggests to me that this is an internal or low-level helper function, likely not intended for direct use by application-level developers. It's a signal that I'm about to delve into the plumbing, the mechanisms that underpin higher-level memory management operations.

My mind immediately races to consider what `mlock` implies in the context of the Linux kernel. For me, `mlock` is fundamentally about memory locking – preventing certain pages from being swapped out to disk. This is a critical security and performance feature, especially for applications that handle sensitive data or require predictable latency. I know that `mlock` operations, especially when dealing with file-backed memory, can be complex due to the interplay between the virtual memory system, the page cache, and the underlying block device I/O.

The "folio" part of the name is what truly sparks my interest. In more modern kernel development, the concept of a "folio" has emerged as a more granular and unified representation of memory pages. I understand that folios are designed to supersede traditional page structures in certain contexts, aiming to simplify memory management by grouping related page data and metadata more cohesively. This suggests that `__mlock_folio` is likely an evolution of older `mlock` implementations, leveraging the folio abstraction for potentially more efficient and cleaner memory locking operations, especially when dealing with contiguous blocks of memory or specific file-backed regions.

So, when I see `__mlock_folio`, my internal monologue is essentially: "Okay, this is a kernel-internal function for locking memory, specifically designed to work with the newer folio abstraction. This likely means it's an optimized path for preventing pages associated with a folio from being swapped out. I need to understand how it interacts with the folio structure itself, how it handles the dirtying of pages, and what kind of overhead it introduces compared to older mechanisms. It’s probably a building block for higher-level `mlock` calls or other memory management utilities that benefit from this folio-based approach." My expert mind is already anticipating the details of how this function interacts with page tables, the swap system, and potentially even file system metadata to ensure the locked memory remains resident.


52/2 2026/08/27 19:20 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:60 LineCount:15]

Results:
map[Contents:  60:	
  61:	static struct lruvec *__mlock_folio(struct folio *folio, struct lruvec *lruvec)
  62:	{
  63:		/* There is nothing more we can do while it's off LRU */
  64:		if (!folio_test_clear_lru(folio))
  65:			return lruvec;
  66:	
  67:		lruvec = folio_lruvec_relock_irq(folio, lruvec);
  68:	
  69:		if (unlikely(folio_evictable(folio))) {
  70:			/*
  71:			 * This is a little surprising, but quite possible: PG_mlocked
  72:			 * must have got cleared already by another CPU.  Could this
  73:			 * folio be unevictable?  I'm not sure, but move it now if so.
  74:			 */
]

53/2 2026/08/27 19:20 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 21731
							output: 34
							thoughts: 82
						

Thoughts:
**My Thought Process Regarding Folio Locking and LRU Management**

My immediate reaction upon seeing the `__mlock_folio` function was one of careful scrutiny, particularly concerning its interaction with the Least Recently Used (LRU) list and zone statistics. I noticed that it contains a conditional check: `if (!folio_test_clear_lru(folio)) return lruvec;`. My initial concern was whether this operation, especially the potential clearing of the LRU bit, might have unintended consequences for zone statistics.

However, a deeper analysis of this specific line revealed a crucial detail: the function *only* returns `lruvec` if the LRU bit *cannot* be cleared. Crucially, it *does not* proceed to call `__zone_stat_mod_folio` in this scenario. This observation leads me to conclude that `__mlock_folio` itself is safe with respect to its impact on zone statistics when the LRU bit is already clear. The function's logic seems designed to gracefully handle this case without attempting to modify statistics that would be inaccurate.

This leads me to the next logical question: what about `__mlock_new_folio`? This function likely handles a different scenario, possibly when a new folio is being allocated or brought into memory, and therefore its interaction with LRU and zone statistics may require a separate and distinct consideration. I need to investigate its implementation to ensure it also adheres to correct LRU and statistics management practices.


54/2 2026/08/27 19:20 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:103 LineCount:15]

Results:
map[Contents: 103:	static struct lruvec *__mlock_new_folio(struct folio *folio, struct lruvec *lruvec)
 104:	{
 105:		VM_BUG_ON_FOLIO(folio_test_lru(folio), folio);
 106:	
 107:		lruvec = folio_lruvec_relock_irq(folio, lruvec);
 108:	
 109:		/* As above, this is a little surprising, but possible */
 110:		if (unlikely(folio_evictable(folio)))
 111:			goto out;
 112:	
 113:		folio_set_unevictable(folio);
 114:		folio->mlock_count = !!folio_test_mlocked(folio);
 115:		__count_vm_events(UNEVICTABLE_PGCULLED, folio_nr_pages(folio));
 116:	out:
 117:		lruvec_add_folio(lruvec, folio);
]

55/2 2026/08/27 19:20 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 22116
							output: 29
							thoughts: 339
						

Thoughts:
**A Deep Dive into Folio Locking and LRU Interactions**

My current line of inquiry is focused on the intricate dance between folio locking mechanisms and the Least Recently Used (LRU) list, specifically within the context of memory management. I've been observing the behavior of `__mlock_new_folio`, and a crucial detail immediately jumped out at me: it *unconditionally* calls `folio_lruvec_relock_irq(folio, lruvec)`. This means interrupts are disabled every single time `__mlock_new_folio` is invoked.

This observation has led me to a critical deduction: if interrupts are consistently disabled by `__mlock_new_folio`, then the *only* pathway to call `__zone_stat_mod_folio` without also disabling interrupts must be through `__munlock_folio`, and only under the specific condition where `!folio_test_clear_lru(folio)` evaluates to true. In simpler terms, the folio must *not* be on the LRU list when `__munlock_folio` is called.

This then poses the central question that has been occupying my thoughts: how can a folio possibly be `munlock`ed if it's not currently residing on the LRU list?

My initial thought process connected `munlock_folio` to the unmapping of a Virtual Memory Area (VMA). I reasoned that if a folio has been detached from the LRU list, perhaps due to migration, it wouldn't retain its LRU flag. However, I'm constantly seeking the most direct and elegant solution.

This led me to explore a potentially simpler scenario: what if I could construct a situation where a folio is `munlock`ed *before* it's even had a chance to be added to the LRU list? I'm considering the case of allocating a new page, immediately `mlock`ing it, and then proceeding to `munlock` it before any LRU insertion occurs.

Digging deeper into the faulting process, I recalled that when a page is faulted in, `do_anonymous_page` typically calls `lru_cache_add` (or `folio_add_lru_vma`). My initial understanding was that `folio_add_lru_vma` would directly place the folio onto the LRU list. However, upon closer inspection of `folio_add_lru_vma`, I've realized a more nuanced behavior. It doesn't immediately add the folio to the active LRU list. Instead, it adds it to the `lru_pvecs.lru_add` batch! This is a significant distinction. The folio is not yet truly "on" the LRU list in the way I might have initially assumed. I'm now meticulously examining the `folio_add_lru_vma` code to fully grasp its implications.


56/2 2026/08/27 19:20 tool grepper
0m Args:
map[Expression:folio_add_lru_vma PathPrefix:]

Results:
map[Output:Documentation/mm/unevictable-lru.rst=314=calls mlock_vma_folio(), which calls mlock_folio() when the VMA is VM_LOCKED
Documentation/mm/unevictable-lru.rst-315-(unless it is a PTE mapping of a part of a transparent huge page).  Or when
Documentation/mm/unevictable-lru.rst:316:it is a newly allocated anonymous page, folio_add_lru_vma() calls
Documentation/mm/unevictable-lru.rst-317-mlock_new_folio() instead: similar to mlock_folio(), but can make better
--
mm/folio.c=557=EXPORT_SYMBOL(folio_add_lru);
--
mm/folio.c-559-/**
mm/folio.c:560: * folio_add_lru_vma() - Add a folio to the appropriate LRU list for this VMA.
mm/folio.c-561- * @folio: The folio to be added to the LRU.
--
mm/folio.c-566- */
mm/folio.c:567:void folio_add_lru_vma(struct folio *folio, struct vm_area_struct *vma)
mm/folio.c-568-{
--
mm/huge_memory.c=1358=void map_anon_folio_pmd_nopf(struct folio *folio, pmd_t *pmd,
--
mm/huge_memory.c-1365-	folio_add_new_anon_rmap(folio, vma, haddr, RMAP_EXCLUSIVE);
mm/huge_memory.c:1366:	folio_add_lru_vma(folio, vma);
mm/huge_memory.c-1367-	set_pmd_at(vma->vm_mm, haddr, pmd, entry);
--
mm/internal.h=46=void lru_note_cost_refault(struct folio *folio);
mm/internal.h:47:void folio_add_lru_vma(struct folio *folio, struct vm_area_struct *vma);
mm/internal.h-48-
--
mm/internal.h=966=folio_within_vma(struct folio *folio, struct vm_area_struct *vma)
--
mm/internal.h-977- * the end of folio_remove_rmap_*(); but new anon folios are managed by
mm/internal.h:978: * folio_add_lru_vma() calling mlock_new_folio().
mm/internal.h-979- */
--
mm/memory.c=1060=copy_present_page(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
--
mm/memory.c-1081-	folio_add_new_anon_rmap(new_folio, dst_vma, addr, RMAP_EXCLUSIVE);
mm/memory.c:1082:	folio_add_lru_vma(new_folio, dst_vma);
mm/memory.c-1083-	rss[MM_ANONPAGES]++;
--
mm/memory.c=3923=static vm_fault_t wp_page_copy(struct vm_fault *vmf)
--
mm/memory.c-4012-		folio_add_new_anon_rmap(new_folio, vma, vmf->address, RMAP_EXCLUSIVE);
mm/memory.c:4013:		folio_add_lru_vma(new_folio, vma);
mm/memory.c-4014-		BUG_ON(unshare && pte_write(entry));
--
mm/memory.c=4819=vm_fault_t do_swap_page(struct vm_fault *vmf)
--
mm/memory.c-5141-		folio_add_new_anon_rmap(folio, vma, address, RMAP_EXCLUSIVE);
mm/memory.c:5142:		folio_add_lru_vma(folio, vma);
mm/memory.c-5143-		folio_put_swap(swapcache, NULL);
--
mm/memory.c=5328=void map_anon_folio_pte_nopf(struct folio *folio, pte_t *pte,
--
mm/memory.c-5343-	folio_add_new_anon_rmap(folio, vma, addr, RMAP_EXCLUSIVE);
mm/memory.c:5344:	folio_add_lru_vma(folio, vma);
mm/memory.c-5345-	set_ptes(vma->vm_mm, addr, pte, entry, nr_pages);
--
mm/memory.c=5636=void set_pte_range(struct vm_fault *vmf, struct folio *folio,
--
mm/memory.c-5661-		folio_add_new_anon_rmap(folio, vma, addr, RMAP_EXCLUSIVE);
mm/memory.c:5662:		folio_add_lru_vma(folio, vma);
mm/memory.c-5663-	} else {
--
mm/migrate_device.c=798=static int migrate_vma_insert_huge_pmd_page(struct migrate_vma *migrate,
--
mm/migrate_device.c-879-	if (!folio_is_zone_device(folio))
mm/migrate_device.c:880:		folio_add_lru_vma(folio, vma);
mm/migrate_device.c-881-	folio_get(folio);
--
mm/migrate_device.c=976=static void migrate_vma_insert_page(struct migrate_vma *migrate,
--
mm/migrate_device.c-1088-	if (!folio_is_zone_device(folio))
mm/migrate_device.c:1089:		folio_add_lru_vma(folio, vma);
mm/migrate_device.c-1090-	folio_get(folio);
--
mm/swapfile.c=2419=static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd,
--
mm/swapfile.c-2506-		folio_add_new_anon_rmap(folio, vma, addr, RMAP_EXCLUSIVE);
mm/swapfile.c:2507:		folio_add_lru_vma(folio, vma);
mm/swapfile.c-2508-	}
--
mm/userfaultfd.c=357=static int mfill_atomic_install_pte(pmd_t *dst_pmd,
--
mm/userfaultfd.c-406-		folio_add_new_anon_rmap(folio, dst_vma, dst_addr, RMAP_EXCLUSIVE);
mm/userfaultfd.c:407:		folio_add_lru_vma(folio, dst_vma);
mm/userfaultfd.c-408-	}
]

57/2 2026/08/27 19:20 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 24252
							output: 33
							thoughts: 17
						

Thoughts:
**My Thought Process on `folio_add_lru_vma`**

Alright, my first order of business is to get a solid understanding of what this `folio_add_lru_vma` function is actually doing. It sounds like it's deeply involved in memory management, specifically with how we handle Least Recently Used (LRU) lists and virtual memory areas (VMAs). I need to dive into its definition to see the mechanics, the data structures it manipulates, and the conditions under which it operates. My goal here isn't just a superficial glance; I want to grasp the *why* behind its design and the precise steps it takes to integrate a new folio into the LRU tracking mechanism, likely in conjunction with an existing VMA. I'm anticipating seeing interactions with page tables, cache management, and potentially some locking to ensure thread safety.


58/2 2026/08/27 19:20 tool read-file
0m Args:
map[File:mm/folio.c FirstLine:560 LineCount:20]

Results:
map[Contents: 560:	 * folio_add_lru_vma() - Add a folio to the appropriate LRU list for this VMA.
 561:	 * @folio: The folio to be added to the LRU.
 562:	 * @vma: VMA in which the folio is mapped.
 563:	 *
 564:	 * If the VMA is mlocked, @folio is added to the unevictable list.
 565:	 * Otherwise, it is treated the same way as folio_add_lru().
 566:	 */
 567:	void folio_add_lru_vma(struct folio *folio, struct vm_area_struct *vma)
 568:	{
 569:		VM_BUG_ON_FOLIO(folio_test_lru(folio), folio);
 570:	
 571:		if (unlikely((vma->vm_flags & (VM_LOCKED | VM_SPECIAL)) == VM_LOCKED))
 572:			mlock_new_folio(folio);
 573:		else
 574:			folio_add_lru(folio);
 575:	}
 576:	
 577:	/*
 578:	 * If the folio cannot be invalidated, it is moved to the
 579:	 * inactive list to speed up its reclaim.  It is moved to the
]

59/2 2026/08/27 19:20 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 24657
							output: 33
							thoughts: 1258
						

Thoughts:
**My Thought Process Unraveling a Subtle Race Condition**

My initial exploration began by examining how folios are added to the LRU list and handled during locking operations. I noticed that `folio_add_lru_vma`, when dealing with locked VMAs, calls `mlock_new_folio(folio)`. This function, in turn, adds the folio to `mlock_fbatch` with the `NEW_FOLIO` flag. This flag signals `mlock_folio_batch` to call `__mlock_new_folio`, which correctly handles interrupt disabling via `folio_lruvec_relock_irq(folio, lruvec)`. So far, this path seemed robust and safe.

Next, I considered the scenario of locking an *existing* VMA. Here, `mlock_vma_pages_range` iterates and calls `mlock_folio` for each folio. `mlock_folio` adds the folio to `mlock_fbatch` with the `LRU_FOLIO` flag, leading to `mlock_folio_batch` calling `__mlock_folio`. The critical part here is `__mlock_folio`'s conditional call to `folio_lruvec_relock_irq(folio, lruvec)`. This occurs only if `folio_test_clear_lru(folio)` is true. If it's false, `__mlock_folio` returns the `lruvec` without doing anything, indicating safety. This path also appeared secure.

However, my attention then shifted to `munlock_folio`, and that's where things started to get interesting. `munlock_folio` adds the folio to `mlock_fbatch` but with *no flags*. This means `mlock_folio_batch` will call `__munlock_folio`. Now, within `__munlock_folio`, if `folio_test_clear_lru(folio)` is true, it calls `folio_lruvec_relock_irq(folio, lruvec)`, which disables interrupts. But, and this is the crucial point, if `folio_test_clear_lru(folio)` is *false*, the code jumps directly to the `munlock:` label and calls `__zone_stat_mod_folio` *without disabling interrupts*. This specific path, where interrupts are left enabled, immediately struck me as a potential bug.

So, to trigger this bug, I deduced that I absolutely needed a folio that met two conditions:
1. It must be added to the `mlock_fbatch` via `munlock_folio`.
2. When `mlock_folio_batch` processes this folio, it must *not* have the LRU flag set.

This led me to ponder how a folio could be "munlocked" while simultaneously *not* being on the LRU list. My initial thoughts on this were:
*   A folio might have been *isolated* from the LRU list for reasons like migration, compaction, or reclaim.
*   Concurrently, either `munlock_vma_pages_range` or `mlock_pte_range` (specifically during unmapping or protection changes) could invoke `munlock_folio`.

I then refined this by noticing that `munlock_folio` is indeed called from `mlock_pte_range` when `!(vma->vm_flags & VM_LOCKED)` is true. This means if we `munlock` a VMA, `munlock_vma_pages_range` will traverse the page tables and call `munlock_folio` for each folio. If, during this traversal, a folio is already isolated (perhaps due to `madvise(MADV_PAGEOUT)`, `mbind`, or compaction), it wouldn't possess the LRU flag. `munlock_folio` would then add it to the `mlock_fbatch`.

The race condition became clearer when considering CPU offline scenarios. If a CPU goes offline, its `mlock_fbatch` needs to be processed. This happens via `mlock_drain_remote`, called on the *surviving* CPUs to handle the batch of the *dead* CPU. The sequence I envisioned to hit the bug was:
1.  CPU 0 isolates a folio from the LRU list.
2.  Concurrently, CPU 1 calls `munlock_folio` on that isolated folio. This folio is then added to CPU 1's `mlock_fbatch`.
3.  CPU 1 goes offline.
4.  Another CPU (say, CPU 0) initiates `mlock_drain_remote(1)` to clear CPU 1's batch.
5.  CPU 0 processes CPU 1's `mlock_fbatch`, encountering the folio.
6.  CPU 0 calls `__munlock_folio` on this folio.
7.  At this point, `folio_test_clear_lru(folio)` will evaluate to false because CPU 0 had already isolated it.
8.  Consequently, `__munlock_folio` will directly call `__zone_stat_mod_folio` with preemption enabled, leading to the warning.

I then questioned whether the scenario could occur if the *same* CPU isolated the folio, called `munlock_folio`, and then went offline. This seemed plausible. The core requirement remained: a folio not on the LRU list, `munlock_folio` called on it, and the CPU going offline before the batch is drained.

Finally, I considered an even subtler edge case: could `munlock_folio` be called on a folio that was *never* on the LRU list in the first place? I pondered the initial allocation and mapping of a page. My understanding was that when a page is faulted in, `folio_add_lru_vma` adds it to the LRU. However, I recalled that `folio_add_lru_vma` calls `folio_add_lru`, which adds the folio to `lru_pvecs.lru_add`. It doesn't immediately get the `PG_lru` flag until this `lru_add` batch is actually drained. This observation opened up another potential avenue for the bug, making me delve deeper into the exact timing of folio addition to the LRU list itself.


60/2 2026/08/27 19:21 tool read-file
0m Error:
log-in to see details

Args:
map[File:mm/swap.c FirstLine:500 LineCount:20]

Results:
map[Contents:]

61/2 2026/08/27 19:21 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 25950
							output: 28
							thoughts: 20
						

Thoughts:
**My Thought Process Regarding `folio_add_lru` in `mm/folio.c`**

Alright, so my immediate instinct is to dive into the specifics of the `folio_add_lru` function within the `mm/folio.c` file. This is a crucial piece of the memory management puzzle, and understanding its inner workings is key to grasping how the kernel handles page replacement and overall memory efficiency. I need to get a clear picture of *exactly* what this function does, what its responsibilities are within the larger LRU (Least Recently Used) eviction strategy, and what assumptions it makes about the state of the folios it operates on. I'm not just looking for a superficial understanding; I need to see the logic, the potential edge cases it handles, and how it interacts with other memory management subsystems. Ultimately, I want to be able to articulate its role in the broader memory management architecture with a high degree of confidence.


62/2 2026/08/27 19:21 tool grepper
0m Args:
map[Expression:folio_add_lru PathPrefix:mm/]

Results:
map[Output:mm/filemap.c=955=int filemap_add_folio(struct address_space *mapping, struct folio *folio,
--
mm/filemap.c-987-			workingset_refault(folio, shadow);
mm/filemap.c:988:		folio_add_lru(folio);
mm/filemap.c-989-		if (kernel_file)
--
mm/folio.c=523=EXPORT_SYMBOL(folio_mark_accessed);
--
mm/folio.c-525-/**
mm/folio.c:526: * folio_add_lru - Add a folio to an LRU list.
mm/folio.c-527- * @folio: The folio to be added to the LRU.
--
mm/folio.c-530- * to add the page to the [in]active [file|anon] list is deferred until the
mm/folio.c:531: * folio_batch is drained. This gives a chance for the caller of folio_add_lru()
mm/folio.c-532- * have the folio added to the active list using folio_mark_accessed().
mm/folio.c-533- */
mm/folio.c:534:void folio_add_lru(struct folio *folio)
mm/folio.c-535-{
--
mm/folio.c-556-}
mm/folio.c:557:EXPORT_SYMBOL(folio_add_lru);
mm/folio.c-558-
mm/folio.c-559-/**
mm/folio.c:560: * folio_add_lru_vma() - Add a folio to the appropriate LRU list for this VMA.
mm/folio.c-561- * @folio: The folio to be added to the LRU.
--
mm/folio.c-564- * If the VMA is mlocked, @folio is added to the unevictable list.
mm/folio.c:565: * Otherwise, it is treated the same way as folio_add_lru().
mm/folio.c-566- */
mm/folio.c:567:void folio_add_lru_vma(struct folio *folio, struct vm_area_struct *vma)
mm/folio.c-568-{
--
mm/folio.c-573-	else
mm/folio.c:574:		folio_add_lru(folio);
mm/folio.c-575-}
--
mm/huge_memory.c=1358=void map_anon_folio_pmd_nopf(struct folio *folio, pmd_t *pmd,
--
mm/huge_memory.c-1365-	folio_add_new_anon_rmap(folio, vma, haddr, RMAP_EXCLUSIVE);
mm/huge_memory.c:1366:	folio_add_lru_vma(folio, vma);
mm/huge_memory.c-1367-	set_pmd_at(vma->vm_mm, haddr, pmd, entry);
--
mm/internal.h=46=void lru_note_cost_refault(struct folio *folio);
mm/internal.h:47:void folio_add_lru_vma(struct folio *folio, struct vm_area_struct *vma);
mm/internal.h-48-
--
mm/internal.h=966=folio_within_vma(struct folio *folio, struct vm_area_struct *vma)
--
mm/internal.h-977- * the end of folio_remove_rmap_*(); but new anon folios are managed by
mm/internal.h:978: * folio_add_lru_vma() calling mlock_new_folio().
mm/internal.h-979- */
--
mm/khugepaged.c=2247=static enum scan_result collapse_file(struct mm_struct *mm, unsigned long addr,
--
mm/khugepaged.c-2616-		folio_mark_dirty(new_folio);
mm/khugepaged.c:2617:	folio_add_lru(new_folio);
mm/khugepaged.c-2618-
--
mm/memfd_luo.c=417=static int memfd_luo_retrieve_folios(struct file *file,
--
mm/memfd_luo.c-480-		nr_added_pages += npages;
mm/memfd_luo.c:481:		folio_add_lru(folio);
mm/memfd_luo.c-482-		folio_unlock(folio);
--
mm/memory.c=1060=copy_present_page(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
--
mm/memory.c-1081-	folio_add_new_anon_rmap(new_folio, dst_vma, addr, RMAP_EXCLUSIVE);
mm/memory.c:1082:	folio_add_lru_vma(new_folio, dst_vma);
mm/memory.c-1083-	rss[MM_ANONPAGES]++;
--
mm/memory.c=3923=static vm_fault_t wp_page_copy(struct vm_fault *vmf)
--
mm/memory.c-4012-		folio_add_new_anon_rmap(new_folio, vma, vmf->address, RMAP_EXCLUSIVE);
mm/memory.c:4013:		folio_add_lru_vma(new_folio, vma);
mm/memory.c-4014-		BUG_ON(unshare && pte_write(entry));
--
mm/memory.c=4819=vm_fault_t do_swap_page(struct vm_fault *vmf)
--
mm/memory.c-5141-		folio_add_new_anon_rmap(folio, vma, address, RMAP_EXCLUSIVE);
mm/memory.c:5142:		folio_add_lru_vma(folio, vma);
mm/memory.c-5143-		folio_put_swap(swapcache, NULL);
--
mm/memory.c=5328=void map_anon_folio_pte_nopf(struct folio *folio, pte_t *pte,
--
mm/memory.c-5343-	folio_add_new_anon_rmap(folio, vma, addr, RMAP_EXCLUSIVE);
mm/memory.c:5344:	folio_add_lru_vma(folio, vma);
mm/memory.c-5345-	set_ptes(vma->vm_mm, addr, pte, entry, nr_pages);
--
mm/memory.c=5636=void set_pte_range(struct vm_fault *vmf, struct folio *folio,
--
mm/memory.c-5661-		folio_add_new_anon_rmap(folio, vma, addr, RMAP_EXCLUSIVE);
mm/memory.c:5662:		folio_add_lru_vma(folio, vma);
mm/memory.c-5663-	} else {
--
mm/migrate.c=1364=static int migrate_folio_move(free_folio_t put_new_folio, unsigned long private,
--
mm/migrate.c-1414-	 */
mm/migrate.c:1415:	folio_add_lru(dst);
mm/migrate.c-1416-	if (old_folio_state & FOLIO_WAS_MLOCKED)
--
mm/migrate_device.c=798=static int migrate_vma_insert_huge_pmd_page(struct migrate_vma *migrate,
--
mm/migrate_device.c-879-	if (!folio_is_zone_device(folio))
mm/migrate_device.c:880:		folio_add_lru_vma(folio, vma);
mm/migrate_device.c-881-	folio_get(folio);
--
mm/migrate_device.c=976=static void migrate_vma_insert_page(struct migrate_vma *migrate,
--
mm/migrate_device.c-1088-	if (!folio_is_zone_device(folio))
mm/migrate_device.c:1089:		folio_add_lru_vma(folio, vma);
mm/migrate_device.c-1090-	folio_get(folio);
--
mm/migrate_device.c=1279=static void __migrate_device_finalize(unsigned long *src_pfns,
--
mm/migrate_device.c-1316-		if (!folio_is_zone_device(dst))
mm/migrate_device.c:1317:			folio_add_lru(dst);
mm/migrate_device.c-1318-		remove_migration_ptes(src, dst, 0);
--
mm/shmem.c=1928=static struct folio *shmem_alloc_and_add_folio(struct vm_fault *vmf,
--
mm/shmem.c-2022-	shmem_recalc_inode(inode, pages, 0);
mm/shmem.c:2023:	folio_add_lru(folio);
mm/shmem.c-2024-	return folio;
--
mm/shmem.c=2078=static int shmem_replace_folio(struct folio **foliop, gfp_t gfp,
--
mm/shmem.c-2121-
mm/shmem.c:2122:	folio_add_lru(new);
mm/shmem.c-2123-	*foliop = new;
--
mm/shmem.c=3156=static int shmem_mfill_filemap_add(struct folio *folio,
--
mm/shmem.c-3177-
mm/shmem.c:3178:	folio_add_lru(folio);
mm/shmem.c-3179-	shmem_recalc_inode(inode, 1, 0);
--
mm/swap_state.c=408=static struct folio *__swap_cache_alloc(struct swap_cluster_info *ci,
--
mm/swap_state.c-491-	/* Caller will initiate read into locked new_folio */
mm/swap_state.c:492:	folio_add_lru(folio);
mm/swap_state.c-493-	return folio;
--
mm/swapfile.c=2419=static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd,
--
mm/swapfile.c-2506-		folio_add_new_anon_rmap(folio, vma, addr, RMAP_EXCLUSIVE);
mm/swapfile.c:2507:		folio_add_lru_vma(folio, vma);
mm/swapfile.c-2508-	}
--
mm/truncate.c=606=static int folio_launder(struct address_space *mapping, struct folio *folio)
--
mm/truncate.c-619- * shrink_folio_list() has a temp ref on them, or because they're transiently
mm/truncate.c:620: * sitting in the folio_add_lru() caches.
mm/truncate.c-621- */
--
mm/userfaultfd.c=357=static int mfill_atomic_install_pte(pmd_t *dst_pmd,
--
mm/userfaultfd.c-406-		folio_add_new_anon_rmap(folio, dst_vma, dst_addr, RMAP_EXCLUSIVE);
mm/userfaultfd.c:407:		folio_add_lru_vma(folio, dst_vma);
mm/userfaultfd.c-408-	}
--
mm/vmscan.c=819=void folio_putback_lru(struct folio *folio)
mm/vmscan.c-820-{
mm/vmscan.c:821:	folio_add_lru(folio);
mm/vmscan.c-822-	folio_put(folio);		/* drop ref from isolate */
--
mm/workingset.c=292=static void lru_gen_refault(struct folio *folio, void *shadow)
--
mm/workingset.c-323-		/*
mm/workingset.c:324:		 * see folio_add_lru(), where folio_set_active() is
mm/workingset.c-325-		 * called for workingset folios
--
mm/workingset.c=548=void workingset_refault(struct folio *folio, void *shadow)
--
mm/workingset.c-587-		/*
mm/workingset.c:588:		 * XXX: Move to folio_add_lru() when it supports new vs
mm/workingset.c-589-		 * putback
]

63/2 2026/08/27 19:21 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 29299
							output: 35
							thoughts: 902
						

Thoughts:
**My Thought Process Unraveling the `mlock`/LRU Interaction Bug**

Okay, let's trace this through, step by step, as I'm mentally dissecting this potential bug.

First, I'm looking at `folio_add_lru`. My understanding is that it doesn't *immediately* put the folio on the actual LRU list. Instead, it adds it to a batch, specifically `lru_pvecs.lru_add`. This is a crucial point: the folio *isn't* on the LRU list until that batch gets drained.

So, imagine this scenario: I allocate a page, I map it into memory. At this point, it gets added to that `lru_add` batch. Now, I immediately call `mlock` on this folio.

`mlock_vma_pages_range` then calls `mlock_folio`. Inside `mlock_folio`, it adds the folio to another batch, `mlock_fbatch`, and importantly, it sets the `LRU_FOLIO` flag. I'm checking my assumptions here: `mlock_folio` *doesn't* check if the folio is already on the LRU list. It just adds it to the `mlock_fbatch` with that flag.

Then, `mlock_folio_batch` is invoked, which eventually calls `__mlock_folio`. This is where it gets interesting. `__mlock_folio` tries to clear the LRU flag using `folio_test_clear_lru(folio)`. But, and here's the crux of my initial confusion, because the folio is still sitting in the `lru_add` batch and *not yet on the LRU list itself*, `folio_test_clear_lru` will return `FALSE`. Consequently, `__mlock_folio` effectively does nothing with the `lruvec` and just returns.

Now, later on, that `lru_add` batch *will* eventually be drained, and the folio will be correctly added to the LRU list. But what if something else happens *before* that batch is drained?

This is where the `munlock` part comes in. What if I call `munlock` on this folio *before* the `lru_add` batch is processed?

When `munlock_folio` is called, it adds the folio to the `mlock_fbatch`, but this time, *without* any flags like `LRU_FOLIO`. Then, `mlock_folio_batch` calls `__munlock_folio`. Again, `__munlock_folio` checks `folio_test_clear_lru(folio)`. Since the folio is still not on the LRU list (it's either in the `lru_add` batch or was never on LRU at all yet), this check returns `FALSE`. The code then jumps to `munlock:`.

Crucially, *after* this jump, `__zone_stat_mod_folio` is called. Now, if this entire sequence happens during `mlock_drain_remote` – which is what happens when a CPU goes offline – that's when the warning is triggered.

But I'm thinking, can this warning be triggered *without* a CPU going offline? If `mlock_folio_batch` is called directly from `munlock_folio` (as opposed to `mlock_drain_remote`), the lock `local_lock(&mlock_fbatch.lock)` is held. This means preemption is disabled. In that scenario, `__zone_stat_mod_folio` wouldn't issue a warning.

Therefore, my current hypothesis is that the warning is *exclusively* triggered when `mlock_folio_batch` is called from `mlock_drain_remote` because, in that specific context, preemption *is not* disabled.

So, to recap the exact problematic sequence I'm envisioning:

1.  I allocate a page and it gets mapped into memory, likely via a page fault.
2.  This new page is added to the `lru_add` batch. It's *not* yet on the actual LRU list.
3.  I then call `munlock` on this page. (I'm pausing to consider if `munlock` can be called on a page that hasn't been explicitly `mlock`ed. Yes, the `munlock` system call operating on a VMA, or an `mprotect` on a previously `mlock`ed VMA, can result in `munlock_vma_pages_range` calling `munlock_folio` on any present pages.)
4.  `munlock_folio` adds the page to the `mlock_fbatch` without any special flags.
5.  The CPU goes offline.
6.  `mlock_drain_remote` kicks in to process the `mlock_fbatch`.
7.  `__munlock_folio` encounters the folio. It checks `folio_test_clear_lru(folio)`, which returns `FALSE` because the folio is still in the `lru_add` batch (or never made it to the LRU list).
8.  `__munlock_folio` proceeds to call `__zone_stat_mod_folio`, but this time, with preemption *enabled* because we're in `mlock_drain_remote`.
9.  And *that's* when the warning appears.

My final check is to confirm if `munlock_vma_pages_range` indeed calls `munlock_folio` on *any* page that's present, irrespective of its `mlock` status, which would solidify this path.


64/2 2026/08/27 19:21 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:munlock_vma_pages_range PathPrefix:mm/mlock.c]

Results:
map[Output:]

65/2 2026/08/27 19:21 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 30234
							output: 34
							thoughts: 21
						

Thoughts:
**My Thought Process on `mlock_pte_range`**

Alright, so I'm trying to get a handle on the kernel's memory locking mechanisms, specifically how it manages page table entries (PTEs) when memory is locked. My current focus is on the `mlock_pte_range` function, which seems like a critical piece of this puzzle. I need to dive into `mm/mlock.c` and understand its role.

My initial thought is to trace the execution flow. What triggers `mlock_pte_range`? Is it called directly by the `mlock` syscall, or is it an internal helper function called by higher-level memory management routines? I'll be looking for the call sites to understand its context within the `mlock` operation.

Once I'm inside `mlock_pte_range`, my primary objective is to dissect its interactions with the page table. I expect to see it iterating through a range of virtual addresses, and for each address, it will need to locate the corresponding PTE. This will likely involve calls to functions that walk the page table (e.g., `walk_page_range`).

A key aspect will be how it modifies the PTEs. What flags or bits are set or cleared? The goal is to prevent these pages from being swapped out. I'll be looking for operations that mark pages as "locked" or otherwise signal to the page reclamation subsystem that they are off-limits. I'm also curious about how it handles different page types – are there special considerations for shared memory, anonymous pages, or file-backed pages?

Furthermore, I need to consider error handling. What happens if the memory range is invalid, or if there are permission issues? `mlock_pte_range` must gracefully handle these scenarios and report errors back to the caller. I'll be scrutinizing the return values and any error paths.

Finally, I anticipate that `mlock_pte_range` might also be responsible for unmarking pages when the lock is released. I'll be looking for logic that reverses the locking operations, ensuring that pages are made available for swapping again when `munlock` is called.

In essence, I'm approaching this by thinking about the lifecycle of a locked page from a PTE perspective: how it's identified, marked as locked, and potentially unmarked. I'm assuming `mlock_pte_range` is the core machinery for this PTE manipulation.


66/2 2026/08/27 19:21 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:350 LineCount:55]

Results:
map[Contents: 350:	static int mlock_pte_range(pmd_t *pmd, unsigned long addr,
 351:				   unsigned long end, struct mm_walk *walk)
 352:	
 353:	{
 354:		struct vm_area_struct *vma = walk->vma;
 355:		spinlock_t *ptl;
 356:		pte_t *start_pte, *pte;
 357:		pte_t ptent;
 358:		struct folio *folio;
 359:		unsigned int step = 1;
 360:		unsigned long start = addr;
 361:	
 362:		ptl = pmd_trans_huge_lock(pmd, vma);
 363:		if (ptl) {
 364:			if (!pmd_present(*pmd))
 365:				goto out;
 366:			if (is_huge_zero_pmd(*pmd))
 367:				goto out;
 368:			folio = pmd_folio(*pmd);
 369:			if (folio_is_zone_device(folio))
 370:				goto out;
 371:			if (vma_test(vma, VMA_LOCKED_BIT))
 372:				mlock_folio(folio);
 373:			else
 374:				munlock_folio(folio);
 375:			goto out;
 376:		}
 377:	
 378:		start_pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
 379:		if (!start_pte) {
 380:			walk->action = ACTION_AGAIN;
 381:			return 0;
 382:		}
 383:	
 384:		for (pte = start_pte; addr != end; pte++, addr += PAGE_SIZE) {
 385:			ptent = ptep_get(pte);
 386:			if (!pte_present(ptent))
 387:				continue;
 388:			folio = vm_normal_folio(vma, addr, ptent);
 389:			if (!folio || folio_is_zone_device(folio))
 390:				continue;
 391:	
 392:			step = folio_mlock_step(folio, pte, addr, end);
 393:			if (!allow_mlock_munlock(folio, vma, start, end, step))
 394:				goto next_entry;
 395:	
 396:			if (vma_test(vma, VMA_LOCKED_BIT))
 397:				mlock_folio(folio);
 398:			else
 399:				munlock_folio(folio);
 400:	
 401:	next_entry:
 402:			pte += step - 1;
 403:			addr += (step - 1) << PAGE_SHIFT;
 404:		}
]

67/2 2026/08/27 19:21 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 31106
							output: 35
							thoughts: 102
						

Thoughts:
**My Thought Process Regarding `mlock_pte_range`**

Okay, so I'm looking at `mlock_pte_range` and the first thing that catches my eye is this conditional logic: it calls `munlock_folio` *only if* the `VM_LOCKED` flag is *not* set on the VMA. That's an interesting initial observation. It implies that `mlock_pte_range` is involved in both locking and potentially unlocking pages, or at least in managing the state where pages *should* be locked.

Now, I need to understand the context of *when* `mlock_pte_range` is invoked. My initial thought was that it might be directly called by something like `mlock_vma_pages_range`. But then I second-guessed myself. Is it a direct call, or is it part of a larger page traversal mechanism? I'm leaning towards the latter. My hunch is that `mlock_vma_pages_range` likely initiates a page walk, and *within that walk*, `mlock_pte_range` is called for each relevant page or page range.

To clarify this, I need to dive into the implementation of `mlock_vma_pages_range`. My immediate next step is to examine the code of `mlock_vma_pages_range` to see precisely how it iterates through the VMA's pages and what function is actually responsible for operating on individual page table entries or folios. I suspect `walk_page_range` is involved in this iteration, and it's likely that `mlock_pte_range` is a callback or helper function invoked by `walk_page_range` during that process. This would make more sense architecturally – `walk_page_range` handles the traversal, and `mlock_pte_range` handles the specific mlock operation for each page encountered.


68/2 2026/08/27 19:21 tool grepper
0m Args:
map[Expression:mlock_vma_pages_range PathPrefix:mm/mlock.c]

Results:
map[Output:mm/mlock.c=350=static int mlock_pte_range(pmd_t *pmd, unsigned long addr,
--
mm/mlock.c-412-/*
mm/mlock.c:413: * mlock_vma_pages_range() - mlock any pages already in the range,
mm/mlock.c-414- *                           or munlock all pages in the range.
--
mm/mlock.c-422- */
mm/mlock.c:423:static void mlock_vma_pages_range(struct vm_area_struct *vma,
mm/mlock.c-424-	unsigned long start, unsigned long end,
--
mm/mlock.c=467=static int mlock_fixup(struct vma_iterator *vmi, struct vm_area_struct *vma,
--
mm/mlock.c-511-	} else {
mm/mlock.c:512:		mlock_vma_pages_range(vma, start, end, new_vma_flags);
mm/mlock.c-513-	}
]

69/2 2026/08/27 19:21 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 31523
							output: 34
							thoughts: 83
						

Thoughts:
**The Inner Workings of Memory Locking**

It's fascinating how a single function, `mlock_vma_pages_range`, handles both memory locking (`mlock`) and unlocking (`munlock`). I hadn't fully appreciated this duality before. My thought process was initially a bit surprised, realizing that the same code path is responsible for both acquiring and releasing these memory locks.

Then, I delved deeper and noticed a crucial conditional within `mlock_vma_pages_range`. If the `new_vma_flags` (which I understand as the target state for the Virtual Memory Area or VMA) *lack* the `VM_LOCKED` flag, it triggers `munlock_folio` for all pages within the specified range. This is a key insight: the absence of the lock flag is the explicit signal to unlock.

This led me to connect another piece of the puzzle: the `allow_mlock_munlock` check. This function, as its name suggests, acts as a gatekeeper, verifying whether a particular folio (a contiguous chunk of memory) is even eligible for `mlock` or `munlock` operations. It's an essential safeguard, ensuring that we're only attempting to manipulate memory locks where they are permitted, adding a layer of robust error handling and security to the entire process.


70/2 2026/08/27 19:21 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:310 LineCount:40]

Results:
map[Contents: 310:		unsigned int count = (end - addr) >> PAGE_SHIFT;
 311:		pte_t ptent = ptep_get(pte);
 312:	
 313:		if (!folio_test_large(folio))
 314:			return 1;
 315:	
 316:		return folio_pte_batch(folio, pte, ptent, count);
 317:	}
 318:	
 319:	static inline bool allow_mlock_munlock(struct folio *folio,
 320:			struct vm_area_struct *vma, unsigned long start,
 321:			unsigned long end, unsigned int step)
 322:	{
 323:		/*
 324:		 * For unlock, allow munlock large folio which is partially
 325:		 * mapped to VMA. As it's possible that large folio is
 326:		 * mlocked and VMA is split later.
 327:		 *
 328:		 * During memory pressure, such kind of large folio can
 329:		 * be split. And the pages are not in VM_LOCKed VMA
 330:		 * can be reclaimed.
 331:		 */
 332:		if (!vma_test(vma, VMA_LOCKED_BIT))
 333:			return true;
 334:	
 335:		/* folio_within_range() cannot take KSM, but any small folio is OK */
 336:		if (!folio_test_large(folio))
 337:			return true;
 338:	
 339:		/* folio not in range [start, end), skip mlock */
 340:		if (!folio_within_range(folio, vma, start, end))
 341:			return false;
 342:	
 343:		/* folio is not fully mapped, skip mlock */
 344:		if (step != folio_nr_pages(folio))
 345:			return false;
 346:	
 347:		return true;
 348:	}
 349:	
]

71/2 2026/08/27 19:21 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 32205
							output: 34
							thoughts: 360
						

Thoughts:
**My Thought Process Regarding `munlock` and LRU Interaction**

Okay, let's trace this out in my head. I'm thinking about the interaction between `munlock` and how pages are managed, specifically when they are *not* on the LRU list.

So, my understanding is that when I call `munlock` on a Virtual Memory Area (VMA), it's going to iterate through all the pages associated with that VMA and call `munlock_folio` on each one. Now, the critical part for me is what happens when one of these pages *isn't* currently on the Least Recently Used (LRU) list. In that scenario, it gets added to something called `mlock_fbatch`, but importantly, it gets added with *no flags*.

The reason this flag status is significant is because if a CPU goes offline later, a function called `mlock_drain_remote` will process this `mlock_fbatch`. When it does, it will call `__munlock_folio`, and that, in turn, calls `__zone_stat_mod_folio`. The detail that stands out here is that `__zone_stat_mod_folio` is called with preemption enabled. This suggests a particular handling path when a page is unfrozen but wasn't actively tracked by the LRU.

Now, my immediate question becomes: how do I even *get* a page that is NOT on the LRU list in the first place, in a context where `munlock` is relevant?

I can envision a scenario:
1. I allocate a page.
2. I then map it into memory, perhaps by triggering a page fault.
3. At this point, it's added to an `lru_add` batch.

Now, *then*, if I were to call `munlock` on this page... But wait a minute. For `munlock` to be called on a page, that VMA must have been `mlocked` in the first place. That’s a prerequisite.

So, let's backtrack and refine the scenario.
1. I `mlock` a page. My understanding is that this action would add the page to `mlock_fbatch` but this time *with* the `LRU_FOLIO` flag set.
2. Then, I `munlock` it. This is where the initial thought comes back: it gets added to `mlock_fbatch` but now with *no flags*.

Here's where it gets a bit fuzzy for me: if the page is *already* in `mlock_fbatch` (from the initial `mlock`), won't calling `munlock` again just result in another entry being added to the same batch? It seems like it would be a duplicate entry, or at least a redundant addition.

Let me re-examine `mlock_vma_pages_range`. I recall that the `mlock` system call, specifically, calls `mlock_fixup`, which in turn calls `mlock_vma_pages_range`. My memory is that `mlock_vma_pages_range` has a crucial behavior: if the page hasn't been faulted in yet (meaning it's not resident in memory), it will *actually fault it in* as part of the `mlock` operation. This is a key detail that might impact how a page ends up on or off the LRU list during the `mlock` process itself, which then affects the subsequent `munlock`. I need to look more closely at `mlock_vma_pages_range` to fully grasp this interplay.


72/2 2026/08/27 19:22 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:410 LineCount:40]

Results:
map[Contents: 410:	}
 411:	
 412:	/*
 413:	 * mlock_vma_pages_range() - mlock any pages already in the range,
 414:	 *                           or munlock all pages in the range.
 415:	 * @vma - vma containing range to be mlock()ed or munlock()ed
 416:	 * @start - start address in @vma of the range
 417:	 * @end - end of range in @vma
 418:	 * @new_vma_flags - the new set of flags for @vma.
 419:	 *
 420:	 * Called for mlock(), mlock2() and mlockall(), to set @vma VMA_LOCKED_BIT;
 421:	 * called for munlock() and munlockall(), to clear VMA_LOCKED_BIT from @vma.
 422:	 */
 423:	static void mlock_vma_pages_range(struct vm_area_struct *vma,
 424:		unsigned long start, unsigned long end,
 425:		vma_flags_t *new_vma_flags)
 426:	{
 427:		static const struct mm_walk_ops mlock_walk_ops = {
 428:			.pmd_entry = mlock_pte_range,
 429:			.walk_lock = PGWALK_WRLOCK_VERIFY,
 430:		};
 431:	
 432:		/*
 433:		 * There is a slight chance that concurrent page migration,
 434:		 * or page reclaim finding a page of this now-VMA_LOCKED_BIT vma,
 435:		 * will call mlock_vma_folio() and raise page's mlock_count:
 436:		 * double counting, leaving the page unevictable indefinitely.
 437:		 * Communicate this danger to mlock_vma_folio() with VMA_IO_BIT,
 438:		 * which is a VMA_SPECIAL_FLAGS flag not allowed on VMA_LOCKED_BIT vmas.
 439:		 * mmap_lock is held in write mode here, so this weird
 440:		 * combination should not be visible to other mmap_lock users;
 441:		 * but WRITE_ONCE so rmap walkers must see VMA_IO_BIT if VMA_LOCKED_BIT.
 442:		 */
 443:		if (vma_flags_test(new_vma_flags, VMA_LOCKED_BIT))
 444:			vma_flags_set(new_vma_flags, VMA_IO_BIT);
 445:		vma_start_write(vma);
 446:		vma_flags_reset_once(vma, new_vma_flags);
 447:	
 448:		lru_add_drain();
 449:		walk_page_range_vma(vma, start, end, &mlock_walk_ops, NULL);
]

73/2 2026/08/27 19:22 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 33395
							output: 32
							thoughts: 398
						

Thoughts:
**My Thought Process Unraveling a Potential Race Condition in Page Locking**

Initially, I noticed that `mlock_vma_pages_range` invokes `lru_add_drain()`. This immediately led me to believe that the `lru_add` batch was being cleared *before* the page table walk commenced, implying the pages would definitively reside on the LRU list.

However, my confidence wavered as I considered the scope of `lru_add_drain()`. My understanding is that it only flushes the *local* CPU's `lru_add` batch. This brought up a critical question: what happens if the page was initially faulted in on a *different* CPU and is currently sitting in *that other CPU's* `lru_add` batch?

To illustrate this potential pitfall, I envisioned a specific scenario:
1.  CPU 0 faults in a page, placing it in its local `lru_add` batch.
2.  Subsequently, CPU 1 initiates an `munlock` operation on the VMA containing this page.
3.  CPU 1 calls `lru_add_drain()`. Crucially, this only drains CPU 1's own batch.
4.  CPU 1 then proceeds to walk the page tables, locates the page, and calls `munlock_folio`.
5.  At this point, the page is *not* on the LRU list because it's still languishing in CPU 0's `lru_add` batch.
6.  CPU 1 then adds this page to its own `mlock_fbatch`.
7.  Following this, CPU 1 goes offline.
8.  Later, CPU 0 executes `mlock_drain_remote(1)` to process pending operations from the now-offline CPU 1.
9.  CPU 0 iterates through CPU 1's `mlock_fbatch` and calls `__munlock_folio` for the page in question.
10. Within `__munlock_folio`, `folio_test_clear_lru(folio)` is called. This will return `FALSE` because, as we established, the page is still in CPU 0's `lru_add` batch, not yet properly cleared from the LRU.
11. The code then proceeds to call `__zone_stat_mod_folio` with preemption enabled, which is where the warning is triggered.

This sequence of events paints a very plausible race condition. The core issue appears to be the assumption that `lru_add_drain()` universally clears all pending `lru_add` entries, when in reality, it's localized to the calling CPU.

My immediate next step is to thoroughly verify the exact behavior of `lru_add_drain()` to confirm whether it indeed *only* drains the local CPU's batch, as my current analysis suggests.


74/2 2026/08/27 19:22 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:void lru_add_drain(void) PathPrefix:mm/]

Results:
map[Output:]

75/2 2026/08/27 19:22 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 33823
							output: 31
							thoughts: 14
						

Thoughts:
**My Thought Process Regarding `lru_add_drain`**

Alright, my immediate instinct is to dive into the nitty-gritty of `lru_add_drain`. I need to understand its precise behavior, its parameters, what it returns, and importantly, its side effects. This isn't just about a cursory glance; I'm looking for the core mechanics of how it interacts with the LRU cache – specifically, how it handles the addition of new elements while simultaneously clearing out older ones. I need to ascertain if this operation is atomic, what happens to the evicted elements (are they returned, discarded, or processed in some other way?), and what the performance implications are. Ultimately, I'm trying to build a complete mental model of this function so I can predict its impact on the overall system's state and performance.


76/2 2026/08/27 19:22 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:lru_add_drain PathPrefix:mm/swap.c]

Results:
map[Output:]

77/2 2026/08/27 19:22 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 33866
							output: 28
							thoughts: 92
						

Thoughts:
**My Thought Process Regarding `lru_add_drain` and Kernel Code Location**

My initial intention was to examine the `lru_add_drain` function, which I believed resided within the `mm/swap.c` file. However, my first attempt at locating this file proved unsuccessful, leading me to question my initial assumption about its location. I then considered if there had been a recent move or renaming, perhaps from `mm/swap.c` to a slightly different path. This doubt was amplified by a prior unsuccessful search for `folio_add_lru` within what I *thought* was the correct `mm/swap.c`. To resolve this discrepancy and pinpoint the function I'm interested in, my next logical step was to broaden my search. Therefore, I decided to search the entire `mm/` directory for `lru_add_drain`, hoping to uncover its current location, regardless of any file renaming or restructuring that might have occurred.


78/2 2026/08/27 19:22 tool grepper
0m Args:
map[Expression:lru_add_drain PathPrefix:mm/]

Results:
map[Output:mm/compaction.c=2562=compact_zone(struct compact_control *cc, struct capture_control *capc)
--
mm/compaction.c-2645-
mm/compaction.c:2646:	/* lru_add_drain_all could be expensive with involving other CPUs */
mm/compaction.c:2647:	lru_add_drain();
mm/compaction.c-2648-
--
mm/compaction.c-2762-			if (last_migrated_pfn < current_block_start) {
mm/compaction.c:2763:				lru_add_drain_cpu_zone(cc->zone);
mm/compaction.c-2764-				/* No more flushing until we migrate again */
--
mm/compaction.c=2959=static int compact_nodes(void)
--
mm/compaction.c-2963-	/* Flush pending updates to the LRU lists */
mm/compaction.c:2964:	lru_add_drain_all();
mm/compaction.c-2965-
--
mm/compaction.c=3024=static ssize_t compact_store(struct device *dev,
--
mm/compaction.c-3031-		/* Flush pending updates to the LRU lists */
mm/compaction.c:3032:		lru_add_drain_all();
mm/compaction.c-3033-
--
mm/fadvise.c=31=int generic_fadvise(struct file *file, loff_t offset, loff_t len, int advice)
--
mm/fadvise.c-154-			 */
mm/fadvise.c:155:			lru_add_drain();
mm/fadvise.c-156-
--
mm/fadvise.c-165-			if (nr_failed) {
mm/fadvise.c:166:				lru_add_drain_all();
mm/fadvise.c-167-				invalidate_mapping_pages(mapping, start_index,
--
mm/folio.c=655=static void lru_lazyfree(struct lruvec *lruvec, struct folio *folio)
--
mm/folio.c-685- */
mm/folio.c:686:void lru_add_drain_cpu(int cpu)
mm/folio.c-687-{
--
mm/folio.c-693-		folio_batch_move_lru(fbatch, lru_add);
mm/folio.c:694:		trace_mm_lru_add_drain_tp(cpu, nr_folios);
mm/folio.c-695-	}
--
mm/folio.c=771=void folio_mark_lazyfree(struct folio *folio)
--
mm/folio.c-780-
mm/folio.c:781:void lru_add_drain(void)
mm/folio.c-782-{
mm/folio.c-783-	local_lock(&cpu_fbatches.lock);
mm/folio.c:784:	lru_add_drain_cpu(smp_processor_id());
mm/folio.c-785-	local_unlock(&cpu_fbatches.lock);
--
mm/folio.c-790- * It's called from per-cpu workqueue context in SMP case so
mm/folio.c:791: * lru_add_drain_cpu and invalidate_bh_lrus_cpu should run on
mm/folio.c-792- * the same cpu. It shouldn't be a problem in !SMP case since
--
mm/folio.c=795=static void lru_add_and_bh_lrus_drain(void)
--
mm/folio.c-797-	local_lock(&cpu_fbatches.lock);
mm/folio.c:798:	lru_add_drain_cpu(smp_processor_id());
mm/folio.c-799-	local_unlock(&cpu_fbatches.lock);
--
mm/folio.c-803-
mm/folio.c:804:void lru_add_drain_cpu_zone(struct zone *zone)
mm/folio.c-805-{
mm/folio.c-806-	local_lock(&cpu_fbatches.lock);
mm/folio.c:807:	lru_add_drain_cpu(smp_processor_id());
mm/folio.c-808-	drain_local_pages(zone);
--
mm/folio.c-814-
mm/folio.c:815:static DEFINE_PER_CPU(struct work_struct, lru_add_drain_work);
mm/folio.c-816-
mm/folio.c:817:static void lru_add_drain_per_cpu(struct work_struct *dummy)
mm/folio.c-818-{
--
mm/folio.c=822=static bool cpu_needs_drain(unsigned int cpu)
--
mm/folio.c-843- */
mm/folio.c:844:static inline void __lru_add_drain_all(bool force_all_cpus)
mm/folio.c-845-{
--
mm/folio.c-867-
mm/folio.c:868:	trace_mm_lru_add_drain_all_tp(force_all_cpus);
mm/folio.c-869-
--
mm/folio.c-886-	/* It helps everyone if we do our own local drain immediately. */
mm/folio.c:887:	lru_add_drain();
mm/folio.c-888-
--
mm/folio.c-892-	 * (C) Exit the draining operation if a newer generation, from another
mm/folio.c:893:	 * lru_add_drain_all(), was already scheduled for draining. Check (A).
mm/folio.c-894-	 */
--
mm/folio.c-912-	 * along, adds some pages to its per-cpu vectors, then calls
mm/folio.c:913:	 * lru_add_drain_all().
mm/folio.c-914-	 *
--
mm/folio.c-923-	for_each_online_cpu(cpu) {
mm/folio.c:924:		struct work_struct *work = &per_cpu(lru_add_drain_work, cpu);
mm/folio.c-925-
mm/folio.c-926-		if (cpu_needs_drain(cpu)) {
mm/folio.c:927:			INIT_WORK(work, lru_add_drain_per_cpu);
mm/folio.c-928-			queue_work_on(cpu, mm_percpu_wq, work);
--
mm/folio.c-933-	for_each_cpu(cpu, &has_work)
mm/folio.c:934:		flush_work(&per_cpu(lru_add_drain_work, cpu));
mm/folio.c-935-
--
mm/folio.c-939-
mm/folio.c:940:void lru_add_drain_all(void)
mm/folio.c-941-{
mm/folio.c:942:	__lru_add_drain_all(false);
mm/folio.c-943-}
mm/folio.c-944-#else
mm/folio.c:945:void lru_add_drain_all(void)
mm/folio.c-946-{
mm/folio.c:947:	lru_add_drain();
mm/folio.c-948-}
--
mm/folio.c=961=void lru_cache_disable(void)
--
mm/folio.c-978-#ifdef CONFIG_SMP
mm/folio.c:979:	__lru_add_drain_all(true);
mm/folio.c-980-#else
--
mm/folio.c=1109=void __folio_batch_release(struct folio_batch *fbatch)
--
mm/folio.c-1111-	if (!fbatch->percpu_pvec_drained) {
mm/folio.c:1112:		lru_add_drain();
mm/folio.c-1113-		fbatch->percpu_pvec_drained = true;
--
mm/gup.c=1813=long populate_vma_page_range(struct vm_area_struct *vma,
--
mm/gup.c-1861-			       NULL, locked ? locked : &local_locked);
mm/gup.c:1862:	lru_add_drain();
mm/gup.c-1863-	return ret;
--
mm/gup.c=1887=long faultin_page_range(struct mm_struct *mm, unsigned long start,
--
mm/gup.c-1913-				      gup_flags);
mm/gup.c:1914:	lru_add_drain();
mm/gup.c-1915-	return ret;
--
mm/gup.c=2265=static unsigned long collect_longterm_unpinnable_folios(
--
mm/gup.c-2292-				folio_expected_ref_count(folio) + 1) {
mm/gup.c:2293:			lru_add_drain();
mm/gup.c-2294-			drained = 1;
--
mm/gup.c-2298-				folio_expected_ref_count(folio) + 1) {
mm/gup.c:2299:			lru_add_drain_all();
mm/gup.c-2300-			drained = 2;
--
mm/internal.h=64=void lru_cache_disable(void);
mm/internal.h:65:void lru_add_drain(void);
mm/internal.h:66:void lru_add_drain_cpu(int cpu);
mm/internal.h:67:void lru_add_drain_cpu_zone(struct zone *zone);
mm/internal.h-68-void folio_deactivate(struct folio *folio);
--
mm/khugepaged.c=1148=static enum scan_result __collapse_huge_page_swapin(struct mm_struct *mm,
--
mm/khugepaged.c-1229-	if (swapped_in)
mm/khugepaged.c:1230:		lru_add_drain();
mm/khugepaged.c-1231-
--
mm/khugepaged.c=2247=static enum scan_result collapse_file(struct mm_struct *mm, unsigned long addr,
--
mm/khugepaged.c-2328-				/* drain lru cache to help folio_isolate_lru() */
mm/khugepaged.c:2329:				lru_add_drain();
mm/khugepaged.c-2330-			} else if (folio_trylock(folio)) {
--
mm/khugepaged.c-2343-				/* drain lru cache to help folio_isolate_lru() */
mm/khugepaged.c:2344:				lru_add_drain();
mm/khugepaged.c-2345-				folio = filemap_lock_folio(mapping, index);
--
mm/khugepaged.c=2977=static void khugepaged_do_scan(struct collapse_control *cc)
--
mm/khugepaged.c-2983-
mm/khugepaged.c:2984:	lru_add_drain_all();
mm/khugepaged.c-2985-
--
mm/khugepaged.c=3188=int madvise_collapse(struct vm_area_struct *vma, unsigned long start,
--
mm/khugepaged.c-3216-	mmgrab(mm);
mm/khugepaged.c:3217:	lru_add_drain_all();
mm/khugepaged.c-3218-
--
mm/ksm.c=2611=static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page)
--
mm/ksm.c-2638-		 */
mm/ksm.c:2639:		lru_add_drain_all();
mm/ksm.c-2640-
--
mm/madvise.c=281=static long madvise_willneed(struct madvise_behavior *madv_behavior)
--
mm/madvise.c-292-		walk_page_range_vma(vma, start, end, &swapin_walk_ops, vma);
mm/madvise.c:293:		lru_add_drain(); /* Push any new pages onto the LRU now */
mm/madvise.c-294-		return 0;
--
mm/madvise.c-298-		shmem_swapin_range(vma, start, end, file->f_mapping);
mm/madvise.c:299:		lru_add_drain(); /* Push any new pages onto the LRU now */
mm/madvise.c-300-		return 0;
--
mm/madvise.c=595=static long madvise_cold(struct madvise_behavior *madv_behavior)
--
mm/madvise.c-602-
mm/madvise.c:603:	lru_add_drain();
mm/madvise.c-604-	tlb_gather_mmu(&tlb, madv_behavior->mm);
--
mm/madvise.c=626=static long madvise_pageout(struct madvise_behavior *madv_behavior)
--
mm/madvise.c-643-
mm/madvise.c:644:	lru_add_drain();
mm/madvise.c-645-	tlb_gather_mmu(&tlb, madv_behavior->mm);
--
mm/madvise.c=799=static int madvise_free_single_vma(struct madvise_behavior *madv_behavior)
--
mm/madvise.c-818-
mm/madvise.c:819:	lru_add_drain();
mm/madvise.c-820-	update_hiwater_rss(mm);
--
mm/memcontrol-v1.c=1835=static int mem_cgroup_force_empty(struct mem_cgroup *memcg)
--
mm/memcontrol-v1.c-1839-	/* we call try-to-free pages for make this cgroup empty */
mm/memcontrol-v1.c:1840:	lru_add_drain_all();
mm/memcontrol-v1.c-1841-
--
mm/memfd.c=38=static void memfd_tag_pins(struct xa_state *xas)
--
mm/memfd.c-42-
mm/memfd.c:43:	lru_add_drain();
mm/memfd.c-44-
--
mm/memfd.c=156=static int memfd_wait_for_pins(struct address_space *mapping)
--
mm/memfd.c-171-		if (!scan)
mm/memfd.c:172:			lru_add_drain_all();
mm/memfd.c-173-		else if (schedule_timeout_killable((HZ << scan) / 200))
--
mm/memory-failure.c=286=static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)
--
mm/memory-failure.c-314- * Unknown page type encountered. Try to check whether it can turn PageLRU by
mm/memory-failure.c:315: * lru_add_drain_all.
mm/memory-failure.c-316- */
mm/memory-failure.c=317=void shake_folio(struct folio *folio)
--
mm/memory-failure.c-327-
mm/memory-failure.c:328:	lru_add_drain_all();
mm/memory-failure.c-329-}
--
mm/memory.c=4251=static bool wp_can_reuse_anon_folio(struct folio *folio,
--
mm/memory.c-4274-		 */
mm/memory.c:4275:		lru_add_drain();
mm/memory.c-4276-	if (folio_ref_count(folio) > 1 + in_swapcache)
--
mm/migrate.c=1364=static int migrate_folio_move(free_folio_t put_new_folio, unsigned long private,
--
mm/migrate.c-1416-	if (old_folio_state & FOLIO_WAS_MLOCKED)
mm/migrate.c:1417:		lru_add_drain();
mm/migrate.c-1418-
--
mm/migrate_device.c=571=static unsigned long migrate_device_unmap(unsigned long *src_pfns,
--
mm/migrate_device.c-580-
mm/migrate_device.c:581:	lru_add_drain();
mm/migrate_device.c-582-
--
mm/migrate_device.c-604-				/* Drain CPU's lru cache */
mm/migrate_device.c:605:				lru_add_drain_all();
mm/migrate_device.c-606-				allow_drain = false;
--
mm/mlock.c=423=static void mlock_vma_pages_range(struct vm_area_struct *vma,
--
mm/mlock.c-447-
mm/mlock.c:448:	lru_add_drain();
mm/mlock.c-449-	walk_page_range_vma(vma, start, end, &mlock_walk_ops, NULL);
mm/mlock.c:450:	lru_add_drain();
mm/mlock.c-451-
--
mm/page_alloc.c=6463=static int page_alloc_cpu_dead(unsigned int cpu)
--
mm/page_alloc.c-6466-
mm/page_alloc.c:6467:	lru_add_drain_cpu(cpu);
mm/page_alloc.c-6468-	mlock_drain_remote(cpu);
--
mm/vmscan.c=1979=static unsigned long shrink_inactive_list(unsigned long nr_to_scan,
--
mm/vmscan.c-2005-
mm/vmscan.c:2006:	lru_add_drain();
mm/vmscan.c-2007-
--
mm/vmscan.c=2061=static void shrink_active_list(unsigned long nr_to_scan,
--
mm/vmscan.c-2076-
mm/vmscan.c:2077:	lru_add_drain();
mm/vmscan.c-2078-
--
mm/vmscan.c=5136=static void lru_gen_shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
--
mm/vmscan.c-5142-
mm/vmscan.c:5143:	lru_add_drain();
mm/vmscan.c-5144-
--
mm/vmscan.c=5157=static void lru_gen_shrink_node(struct pglist_data *pgdat, struct scan_control *sc)
--
mm/vmscan.c-5171-
mm/vmscan.c:5172:	lru_add_drain();
mm/vmscan.c-5173-
--
mm/vmscan.c=7886=int user_proactive_reclaim(char *buf,
--
mm/vmscan.c-7950-		if (!nr_retries)
mm/vmscan.c:7951:			lru_add_drain_all();
mm/vmscan.c-7952-
]

79/2 2026/08/27 19:22 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 39218
							output: 24
							thoughts: 1642
						

Thoughts:
**The Subtle Race Between CPU Batching and Offline Operations**

I've been digging into a rather intricate race condition, and it all hinges on the localized nature of CPU-specific memory management batches and the timing of CPU hotplug events. My investigation started with `lru_add_drain()`, a function in `mm/folio.c`. It's quite explicit: `lru_add_drain()` *only* drains the *local* CPU's batch. This was my initial "aha!" moment.

So, imagine this scenario: CPU 0 faults in a page. Because it's local, this page lands squarely in CPU 0's `lru_add` batch. Now, let's say CPU 1 needs to operate on this page, specifically calling `munlock` on its associated Virtual Memory Area (VMA). When CPU 1 calls `lru_add_drain()`, it's utterly ineffective for CPU 0's batch – it does absolutely nothing for that page.

The problem escalates when CPU 1 proceeds to walk the page tables, finds the page, and then calls `munlock_folio`. This call, in turn, adds the page to CPU 1's `mlock_fbatch`. Subsequently, CPU 1 is taken offline. At this point, a *different* CPU, let's say CPU 0, needs to process CPU 1's batches that were pending. It does this via `mlock_drain_remote(1)`. This function then attempts to process CPU 1's `mlock_fbatch`.

Here's where the race really bites: when `__munlock_folio` is called on the page, it checks if the page can be cleared from the LRU. However, because the page *is still in CPU 0's `lru_add` batch* (which was never drained by CPU 1's `lru_add_drain()`), the `folio_test_clear_lru(folio)` check returns `FALSE`. This leads to a call to `__zone_stat_mod_folio` with preemption *enabled*. This is precisely what triggers the warning I've been seeing.

Reproducing this seemed straightforward, but the trigger for a CPU going offline needed a specific mechanism. Writing "0" to `/sys/devices/system/cpu/cpu1/online` is the way to go.

My thought process for constructing a reproducer involved two threads. Thread 1, pinned to CPU 0, would be responsible for initially faulting the page in, ensuring it lands in CPU 0's `lru_add` batch. Critically, to prevent CPU 0's batch from being drained prematurely by its own `lru_add_drain()` calls (which happen under various conditions, like when the batch fills or the CPU becomes idle), I realized Thread 1 would need to enter a continuous, busy loop. This would effectively keep CPU 0 occupied and prevent its `lru_add` batch from being flushed.

Thread 2, pinned to CPU 1, would then perform the `mlock` and `munlock` operations. The sequence was important: `mlock` would add the page to CPU 1's `mlock_fbatch` with the `LRU_FOLIO` flag, and the subsequent `munlock` would add it again, this time without flags. Then, Thread 2 would signal the main thread to offline CPU 1.

The main thread, after receiving the signal, would trigger the CPU offline event. This would, in turn, cause `mlock_drain_remote()` to be executed on another CPU, initiating the processing of CPU 1's `mlock_fbatch`. This is where the `folio_test_clear_lru()` check on CPU 0's retained `lru_add` batch would fail, leading to the preemption-enabled `__zone_stat_mod_folio` call and the warning.

I did pause to consider whether `mlock` might call `lru_add_drain_all()`, but checking the `mlock_vma_pages_range` code confirmed it only calls the local `lru_add_drain()`. Also, if `mlock` were to fault the page in on CPU 1, it would complicate the scenario, but since CPU 0 already faulted it in, `mlock` simply finds it. The crucial point remains that CPU 0's `lru_add` batch is never cleared by CPU 1's local drain. The batch size also plays a role; if only one operation occurs, the batch won't fill and drain on its own. Finally, I confirmed that when a CPU goes offline, its pending batches are typically processed by a surviving CPU, leading to the `mlock_drain_remote` invocation.


80/2 2026/08/27 19:22 tool grepper
0m Args:
map[Expression:mlock_drain PathPrefix:]

Results:
map[Output:mm/folio.c=781=void lru_add_drain(void)
--
mm/folio.c-785-	local_unlock(&cpu_fbatches.lock);
mm/folio.c:786:	mlock_drain_local();
mm/folio.c-787-}
--
mm/folio.c=795=static void lru_add_and_bh_lrus_drain(void)
--
mm/folio.c-800-	invalidate_bh_lrus_cpu();
mm/folio.c:801:	mlock_drain_local();
mm/folio.c-802-}
--
mm/folio.c=804=void lru_add_drain_cpu_zone(struct zone *zone)
--
mm/folio.c-809-	local_unlock(&cpu_fbatches.lock);
mm/folio.c:810:	mlock_drain_local();
mm/folio.c-811-}
--
mm/folio.c=822=static bool cpu_needs_drain(unsigned int cpu)
--
mm/folio.c-832-			 folio_batch_count(&fbatches->lru_activate) ||
mm/folio.c:833:			 need_mlock_drain(cpu)) ||
mm/folio.c-834-		has_bh_in_lru(cpu, NULL);
--
mm/huge_memory.c=3513=static bool __discard_anon_folio_pmd_locked(struct vm_area_struct *vma,
--
mm/huge_memory.c-3569-	if (vma->vm_flags & VM_LOCKED)
mm/huge_memory.c:3570:		mlock_drain_local();
mm/huge_memory.c-3571-	folio_put(folio);
--
mm/internal.h=1013=void mlock_new_folio(struct folio *folio);
mm/internal.h:1014:bool need_mlock_drain(int cpu);
mm/internal.h:1015:void mlock_drain_local(void);
mm/internal.h:1016:void mlock_drain_remote(int cpu);
mm/internal.h-1017-
--
mm/internal.h=1107=static inline void mlock_new_folio(struct folio *folio) { }
mm/internal.h:1108:static inline bool need_mlock_drain(int cpu) { return false; }
mm/internal.h:1109:static inline void mlock_drain_local(void) { }
mm/internal.h:1110:static inline void mlock_drain_remote(int cpu) { }
mm/internal.h-1111-#endif /* !CONFIG_MMU */
--
mm/migrate.c=351=static bool remove_migration_pte(struct folio *folio,
--
mm/migrate.c-451-		if (READ_ONCE(vma->vm_flags) & VM_LOCKED)
mm/migrate.c:452:			mlock_drain_local();
mm/migrate.c-453-
--
mm/mlock.c=186=static void mlock_folio_batch(struct folio_batch *fbatch)
--
mm/mlock.c-211-
mm/mlock.c:212:void mlock_drain_local(void)
mm/mlock.c-213-{
--
mm/mlock.c-222-
mm/mlock.c:223:void mlock_drain_remote(int cpu)
mm/mlock.c-224-{
--
mm/mlock.c-232-
mm/mlock.c:233:bool need_mlock_drain(int cpu)
mm/mlock.c-234-{
--
mm/page_alloc.c=6463=static int page_alloc_cpu_dead(unsigned int cpu)
--
mm/page_alloc.c-6467-	lru_add_drain_cpu(cpu);
mm/page_alloc.c:6468:	mlock_drain_remote(cpu);
mm/page_alloc.c-6469-	drain_pages(cpu);
--
mm/rmap.c=2195=static bool try_to_unmap_one(struct folio *folio, struct vm_area_struct *vma,
--
mm/rmap.c-2393-		if (vma->vm_flags & VM_LOCKED)
mm/rmap.c:2394:			mlock_drain_local();
mm/rmap.c-2395-		folio_put_refs(folio, nr_pages);
--
mm/rmap.c=2459=static bool try_to_migrate_one(struct folio *folio, struct vm_area_struct *vma,
--
mm/rmap.c-2768-		if (vma->vm_flags & VM_LOCKED)
mm/rmap.c:2769:			mlock_drain_local();
mm/rmap.c-2770-		folio_put(folio);
]

81/2 2026/08/27 19:22 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 42172
							output: 34
							thoughts: 151
						

Thoughts:
**My Thought Process on `mlock` and Draining:**

My initial observation, and a key realization, is that `lru_add_drain()` is involved. I double-checked this, confirming that, yes, `lru_add_drain()` is indeed called.

This immediately led me to consider the implications for thread synchronization. If Thread 1 calls `munlock`, and I know `munlock` eventually results in a call to `lru_add_drain()`, then my next thought is about what `lru_add_drain()` actually does. Specifically, it drains the `mlock_fbatch` for a particular CPU. So, if Thread 1 is performing an `munlock` on CPU 1, it will trigger a drain of CPU 1's `mlock_fbatch`.

However, I needed to be more precise. My next step was to trace the execution path from `munlock` more carefully. I confirmed that `munlock` *doesn't* directly call `lru_add_drain()`. Instead, it calls `mlock_vma_pages_range`.

This is where things get more intricate. Upon revisiting `mlock_vma_pages_range`, I discovered a critical detail: it invokes `lru_add_drain()` not once, but *twice*. It's called both *before* the `walk_page_range_vma` operation and again *after* it completes. This repeated invocation is significant because it means the `mlock_fbatch` for the relevant CPU is being drained at multiple points within the `mlock_vma_pages_range` execution. My focus is now on understanding the precise behavior and state of `mlock_vma_pages_range` and its interaction with the LRU draining mechanism.


82/2 2026/08/27 19:23 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:440 LineCount:20]

Results:
map[Contents: 440:		 * combination should not be visible to other mmap_lock users;
 441:		 * but WRITE_ONCE so rmap walkers must see VMA_IO_BIT if VMA_LOCKED_BIT.
 442:		 */
 443:		if (vma_flags_test(new_vma_flags, VMA_LOCKED_BIT))
 444:			vma_flags_set(new_vma_flags, VMA_IO_BIT);
 445:		vma_start_write(vma);
 446:		vma_flags_reset_once(vma, new_vma_flags);
 447:	
 448:		lru_add_drain();
 449:		walk_page_range_vma(vma, start, end, &mlock_walk_ops, NULL);
 450:		lru_add_drain();
 451:	
 452:		if (vma_flags_test(new_vma_flags, VMA_IO_BIT)) {
 453:			vma_flags_clear(new_vma_flags, VMA_IO_BIT);
 454:			vma_flags_reset_once(vma, new_vma_flags);
 455:		}
 456:	}
 457:	
 458:	/*
 459:	 * mlock_fixup  - handle mlock[all]/munlock[all] requests.
]

83/2 2026/08/27 19:23 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 42738
							output: 22
							thoughts: 197
						

Thoughts:
**My Thought Process Unpacking `mlock_vma_pages_range` and `mlock_fbatch` Interaction**

Right, so I've been digging into the interaction between `mlock_vma_pages_range` and the `mlock_fbatch` mechanism, and a key observation just hit me. It appears that `mlock_vma_pages_range` actually invokes `lru_add_drain()` *after* it completes its `walk_page_range_vma` operation. This is significant because `lru_add_drain()`, in turn, calls `mlock_drain_local()`.

What this implies, from my perspective, is that the `mlock_fbatch` is being *drained locally* before the `munlock` operation even returns. And here's the critical part for preventing a potential race or warning: when `mlock_drain_local()` executes, it uses `local_lock(&mlock_fbatch.lock)`. This locking mechanism inherently disables preemption. Therefore, any scenario that might have been expected to trigger a warning due to a race condition – perhaps a remote process attempting to access the batch concurrently – is effectively prevented because preemption is off. The warning simply won't trigger in this specific path.

However, this then sparks a new line of inquiry. If `mlock_vma_pages_range` itself is draining the batch locally, how is it possible for `mlock_drain_remote` to ever actually *see* a folio residing in `mlock_fbatch`? This seems counterintuitive. The only logical explanation I can conceive is that `munlock_folio` must be callable from other contexts, not solely from the `mlock_vma_pages_range` path that I was initially focused on. This leads me to the immediate next step: I need to thoroughly examine *all* the call sites of `munlock_folio` to understand the full scope of its usage and where else it might be invoked.


84/2 2026/08/27 19:23 tool codesearch-find-references
0m Args:
map[Name:munlock_folio]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:mlock_pte_range SourceFile:mm/mlock.c SourceLine:374] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:mlock_pte_range SourceFile:mm/mlock.c SourceLine:399] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:munlock_vma_folio SourceFile:mm/internal.h SourceLine:1010]] TruncatedOutput:false]

85/2 2026/08/27 19:23 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 43059
							output: 25
							thoughts: 26
						

Thoughts:
**My Internal Monologue on `munlock_vma_folio`**

So, the immediate thought upon encountering `munlock_vma_folio` is, "Alright, let's dive into this. I need to understand exactly what this function is doing." My mind is already geared towards dissecting its purpose, its parameters, its return values, and its interactions with the broader memory management subsystem. I'm not just looking at it in isolation; I'm thinking about its role in the context of memory locking, specifically how it pertains to `vma` (virtual memory areas) and `folio` (a modern, contiguous memory management unit). My internal process is to break it down: What does it *unlock*? What kind of *vma* is it dealing with? And what's the significance of operating at the `folio` level? This initial, almost instinctual, urge to examine the function signifies my expertise – I'm not intimidated by new API elements; I see them as opportunities to deepen my understanding of the system's mechanics. It's a call to action for a detailed analysis.


86/2 2026/08/27 19:23 tool codesearch-find-references
0m Args:
map[Name:munlock_vma_folio]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__folio_remove_rmap SourceFile:mm/rmap.c SourceLine:1883]] TruncatedOutput:false]

87/2 2026/08/27 19:23 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 43149
							output: 34
							thoughts: 42
						

Thoughts:
**My Thought Process:**

My initial thought is an exclamation of surprise and realization: "Ah!" This is immediately followed by the identification of a specific function call, `__folio_remove_rmap`, and its subsequent invocation of another function, `munlock_vma_folio`. This connection sparks my curiosity and directs my focus.

My next step is to investigate the origin of this observed relationship. I want to understand *why* `__folio_remove_rmap` is calling `munlock_vma_folio`. To do this, I immediately decide to examine the implementation of `__folio_remove_rmap`. My plan is to locate this function within the kernel source code, specifically in the file `mm/rmap.c`. This is my immediate next action – to dive into the code and trace the execution path.


88/2 2026/08/27 19:23 tool read-file
0m Args:
map[File:mm/rmap.c FirstLine:1870 LineCount:30]

Results:
map[Contents:1870:		    !folio_is_device_private(folio))
1871:			deferred_split_folio(folio, true);
1872:	
1873:		__folio_mod_stat(folio, -nr, -nr_pmdmapped);
1874:	
1875:		/*
1876:		 * It would be tidy to reset folio_test_anon mapping when fully
1877:		 * unmapped, but that might overwrite a racing folio_add_anon_rmap_*()
1878:		 * which increments mapcount after us but sets mapping before us:
1879:		 * so leave the reset to free_pages_prepare, and remember that
1880:		 * it's only reliable while mapped.
1881:		 */
1882:	
1883:		munlock_vma_folio(folio, vma);
1884:	}
1885:	
1886:	/**
1887:	 * folio_remove_rmap_ptes - remove PTE mappings from a page range of a folio
1888:	 * @folio:	The folio to remove the mappings from
1889:	 * @page:	The first page to remove
1890:	 * @nr_pages:	The number of pages that will be removed from the mapping
1891:	 * @vma:	The vm area from which the mappings are removed
1892:	 *
1893:	 * The page range of the folio is defined by [page, page + nr_pages)
1894:	 *
1895:	 * The caller needs to hold the page table lock.
1896:	 */
1897:	void folio_remove_rmap_ptes(struct folio *folio, struct page *page,
1898:			int nr_pages, struct vm_area_struct *vma)
1899:	{
]

89/2 2026/08/27 19:23 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 43705
							output: 34
							thoughts: 122
						

Thoughts:
**My Thought Process Regarding Folio Removal and Unlocking**

Okay, so I'm looking at this `__folio_remove_rmap` function and its interaction with `munlock_vma_folio`. My primary question is, under what circumstances is `__folio_remove_rmap` actually invoked?

My initial thought is that it's called when a page is being unmapped. This immediately brings to mind several common scenarios where page unmapping occurs:

*   **`munmap`:** The most direct and obvious case, where an explicit `munmap` call is made by a process.
*   **`madvise(MADV_DONTNEED)`:** This is another significant one. When a process hints that it no longer needs a region of memory, the kernel might choose to unmap those pages.
*   **`madvise(MADV_FREE)`:** Similar to `MADV_DONTNEED`, but with a slightly different semantic regarding potential reuse. Still, it implies unmapping.
*   **Page Reclaim:** This is a crucial, more implicit scenario. During memory pressure, when the kernel needs to free up memory, it will reclaim pages. This reclamation process inherently involves unmapping those pages from their current virtual address spaces.

Now, here's the critical connection I'm making: if a page is indeed unmapped, my understanding is that `munlock_vma_folio` *must* be called. This seems to be the mechanism by which the kernel ensures that any associated memory lock information (like pages that were locked in memory) is properly de-registered or handled when the page is no longer part of an active mapping.

To confirm this, I'll be diving into the `mm/internal.h` header file to examine the implementation of `munlock_vma_folio` directly. I need to see precisely how it's designed to interact with the folio and VMA structures in this context.


90/2 2026/08/27 19:23 tool read-file
0m Args:
map[File:mm/internal.h FirstLine:1000 LineCount:20]

Results:
map[Contents:1000:		/*
1001:		 * munlock if the function is called. Ideally, we should only
1002:		 * do munlock if any page of folio is unmapped from VMA and
1003:		 * cause folio not fully mapped to VMA.
1004:		 *
1005:		 * But it's not easy to confirm that's the situation. So we
1006:		 * always munlock the folio and page reclaim will correct it
1007:		 * if it's wrong.
1008:		 */
1009:		if (unlikely(vma->vm_flags & VM_LOCKED))
1010:			munlock_folio(folio);
1011:	}
1012:	
1013:	void mlock_new_folio(struct folio *folio);
1014:	bool need_mlock_drain(int cpu);
1015:	void mlock_drain_local(void);
1016:	void mlock_drain_remote(int cpu);
1017:	
1018:	extern pmd_t maybe_pmd_mkwrite(pmd_t pmd, struct vm_area_struct *vma);
1019:	
]

91/2 2026/08/27 19:23 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 44177
							output: 32
							thoughts: 348
						

Thoughts:
**My Thought Process Regarding Memory Unmapping and MLocks**

Okay, so I'm trying to get a handle on what happens when memory is unmapped, specifically concerning the MLOCK mechanism and its interaction with the LRU lists. This is a bit nuanced, so let's break it down.

My initial realization is that if a page is currently locked (meaning `VMA_MLOCK` is set) and then we unmap it, the `munlock_folio(folio)` function is indeed invoked. This seems straightforward enough.

However, I've also noticed a critical detail: neither `munmap` nor `madvise` directly calls `mlock_drain_local()`. This is a bit surprising, as one might expect a direct call to clear out any pending locked pages.

This leads me to question: does `munmap` eventually trigger a drain, perhaps indirectly? Let's trace the call chain. I see that `munmap` calls `unmap_region`, which in turn calls `unmap_vmas`. This continues down through `unmap_page_range`, `zap_p4d_range`, and eventually reaches `zap_pte_range`.

It's within `zap_pte_range` that things become more interesting. It calls `folio_remove_rmap_ptes`, which then calls `__folio_remove_rmap`. And here it is: `__folio_remove_rmap` invokes `munlock_vma_folio`, and *that* calls `munlock_folio`! So, yes, the `munlock_folio` path is definitely hit when `munmap` unmaps a page that was previously locked.

Now, the crucial part: `munlock_folio` doesn't just unlock the page; it adds the folio to a batch called `mlock_fbatch`. The problem arises because `munmap` completes *after* this addition, and it *does not* drain the `mlock_fbatch` before returning. Consequently, the folio remains resident in `mlock_fbatch`. This is significant because it means that if the CPU subsequently goes offline, the `mlock_drain_remote` mechanism will eventually pick up and process this folio from the batch.

This brings me to a related, and equally important, question: what happens if the folio is *not* currently on the LRU list when `munmap` unmaps it? If we've just allocated a folio and it's sitting in an `lru_add` batch, it's not yet on the main LRU list. And again, I'm confirming that `munmap` doesn't seem to call `lru_add_drain()`. So, I need to re-verify the exact conditions under which `munmap` might interact with or trigger the draining of these preparatory batches.


92/2 2026/08/27 19:23 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:lru_add_drain PathPrefix:mm/mmap.c]

Results:
map[Output:]

93/2 2026/08/27 19:23 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 44555
							output: 28
							thoughts: 25
						

Thoughts:
**My Thought Process on Debugging VMI Munmap Operations**

My immediate instinct when encountering an issue related to memory unmapping within the Virtual Machine Introspection (VMI) framework is to dive into the specific functions responsible for this operation. I'm thinking, "Okay, where is this `munmap` logic actually handled in VMI?" My first inclination is to look at `do_vmi_align_munmap`. The name itself suggests it's the primary, and possibly alignment-aware, function for handling unmapping. However, I also want to keep a close eye on a potentially more general or fallback function, `do_vmi_munmap`. It's possible that `do_vmi_align_munmap` is a specialized wrapper or calls into `do_vmi_munmap` for the core logic, or perhaps they handle different scenarios. My strategy is to trace the execution path from wherever the unmapping request originates, and systematically examine the code within both these functions to understand their internal workings, their dependencies, and how they manage the VMI memory state during an unmap event. I'll be looking for critical operations like pointer manipulation, memory region deallocation, potential synchronization mechanisms, and any error handling or logging that might provide clues to the problem.


94/2 2026/08/27 19:23 tool grepper
0m Args:
map[Expression:lru_add_drain PathPrefix:mm/]

Results:
map[Output:mm/compaction.c=2562=compact_zone(struct compact_control *cc, struct capture_control *capc)
--
mm/compaction.c-2645-
mm/compaction.c:2646:	/* lru_add_drain_all could be expensive with involving other CPUs */
mm/compaction.c:2647:	lru_add_drain();
mm/compaction.c-2648-
--
mm/compaction.c-2762-			if (last_migrated_pfn < current_block_start) {
mm/compaction.c:2763:				lru_add_drain_cpu_zone(cc->zone);
mm/compaction.c-2764-				/* No more flushing until we migrate again */
--
mm/compaction.c=2959=static int compact_nodes(void)
--
mm/compaction.c-2963-	/* Flush pending updates to the LRU lists */
mm/compaction.c:2964:	lru_add_drain_all();
mm/compaction.c-2965-
--
mm/compaction.c=3024=static ssize_t compact_store(struct device *dev,
--
mm/compaction.c-3031-		/* Flush pending updates to the LRU lists */
mm/compaction.c:3032:		lru_add_drain_all();
mm/compaction.c-3033-
--
mm/fadvise.c=31=int generic_fadvise(struct file *file, loff_t offset, loff_t len, int advice)
--
mm/fadvise.c-154-			 */
mm/fadvise.c:155:			lru_add_drain();
mm/fadvise.c-156-
--
mm/fadvise.c-165-			if (nr_failed) {
mm/fadvise.c:166:				lru_add_drain_all();
mm/fadvise.c-167-				invalidate_mapping_pages(mapping, start_index,
--
mm/folio.c=655=static void lru_lazyfree(struct lruvec *lruvec, struct folio *folio)
--
mm/folio.c-685- */
mm/folio.c:686:void lru_add_drain_cpu(int cpu)
mm/folio.c-687-{
--
mm/folio.c-693-		folio_batch_move_lru(fbatch, lru_add);
mm/folio.c:694:		trace_mm_lru_add_drain_tp(cpu, nr_folios);
mm/folio.c-695-	}
--
mm/folio.c=771=void folio_mark_lazyfree(struct folio *folio)
--
mm/folio.c-780-
mm/folio.c:781:void lru_add_drain(void)
mm/folio.c-782-{
mm/folio.c-783-	local_lock(&cpu_fbatches.lock);
mm/folio.c:784:	lru_add_drain_cpu(smp_processor_id());
mm/folio.c-785-	local_unlock(&cpu_fbatches.lock);
--
mm/folio.c-790- * It's called from per-cpu workqueue context in SMP case so
mm/folio.c:791: * lru_add_drain_cpu and invalidate_bh_lrus_cpu should run on
mm/folio.c-792- * the same cpu. It shouldn't be a problem in !SMP case since
--
mm/folio.c=795=static void lru_add_and_bh_lrus_drain(void)
--
mm/folio.c-797-	local_lock(&cpu_fbatches.lock);
mm/folio.c:798:	lru_add_drain_cpu(smp_processor_id());
mm/folio.c-799-	local_unlock(&cpu_fbatches.lock);
--
mm/folio.c-803-
mm/folio.c:804:void lru_add_drain_cpu_zone(struct zone *zone)
mm/folio.c-805-{
mm/folio.c-806-	local_lock(&cpu_fbatches.lock);
mm/folio.c:807:	lru_add_drain_cpu(smp_processor_id());
mm/folio.c-808-	drain_local_pages(zone);
--
mm/folio.c-814-
mm/folio.c:815:static DEFINE_PER_CPU(struct work_struct, lru_add_drain_work);
mm/folio.c-816-
mm/folio.c:817:static void lru_add_drain_per_cpu(struct work_struct *dummy)
mm/folio.c-818-{
--
mm/folio.c=822=static bool cpu_needs_drain(unsigned int cpu)
--
mm/folio.c-843- */
mm/folio.c:844:static inline void __lru_add_drain_all(bool force_all_cpus)
mm/folio.c-845-{
--
mm/folio.c-867-
mm/folio.c:868:	trace_mm_lru_add_drain_all_tp(force_all_cpus);
mm/folio.c-869-
--
mm/folio.c-886-	/* It helps everyone if we do our own local drain immediately. */
mm/folio.c:887:	lru_add_drain();
mm/folio.c-888-
--
mm/folio.c-892-	 * (C) Exit the draining operation if a newer generation, from another
mm/folio.c:893:	 * lru_add_drain_all(), was already scheduled for draining. Check (A).
mm/folio.c-894-	 */
--
mm/folio.c-912-	 * along, adds some pages to its per-cpu vectors, then calls
mm/folio.c:913:	 * lru_add_drain_all().
mm/folio.c-914-	 *
--
mm/folio.c-923-	for_each_online_cpu(cpu) {
mm/folio.c:924:		struct work_struct *work = &per_cpu(lru_add_drain_work, cpu);
mm/folio.c-925-
mm/folio.c-926-		if (cpu_needs_drain(cpu)) {
mm/folio.c:927:			INIT_WORK(work, lru_add_drain_per_cpu);
mm/folio.c-928-			queue_work_on(cpu, mm_percpu_wq, work);
--
mm/folio.c-933-	for_each_cpu(cpu, &has_work)
mm/folio.c:934:		flush_work(&per_cpu(lru_add_drain_work, cpu));
mm/folio.c-935-
--
mm/folio.c-939-
mm/folio.c:940:void lru_add_drain_all(void)
mm/folio.c-941-{
mm/folio.c:942:	__lru_add_drain_all(false);
mm/folio.c-943-}
mm/folio.c-944-#else
mm/folio.c:945:void lru_add_drain_all(void)
mm/folio.c-946-{
mm/folio.c:947:	lru_add_drain();
mm/folio.c-948-}
--
mm/folio.c=961=void lru_cache_disable(void)
--
mm/folio.c-978-#ifdef CONFIG_SMP
mm/folio.c:979:	__lru_add_drain_all(true);
mm/folio.c-980-#else
--
mm/folio.c=1109=void __folio_batch_release(struct folio_batch *fbatch)
--
mm/folio.c-1111-	if (!fbatch->percpu_pvec_drained) {
mm/folio.c:1112:		lru_add_drain();
mm/folio.c-1113-		fbatch->percpu_pvec_drained = true;
--
mm/gup.c=1813=long populate_vma_page_range(struct vm_area_struct *vma,
--
mm/gup.c-1861-			       NULL, locked ? locked : &local_locked);
mm/gup.c:1862:	lru_add_drain();
mm/gup.c-1863-	return ret;
--
mm/gup.c=1887=long faultin_page_range(struct mm_struct *mm, unsigned long start,
--
mm/gup.c-1913-				      gup_flags);
mm/gup.c:1914:	lru_add_drain();
mm/gup.c-1915-	return ret;
--
mm/gup.c=2265=static unsigned long collect_longterm_unpinnable_folios(
--
mm/gup.c-2292-				folio_expected_ref_count(folio) + 1) {
mm/gup.c:2293:			lru_add_drain();
mm/gup.c-2294-			drained = 1;
--
mm/gup.c-2298-				folio_expected_ref_count(folio) + 1) {
mm/gup.c:2299:			lru_add_drain_all();
mm/gup.c-2300-			drained = 2;
--
mm/internal.h=64=void lru_cache_disable(void);
mm/internal.h:65:void lru_add_drain(void);
mm/internal.h:66:void lru_add_drain_cpu(int cpu);
mm/internal.h:67:void lru_add_drain_cpu_zone(struct zone *zone);
mm/internal.h-68-void folio_deactivate(struct folio *folio);
--
mm/khugepaged.c=1148=static enum scan_result __collapse_huge_page_swapin(struct mm_struct *mm,
--
mm/khugepaged.c-1229-	if (swapped_in)
mm/khugepaged.c:1230:		lru_add_drain();
mm/khugepaged.c-1231-
--
mm/khugepaged.c=2247=static enum scan_result collapse_file(struct mm_struct *mm, unsigned long addr,
--
mm/khugepaged.c-2328-				/* drain lru cache to help folio_isolate_lru() */
mm/khugepaged.c:2329:				lru_add_drain();
mm/khugepaged.c-2330-			} else if (folio_trylock(folio)) {
--
mm/khugepaged.c-2343-				/* drain lru cache to help folio_isolate_lru() */
mm/khugepaged.c:2344:				lru_add_drain();
mm/khugepaged.c-2345-				folio = filemap_lock_folio(mapping, index);
--
mm/khugepaged.c=2977=static void khugepaged_do_scan(struct collapse_control *cc)
--
mm/khugepaged.c-2983-
mm/khugepaged.c:2984:	lru_add_drain_all();
mm/khugepaged.c-2985-
--
mm/khugepaged.c=3188=int madvise_collapse(struct vm_area_struct *vma, unsigned long start,
--
mm/khugepaged.c-3216-	mmgrab(mm);
mm/khugepaged.c:3217:	lru_add_drain_all();
mm/khugepaged.c-3218-
--
mm/ksm.c=2611=static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page)
--
mm/ksm.c-2638-		 */
mm/ksm.c:2639:		lru_add_drain_all();
mm/ksm.c-2640-
--
mm/madvise.c=281=static long madvise_willneed(struct madvise_behavior *madv_behavior)
--
mm/madvise.c-292-		walk_page_range_vma(vma, start, end, &swapin_walk_ops, vma);
mm/madvise.c:293:		lru_add_drain(); /* Push any new pages onto the LRU now */
mm/madvise.c-294-		return 0;
--
mm/madvise.c-298-		shmem_swapin_range(vma, start, end, file->f_mapping);
mm/madvise.c:299:		lru_add_drain(); /* Push any new pages onto the LRU now */
mm/madvise.c-300-		return 0;
--
mm/madvise.c=595=static long madvise_cold(struct madvise_behavior *madv_behavior)
--
mm/madvise.c-602-
mm/madvise.c:603:	lru_add_drain();
mm/madvise.c-604-	tlb_gather_mmu(&tlb, madv_behavior->mm);
--
mm/madvise.c=626=static long madvise_pageout(struct madvise_behavior *madv_behavior)
--
mm/madvise.c-643-
mm/madvise.c:644:	lru_add_drain();
mm/madvise.c-645-	tlb_gather_mmu(&tlb, madv_behavior->mm);
--
mm/madvise.c=799=static int madvise_free_single_vma(struct madvise_behavior *madv_behavior)
--
mm/madvise.c-818-
mm/madvise.c:819:	lru_add_drain();
mm/madvise.c-820-	update_hiwater_rss(mm);
--
mm/memcontrol-v1.c=1835=static int mem_cgroup_force_empty(struct mem_cgroup *memcg)
--
mm/memcontrol-v1.c-1839-	/* we call try-to-free pages for make this cgroup empty */
mm/memcontrol-v1.c:1840:	lru_add_drain_all();
mm/memcontrol-v1.c-1841-
--
mm/memfd.c=38=static void memfd_tag_pins(struct xa_state *xas)
--
mm/memfd.c-42-
mm/memfd.c:43:	lru_add_drain();
mm/memfd.c-44-
--
mm/memfd.c=156=static int memfd_wait_for_pins(struct address_space *mapping)
--
mm/memfd.c-171-		if (!scan)
mm/memfd.c:172:			lru_add_drain_all();
mm/memfd.c-173-		else if (schedule_timeout_killable((HZ << scan) / 200))
--
mm/memory-failure.c=286=static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)
--
mm/memory-failure.c-314- * Unknown page type encountered. Try to check whether it can turn PageLRU by
mm/memory-failure.c:315: * lru_add_drain_all.
mm/memory-failure.c-316- */
mm/memory-failure.c=317=void shake_folio(struct folio *folio)
--
mm/memory-failure.c-327-
mm/memory-failure.c:328:	lru_add_drain_all();
mm/memory-failure.c-329-}
--
mm/memory.c=4251=static bool wp_can_reuse_anon_folio(struct folio *folio,
--
mm/memory.c-4274-		 */
mm/memory.c:4275:		lru_add_drain();
mm/memory.c-4276-	if (folio_ref_count(folio) > 1 + in_swapcache)
--
mm/migrate.c=1364=static int migrate_folio_move(free_folio_t put_new_folio, unsigned long private,
--
mm/migrate.c-1416-	if (old_folio_state & FOLIO_WAS_MLOCKED)
mm/migrate.c:1417:		lru_add_drain();
mm/migrate.c-1418-
--
mm/migrate_device.c=571=static unsigned long migrate_device_unmap(unsigned long *src_pfns,
--
mm/migrate_device.c-580-
mm/migrate_device.c:581:	lru_add_drain();
mm/migrate_device.c-582-
--
mm/migrate_device.c-604-				/* Drain CPU's lru cache */
mm/migrate_device.c:605:				lru_add_drain_all();
mm/migrate_device.c-606-				allow_drain = false;
--
mm/mlock.c=423=static void mlock_vma_pages_range(struct vm_area_struct *vma,
--
mm/mlock.c-447-
mm/mlock.c:448:	lru_add_drain();
mm/mlock.c-449-	walk_page_range_vma(vma, start, end, &mlock_walk_ops, NULL);
mm/mlock.c:450:	lru_add_drain();
mm/mlock.c-451-
--
mm/page_alloc.c=6463=static int page_alloc_cpu_dead(unsigned int cpu)
--
mm/page_alloc.c-6466-
mm/page_alloc.c:6467:	lru_add_drain_cpu(cpu);
mm/page_alloc.c-6468-	mlock_drain_remote(cpu);
--
mm/vmscan.c=1979=static unsigned long shrink_inactive_list(unsigned long nr_to_scan,
--
mm/vmscan.c-2005-
mm/vmscan.c:2006:	lru_add_drain();
mm/vmscan.c-2007-
--
mm/vmscan.c=2061=static void shrink_active_list(unsigned long nr_to_scan,
--
mm/vmscan.c-2076-
mm/vmscan.c:2077:	lru_add_drain();
mm/vmscan.c-2078-
--
mm/vmscan.c=5136=static void lru_gen_shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
--
mm/vmscan.c-5142-
mm/vmscan.c:5143:	lru_add_drain();
mm/vmscan.c-5144-
--
mm/vmscan.c=5157=static void lru_gen_shrink_node(struct pglist_data *pgdat, struct scan_control *sc)
--
mm/vmscan.c-5171-
mm/vmscan.c:5172:	lru_add_drain();
mm/vmscan.c-5173-
--
mm/vmscan.c=7886=int user_proactive_reclaim(char *buf,
--
mm/vmscan.c-7950-		if (!nr_retries)
mm/vmscan.c:7951:			lru_add_drain_all();
mm/vmscan.c-7952-
]

95/2 2026/08/27 19:23 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 49840
							output: 35
							thoughts: 785
						

Thoughts:
**My Thought Process Unpacking `munmap` and Locked VMAs**

Okay, so I've been digging into how `munmap` interacts with locked VMAs, and it's proving to be a bit more complex than I initially assumed. My primary concern is ensuring that the `mlock_drain_remote` path doesn't get triggered incorrectly or miss pages it should be handling.

The first key insight I stumbled upon is that `munmap` itself *does not* directly call `lru_add_drain()`. This seems significant. When `munmap` operates on a locked VMA, it triggers `munlock_vma_folio`. This, in turn, calls `munlock_folio`, which then adds the folio to the `mlock_fbatch`. Crucially, because `munmap` doesn't drain `mlock_fbatch`, the folio *stays* in this batch. My worry here is that if a CPU goes offline later, `mlock_drain_remote` *will* process this `mlock_fbatch`, and I need to make sure that happens correctly and that the folio's state is as expected.

This leads me to a crucial question: what's the folio's status on the LRU list *at the moment `munmap` unmaps it*? If we've just faulted it in, it might be sitting in an `lru_add` batch, not yet fully on the LRU. But then I remembered the `mlock` call. If a VMA is locked using `mlock`, the `mlock` operation itself *does* call `lru_add_drain()`, effectively placing the folio on the LRU list.

So, if a folio *is* on the LRU list (because it was `mlock`ed), and then we `munmap` it:
1. `munmap` calls `munlock_vma_folio`.
2. `munlock_folio` adds it to `mlock_fbatch`.
3. Then `munmap` unmaps the page.

Now, another critical point: when a page is unmapped, does it automatically get removed from the LRU list? My current understanding is *no*, it stays on the LRU until page reclaim or a specific drain operation (like `lru_add_drain` if it was queued for lazy freeing).

This brings me back to the `folio_test_clear_lru(folio)` check. If the folio *is* indeed on the LRU list, this check will return `TRUE`. Consequently, `__munlock_folio` will proceed to acquire the LRU lock and disable interrupts. After that, `__zone_stat_mod_folio` *won't* trigger a warning, which seems to be the desired behavior in this specific scenario.

However, this implies a strong requirement: for the desired path (where `__zone_stat_mod_folio` doesn't warn), the folio *must not* be on the LRU list when `munmap` unmaps it. So, the core problem becomes: how do I get a folio into a locked VMA, and then unmap it, such that it's *not* on the LRU list?

Let's consider the `mmap` scenario. If I `mmap` a VMA with the `MAP_LOCKED` flag:
1. `mmap` sets the `VM_LOCKED` flag.
2. It then calls `mlock_vma_pages_range`, which ultimately leads to `mm_populate`.
3. `mm_populate` faults the pages in.
4. During the fault, `folio_add_lru_vma` calls `mlock_new_folio`.
5. `mlock_new_folio` adds the folio to `mlock_fbatch` with the `NEW_FOLIO` flag.
6. After this, `mm_populate` *does* call `lru_add_drain()`.

This scenario seems to indicate that the page *will* end up on the LRU list. So, `mmap` with `MAP_LOCKED` followed by `munmap` likely won't produce the state I'm trying to achieve (folio not on LRU during `munmap`).

This leads me to think about `madvise(MADV_PAGEOUT)` on a locked VMA. My reasoning is that `madvise(MADV_PAGEOUT)` is designed to *isolate* a page from the LRU list. When a page is isolated, it's removed from the LRU.
1. So, if I use `madvise(MADV_PAGEOUT)` on pages within a locked VMA.
2. Then I `munmap` that VMA.
3. `munmap` calls `munlock_vma_folio`, which adds it to `mlock_fbatch`.
4. Since it was isolated, it is *not* on the LRU list at this point.
5. This means `folio_test_clear_lru` will return `FALSE`.
6. Consequently, `__munlock_folio` will call `__zone_stat_mod_folio` with preemption enabled.
7. This is exactly where I expect the warning to trigger.

My final step in this line of thought is to verify if `madvise(MADV_PAGEOUT)` actually *works* on locked VMAs. I need to check the implementation of `madvise_pageout` and `madvise_pageout_page_range` to see if they correctly handle or skip operations on pages within `VM_LOCKED` VMA's. If they don't, then this entire line of reasoning might be flawed.


96/2 2026/08/27 19:24 tool read-file
0m Args:
map[File:mm/madvise.c FirstLine:620 LineCount:25]

Results:
map[Contents: 620:		tlb_start_vma(tlb, vma);
 621:		walk_page_range_vma(vma, range->start, range->end, &cold_walk_ops,
 622:				    &walk_private);
 623:		tlb_end_vma(tlb, vma);
 624:	}
 625:	
 626:	static long madvise_pageout(struct madvise_behavior *madv_behavior)
 627:	{
 628:		struct mmu_gather tlb;
 629:		struct vm_area_struct *vma = madv_behavior->vma;
 630:	
 631:		if (!can_madv_lru_vma(vma))
 632:			return -EINVAL;
 633:	
 634:		/*
 635:		 * If the VMA belongs to a private file mapping, there can be private
 636:		 * dirty pages which can be paged out if even this process is neither
 637:		 * owner nor write capable of the file. We allow private file mappings
 638:		 * further to pageout dirty anon pages.
 639:		 */
 640:		if (!vma_is_anonymous(vma) && (!can_do_file_pageout(vma) &&
 641:					(vma->vm_flags & VM_MAYSHARE)))
 642:			return 0;
 643:	
 644:		lru_add_drain();
]

97/2 2026/08/27 19:24 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 51068
							output: 35
							thoughts: 16
						

Thoughts:
**My Thought Process**

Right, so the first thing that comes to my mind when I see this snippet is that the primary concern is around the functionality and correctness of `can_madv_lru_vma`. I need to understand what this function *does*. My immediate thought is that it's likely a gatekeeper, a condition check, to determine if a specific Virtual Memory Area (VMA) is eligible for or should be subject to some sort of LRU (Least Recently Used) or `madvise` (memory advisory) operation.

Given the context of memory management within an operating system kernel, `can_madv_lru_vma` is almost certainly checking a set of criteria. What criteria? Well, the name itself is a big hint. It's about `madvise` and LRU. So, I'd be thinking about things like:

*   **VMA Flags:** Does the VMA have specific flags set that would prevent it from being managed by LRU or an `madvise` operation? Think about things like `VM_SPECIAL`, `VM_IO`, `VM_SHARED`, `VM_HUGETLB`, or perhaps flags related to security or specific hardware mappings.
*   **VMA Type/Region:** Is this VMA a type that is *intended* to be managed by LRU? For example, perhaps anonymous memory, file-backed memory for regular files, but maybe not memory mapped from device I/O or specific kernel structures.
*   **Process State:** While less likely to be *directly* within `can_madv_lru_vma` itself, I might briefly consider if the *current state* of the process owning the VMA could influence this. However, the function name strongly suggests it's VMA-centric.
*   **`madvise` Specifics:** The `madvise` system call has different arguments (`MADV_NORMAL`, `MADV_RANDOM`, `MADV_SEQUENTIAL`, `MADV_WILLNEED`, `MADV_DONTNEED`, etc.). `can_madv_lru_vma` could be checking if the *type* of `madvise` operation being requested is even compatible with the VMA's characteristics. For instance, `MADV_DONTNEED` might be allowed on some VMAs but not others, or might trigger different logic.
*   **LRU Interaction:** The LRU mechanism is typically for page reclamation. So, this function is probably asking, "Can we evict pages from *this* VMA using the standard LRU page replacement algorithm, or does it have special handling requirements that would bypass or interfere with LRU?" This could be due to shared mappings, copy-on-write properties, or the need for specific flushing behavior.

Essentially, my mental checklist would be: "What properties of *this specific VMA* would make it unsuitable for standard LRU page reclamation or certain `madvise` directives?" The function's purpose is to prevent misapplication of these memory management techniques, which could lead to data corruption, performance degradation, or crashes. It's about ensuring that the memory management primitives are only applied where they are valid and beneficial.


98/2 2026/08/27 19:24 tool read-file
0m Args:
map[File:mm/madvise.c FirstLine:560 LineCount:20]

Results:
map[Contents: 560:		}
 561:		if (pageout)
 562:			reclaim_pages(&folio_list);
 563:		cond_resched();
 564:	
 565:		return 0;
 566:	}
 567:	
 568:	static const struct mm_walk_ops cold_walk_ops = {
 569:		.pmd_entry = madvise_cold_or_pageout_pte_range,
 570:		.walk_lock = PGWALK_RDLOCK,
 571:	};
 572:	
 573:	static void madvise_cold_page_range(struct mmu_gather *tlb,
 574:			struct madvise_behavior *madv_behavior)
 575:	
 576:	{
 577:		struct vm_area_struct *vma = madv_behavior->vma;
 578:		struct madvise_behavior_range *range = &madv_behavior->range;
 579:		struct madvise_walk_private walk_private = {
]

99/2 2026/08/27 19:24 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 51410
							output: 37
							thoughts: 18
						

Thoughts:
**My Thought Process on `can_madv_lru_vma`**

Ah, I see it now. My initial thought was to question the definition of `can_madv_lru_vma`, but then I immediately realized, "Wait a minute, I recall defining that function earlier in this codebase." This means I don't need to go through the process of looking for its definition elsewhere; it's already within my purview and I can proceed with the assumption that it's available and correctly implemented for my current task.


100/2 2026/08/27 19:24 tool grepper
0m Args:
map[Expression:can_madv_lru_vma PathPrefix:mm/madvise.c]

Results:
map[Output:mm/madvise.c=573=static void madvise_cold_page_range(struct mmu_gather *tlb,
--
mm/madvise.c-589-
mm/madvise.c:590:static inline bool can_madv_lru_vma(struct vm_area_struct *vma)
mm/madvise.c-591-{
--
mm/madvise.c=595=static long madvise_cold(struct madvise_behavior *madv_behavior)
--
mm/madvise.c-599-
mm/madvise.c:600:	if (!can_madv_lru_vma(vma))
mm/madvise.c-601-		return -EINVAL;
--
mm/madvise.c=626=static long madvise_pageout(struct madvise_behavior *madv_behavior)
--
mm/madvise.c-630-
mm/madvise.c:631:	if (!can_madv_lru_vma(vma))
mm/madvise.c-632-		return -EINVAL;
]

101/2 2026/08/27 19:24 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 51754
							output: 35
							thoughts: 16
						

Thoughts:
**My Thought Process Upon Encountering `can_madv_lru_vma`**

Alright, so I'm diving into the code, and the first thing that catches my eye is this function, `can_madv_lru_vma`. The name itself immediately sparks a thought: "Okay, this is likely about the ability to apply the LRU (Least Recently Used) reclamation strategy to a Virtual Memory Area (VMA)." This is crucial because VMAs are fundamental to how the kernel manages memory, defining contiguous regions with specific permissions and attributes. If LRU can be applied, it implies a certain set of conditions or properties that this VMA must satisfy, or perhaps it's a check *before* such a strategy is considered.

My next instinct is to examine the parameters. What information is being passed into this function? The name `vma` is obvious, so I'm expecting a pointer to a `struct vm_area_struct`. This structure is the cornerstone of VMA management, holding all the details about the memory region. Beyond that, I'd be looking for any other context. Is there a process context? A page cache context? Information about the memory mapping itself (e.g., read-only, shared, private)? The presence of these would tell me *why* we're asking if LRU is applicable *now*, in this specific scenario.

Then, I'd get to the core logic. What are the conditions being checked? I'm hypothesizing a series of `if` statements or similar control flow structures. My expectation is that the function will return `true` (or a non-zero value indicating success) if the VMA *can* be managed by LRU, and `false` (or zero) otherwise.

What might disqualify a VMA from LRU reclamation? I'd immediately think of:

*   **Non-pageable memory:** If the VMA is meant to be pinned in memory (like kernel code, or certain I/O mapping), LRU wouldn't make sense. This would likely involve checking flags within the `vm_area_struct` related to memory locking or fixed mappings.
*   **Special VMA types:** Some VMAs are used for specific purposes, like shared memory segments or memory-mapped files with particular caching behaviors. These might have their own, more sophisticated reclamation policies or be managed outside the general LRU framework. I'd be looking for checks against specific VMA flags or types.
*   **Permissions and sharing:** Could the sharing attributes of the VMA (e.g., private vs. shared mappings) impact LRU applicability? Perhaps private mappings are more straightforward candidates for LRU than complex shared structures.
*   **Read-only regions:** While technically pageable, read-only regions might have different eviction strategies, or their eviction might be less critical if they can be easily re-created from backing store. I'd consider if `VM_RO` or similar flags are relevant.
*   **Memory mapping behavior:** Is it a `MAP_ANONYMOUS` mapping? Or backed by a file? The backing store mechanism can heavily influence reclamation. If it's an anonymous mapping, it might be a prime candidate for LRU. If it's a file-backed mapping with specific `mmap` flags, it could be different.

The absence of any of these disqualifying factors would likely lead to the `true` return. I'd be mentally tracing the path to `return 1;` (or equivalent). Conversely, encountering any of these conditions would lead me to expect a `return 0;`.

Finally, I'd consider the implications of this function's return value. If `can_madv_lru_vma` returns true, it means the kernel's memory management subsystem can confidently consider this VMA for LRU-based page eviction when memory pressure arises. This suggests that the page's reference count, its dirty status, and its backing store (if any) are all manageable within the standard LRU framework. If it returns false, then a different, perhaps more specialized, approach is needed for reclaiming pages from this VMA, or it's not reclaimable at all.

In essence, I'm seeing this function as a gatekeeper, a validation step that ensures a VMA meets the prerequisites for being managed by a generic, widely applicable memory reclamation strategy like LRU. It's about checking for exceptions and special cases before applying a general rule.


102/2 2026/08/27 19:24 tool read-file
0m Args:
map[File:mm/madvise.c FirstLine:585 LineCount:15]

Results:
map[Contents: 585:		walk_page_range_vma(vma, range->start, range->end, &cold_walk_ops,
 586:				&walk_private);
 587:		tlb_end_vma(tlb, vma);
 588:	}
 589:	
 590:	static inline bool can_madv_lru_vma(struct vm_area_struct *vma)
 591:	{
 592:		return !(vma->vm_flags & (VM_LOCKED|VM_PFNMAP|VM_HUGETLB));
 593:	}
 594:	
 595:	static long madvise_cold(struct madvise_behavior *madv_behavior)
 596:	{
 597:		struct vm_area_struct *vma = madv_behavior->vma;
 598:		struct mmu_gather tlb;
 599:	
]

103/2 2026/08/27 19:24 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 52052
							output: 32
							thoughts: 2113
						

Thoughts:
**The Subtle Race: Navigating VM_LOCKED and LRU Manipulation**

My journey to understanding this complex interaction began with a seemingly simple observation: `can_madv_lru_vma` returns `false` if a VMA has the `VM_LOCKED` flag. This immediately told me that `madvise(MADV_PAGEOUT)` would fail on locked VMAs, which felt like a significant constraint.

I then started exploring alternatives for page migration, considering `mbind` and `migrate_pages`. I confirmed that `mbind` *does* work on locked VMAs. The process involves isolating the page from the LRU, unmapping it, copying, and then remapping. The critical point I identified was what happens if I tried to `munmap` the VMA while `mbind` was in the middle of this isolation phase. If `munmap` occurred, it would call `munlock_vma_folio`. Since the page was already isolated and thus not on the LRU list, it would be added to `mlock_fbatch`. Then, if a CPU went offline, this could lead to a race condition. This seemed plausible but perhaps a bit convoluted.

My next thought was to investigate simpler `madvise` operations on locked VMAs. What about `madvise(MADV_DONTNEED)`? This also unmaps pages by calling `zap_page_range` and subsequently `munlock_vma_folio`. However, `MADV_DONTNEED` doesn't isolate the page first; it remains on the LRU list. This means `folio_test_clear_lru` would return `TRUE`, and it would lock the LRU lock. Similarly, `MADV_FREE` doesn't isolate the page either.

Then, my focus shifted to the interplay between `mlock` and `munlock` operations happening concurrently with `mbind`. I considered a scenario with three threads: one for `mbind` (page migration), another for `munmap`, and a third for CPU offline. This felt overly complex to manage.

A new idea emerged: what if I could leverage a page that's *not* on the LRU list precisely because it's in an `lru_add` batch? I knew that `lru_add_drain()` is called by `mlock_vma_pages_range`. However, I also realized that `munmap` *doesn't* call `lru_add_drain()`. This sparked a detailed thought process:

1.  **Initial State:** I'd `mmap` a VMA (crucially, *not* locked yet).
2.  **Page Fault:** A page fault occurs on CPU 0. This page is then added to CPU 0's `lru_add` batch via `folio_add_lru_vma` and then `folio_add_lru`, because the VMA isn't locked at this point.
3.  **`mlock` on CPU 1:** Now, I'd `mlock` the VMA on CPU 1. This is where things get interesting. `mlock` sets `VM_LOCKED` on the VMA. It then calls `mlock_vma_pages_range`. This function *does* call `lru_add_drain()` – but *only on CPU 1*. Crucially, it *doesn't* drain CPU 0's `lru_add` batch. The page is found, and `mlock_folio` adds it to CPU 1's `mlock_fbatch` with the `LRU_FOLIO` flag. Then, `mlock_vma_pages_range` calls `lru_add_drain()` again (on CPU 1), draining CPU 1's `mlock_fbatch`. The `mlock_folio_batch` processing leads to `__mlock_folio`. Inside `__mlock_folio`, `folio_test_clear_lru` is called. Because the page is still in CPU 0's `lru_add` batch and not on the actual LRU list, this returns `FALSE`. Consequently, `__mlock_folio` does nothing; the page isn't truly mlocked (its `mlock_count` remains zero, and it's not moved to an unevictable list).
4.  **`munmap` on CPU 1:** Next, I'd `munmap` the page on CPU 1. This involves `unmap_region`, `zap_pte_range`, `folio_remove_rmap_ptes`, and finally `__folio_remove_rmap`. Inside `__folio_remove_rmap`, `munlock_vma_folio` is called. Since the VMA *now* has `VM_LOCKED`, this function calls `munlock_folio`. `munlock_folio` adds the page to CPU 1's `mlock_fbatch` but *without* any flags. The `munmap` operation completes and returns, and importantly, it *does not* drain the `mlock_fbatch` on CPU 1.
5.  **CPU 1 Offline:** Finally, CPU 1 goes offline. When this happens, another CPU (or the system itself) calls `page_alloc_cpu_dead(1)`, which in turn invokes `mlock_drain_remote(1)`. This function then processes CPU 1's `mlock_fbatch`. It calls `__munlock_folio`. Again, `folio_test_clear_lru` is called. Since the page is *still* in CPU 0's `lru_add` batch and not on the LRU list, it returns `FALSE`. The code then jumps to the `munlock:` label and calls `__zone_stat_mod_folio(folio, NR_MLOCK, -nr_pages)`. This function ultimately calls `__mod_zone_page_state`, which uses `preempt_disable_nested()`. The critical issue here is that `mlock_drain_remote` (which is called due to CPU death) is executed with preemption enabled (since `page_alloc_cpu_dead` is called with preemption enabled). Because `preempt_count()` is `0`, the warning triggers!

This sequence of events felt like the perfect storm, a valid race condition I'd uncovered. I double-checked the logic: `munmap` on CPU 1 doesn't drain CPU 0's `lru_add` batch, and it also doesn't drain its own `mlock_fbatch`. This confirmed my belief that the `PG_lru` bit would never be set correctly, leading to the premature preemption warning.


104/2 2026/08/27 19:25 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:lru_add_drain PathPrefix:mm/mmap.c]

Results:
map[Output:]

105/2 2026/08/27 19:25 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 54195
							output: 28
							thoughts: 39
						

Thoughts:
**My Thought Process on Exploring `mmap.c` for Specific Functions**

Right, so my immediate task is to get a handle on how certain memory management operations are implemented within the kernel, specifically looking at the `mmap.c` file. My first impulse is to search for the function `lru_add_drain`. I'm mentally scanning through the codebase, or perhaps more accurately, I'm running a search query in my mind (or on the system). I quickly determine that `lru_add_drain` doesn't appear to be present, or at least not in a directly callable or easily discoverable way within `mm/mmap.c`. This tells me I might need to adjust my search or look elsewhere for that particular functionality, or perhaps it's part of a larger, more complex operation.

Since that avenue didn't yield immediate results, I pivot to another potential point of interest: `do_vmi_align_munmap`. My reasoning here is that `munmap` operations, particularly those that involve alignment considerations (which `vmi_align` suggests), are likely to be implemented in a core memory management file like `mmap.c`. So, my next thought is to look for this function. This is a more targeted approach, assuming that this function, if it exists, will be directly related to unmapping memory and possibly handling specific alignment requirements that could impact performance or correctness. My focus is on understanding the granular steps involved in memory unmapping, and this function name strongly suggests it's a key player in that process.


106/2 2026/08/27 19:25 tool grepper
0m Args:
map[Expression:lru_add_drain PathPrefix:mm/]

Results:
map[Output:mm/compaction.c=2562=compact_zone(struct compact_control *cc, struct capture_control *capc)
--
mm/compaction.c-2645-
mm/compaction.c:2646:	/* lru_add_drain_all could be expensive with involving other CPUs */
mm/compaction.c:2647:	lru_add_drain();
mm/compaction.c-2648-
--
mm/compaction.c-2762-			if (last_migrated_pfn < current_block_start) {
mm/compaction.c:2763:				lru_add_drain_cpu_zone(cc->zone);
mm/compaction.c-2764-				/* No more flushing until we migrate again */
--
mm/compaction.c=2959=static int compact_nodes(void)
--
mm/compaction.c-2963-	/* Flush pending updates to the LRU lists */
mm/compaction.c:2964:	lru_add_drain_all();
mm/compaction.c-2965-
--
mm/compaction.c=3024=static ssize_t compact_store(struct device *dev,
--
mm/compaction.c-3031-		/* Flush pending updates to the LRU lists */
mm/compaction.c:3032:		lru_add_drain_all();
mm/compaction.c-3033-
--
mm/fadvise.c=31=int generic_fadvise(struct file *file, loff_t offset, loff_t len, int advice)
--
mm/fadvise.c-154-			 */
mm/fadvise.c:155:			lru_add_drain();
mm/fadvise.c-156-
--
mm/fadvise.c-165-			if (nr_failed) {
mm/fadvise.c:166:				lru_add_drain_all();
mm/fadvise.c-167-				invalidate_mapping_pages(mapping, start_index,
--
mm/folio.c=655=static void lru_lazyfree(struct lruvec *lruvec, struct folio *folio)
--
mm/folio.c-685- */
mm/folio.c:686:void lru_add_drain_cpu(int cpu)
mm/folio.c-687-{
--
mm/folio.c-693-		folio_batch_move_lru(fbatch, lru_add);
mm/folio.c:694:		trace_mm_lru_add_drain_tp(cpu, nr_folios);
mm/folio.c-695-	}
--
mm/folio.c=771=void folio_mark_lazyfree(struct folio *folio)
--
mm/folio.c-780-
mm/folio.c:781:void lru_add_drain(void)
mm/folio.c-782-{
mm/folio.c-783-	local_lock(&cpu_fbatches.lock);
mm/folio.c:784:	lru_add_drain_cpu(smp_processor_id());
mm/folio.c-785-	local_unlock(&cpu_fbatches.lock);
--
mm/folio.c-790- * It's called from per-cpu workqueue context in SMP case so
mm/folio.c:791: * lru_add_drain_cpu and invalidate_bh_lrus_cpu should run on
mm/folio.c-792- * the same cpu. It shouldn't be a problem in !SMP case since
--
mm/folio.c=795=static void lru_add_and_bh_lrus_drain(void)
--
mm/folio.c-797-	local_lock(&cpu_fbatches.lock);
mm/folio.c:798:	lru_add_drain_cpu(smp_processor_id());
mm/folio.c-799-	local_unlock(&cpu_fbatches.lock);
--
mm/folio.c-803-
mm/folio.c:804:void lru_add_drain_cpu_zone(struct zone *zone)
mm/folio.c-805-{
mm/folio.c-806-	local_lock(&cpu_fbatches.lock);
mm/folio.c:807:	lru_add_drain_cpu(smp_processor_id());
mm/folio.c-808-	drain_local_pages(zone);
--
mm/folio.c-814-
mm/folio.c:815:static DEFINE_PER_CPU(struct work_struct, lru_add_drain_work);
mm/folio.c-816-
mm/folio.c:817:static void lru_add_drain_per_cpu(struct work_struct *dummy)
mm/folio.c-818-{
--
mm/folio.c=822=static bool cpu_needs_drain(unsigned int cpu)
--
mm/folio.c-843- */
mm/folio.c:844:static inline void __lru_add_drain_all(bool force_all_cpus)
mm/folio.c-845-{
--
mm/folio.c-867-
mm/folio.c:868:	trace_mm_lru_add_drain_all_tp(force_all_cpus);
mm/folio.c-869-
--
mm/folio.c-886-	/* It helps everyone if we do our own local drain immediately. */
mm/folio.c:887:	lru_add_drain();
mm/folio.c-888-
--
mm/folio.c-892-	 * (C) Exit the draining operation if a newer generation, from another
mm/folio.c:893:	 * lru_add_drain_all(), was already scheduled for draining. Check (A).
mm/folio.c-894-	 */
--
mm/folio.c-912-	 * along, adds some pages to its per-cpu vectors, then calls
mm/folio.c:913:	 * lru_add_drain_all().
mm/folio.c-914-	 *
--
mm/folio.c-923-	for_each_online_cpu(cpu) {
mm/folio.c:924:		struct work_struct *work = &per_cpu(lru_add_drain_work, cpu);
mm/folio.c-925-
mm/folio.c-926-		if (cpu_needs_drain(cpu)) {
mm/folio.c:927:			INIT_WORK(work, lru_add_drain_per_cpu);
mm/folio.c-928-			queue_work_on(cpu, mm_percpu_wq, work);
--
mm/folio.c-933-	for_each_cpu(cpu, &has_work)
mm/folio.c:934:		flush_work(&per_cpu(lru_add_drain_work, cpu));
mm/folio.c-935-
--
mm/folio.c-939-
mm/folio.c:940:void lru_add_drain_all(void)
mm/folio.c-941-{
mm/folio.c:942:	__lru_add_drain_all(false);
mm/folio.c-943-}
mm/folio.c-944-#else
mm/folio.c:945:void lru_add_drain_all(void)
mm/folio.c-946-{
mm/folio.c:947:	lru_add_drain();
mm/folio.c-948-}
--
mm/folio.c=961=void lru_cache_disable(void)
--
mm/folio.c-978-#ifdef CONFIG_SMP
mm/folio.c:979:	__lru_add_drain_all(true);
mm/folio.c-980-#else
--
mm/folio.c=1109=void __folio_batch_release(struct folio_batch *fbatch)
--
mm/folio.c-1111-	if (!fbatch->percpu_pvec_drained) {
mm/folio.c:1112:		lru_add_drain();
mm/folio.c-1113-		fbatch->percpu_pvec_drained = true;
--
mm/gup.c=1813=long populate_vma_page_range(struct vm_area_struct *vma,
--
mm/gup.c-1861-			       NULL, locked ? locked : &local_locked);
mm/gup.c:1862:	lru_add_drain();
mm/gup.c-1863-	return ret;
--
mm/gup.c=1887=long faultin_page_range(struct mm_struct *mm, unsigned long start,
--
mm/gup.c-1913-				      gup_flags);
mm/gup.c:1914:	lru_add_drain();
mm/gup.c-1915-	return ret;
--
mm/gup.c=2265=static unsigned long collect_longterm_unpinnable_folios(
--
mm/gup.c-2292-				folio_expected_ref_count(folio) + 1) {
mm/gup.c:2293:			lru_add_drain();
mm/gup.c-2294-			drained = 1;
--
mm/gup.c-2298-				folio_expected_ref_count(folio) + 1) {
mm/gup.c:2299:			lru_add_drain_all();
mm/gup.c-2300-			drained = 2;
--
mm/internal.h=64=void lru_cache_disable(void);
mm/internal.h:65:void lru_add_drain(void);
mm/internal.h:66:void lru_add_drain_cpu(int cpu);
mm/internal.h:67:void lru_add_drain_cpu_zone(struct zone *zone);
mm/internal.h-68-void folio_deactivate(struct folio *folio);
--
mm/khugepaged.c=1148=static enum scan_result __collapse_huge_page_swapin(struct mm_struct *mm,
--
mm/khugepaged.c-1229-	if (swapped_in)
mm/khugepaged.c:1230:		lru_add_drain();
mm/khugepaged.c-1231-
--
mm/khugepaged.c=2247=static enum scan_result collapse_file(struct mm_struct *mm, unsigned long addr,
--
mm/khugepaged.c-2328-				/* drain lru cache to help folio_isolate_lru() */
mm/khugepaged.c:2329:				lru_add_drain();
mm/khugepaged.c-2330-			} else if (folio_trylock(folio)) {
--
mm/khugepaged.c-2343-				/* drain lru cache to help folio_isolate_lru() */
mm/khugepaged.c:2344:				lru_add_drain();
mm/khugepaged.c-2345-				folio = filemap_lock_folio(mapping, index);
--
mm/khugepaged.c=2977=static void khugepaged_do_scan(struct collapse_control *cc)
--
mm/khugepaged.c-2983-
mm/khugepaged.c:2984:	lru_add_drain_all();
mm/khugepaged.c-2985-
--
mm/khugepaged.c=3188=int madvise_collapse(struct vm_area_struct *vma, unsigned long start,
--
mm/khugepaged.c-3216-	mmgrab(mm);
mm/khugepaged.c:3217:	lru_add_drain_all();
mm/khugepaged.c-3218-
--
mm/ksm.c=2611=static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page)
--
mm/ksm.c-2638-		 */
mm/ksm.c:2639:		lru_add_drain_all();
mm/ksm.c-2640-
--
mm/madvise.c=281=static long madvise_willneed(struct madvise_behavior *madv_behavior)
--
mm/madvise.c-292-		walk_page_range_vma(vma, start, end, &swapin_walk_ops, vma);
mm/madvise.c:293:		lru_add_drain(); /* Push any new pages onto the LRU now */
mm/madvise.c-294-		return 0;
--
mm/madvise.c-298-		shmem_swapin_range(vma, start, end, file->f_mapping);
mm/madvise.c:299:		lru_add_drain(); /* Push any new pages onto the LRU now */
mm/madvise.c-300-		return 0;
--
mm/madvise.c=595=static long madvise_cold(struct madvise_behavior *madv_behavior)
--
mm/madvise.c-602-
mm/madvise.c:603:	lru_add_drain();
mm/madvise.c-604-	tlb_gather_mmu(&tlb, madv_behavior->mm);
--
mm/madvise.c=626=static long madvise_pageout(struct madvise_behavior *madv_behavior)
--
mm/madvise.c-643-
mm/madvise.c:644:	lru_add_drain();
mm/madvise.c-645-	tlb_gather_mmu(&tlb, madv_behavior->mm);
--
mm/madvise.c=799=static int madvise_free_single_vma(struct madvise_behavior *madv_behavior)
--
mm/madvise.c-818-
mm/madvise.c:819:	lru_add_drain();
mm/madvise.c-820-	update_hiwater_rss(mm);
--
mm/memcontrol-v1.c=1835=static int mem_cgroup_force_empty(struct mem_cgroup *memcg)
--
mm/memcontrol-v1.c-1839-	/* we call try-to-free pages for make this cgroup empty */
mm/memcontrol-v1.c:1840:	lru_add_drain_all();
mm/memcontrol-v1.c-1841-
--
mm/memfd.c=38=static void memfd_tag_pins(struct xa_state *xas)
--
mm/memfd.c-42-
mm/memfd.c:43:	lru_add_drain();
mm/memfd.c-44-
--
mm/memfd.c=156=static int memfd_wait_for_pins(struct address_space *mapping)
--
mm/memfd.c-171-		if (!scan)
mm/memfd.c:172:			lru_add_drain_all();
mm/memfd.c-173-		else if (schedule_timeout_killable((HZ << scan) / 200))
--
mm/memory-failure.c=286=static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)
--
mm/memory-failure.c-314- * Unknown page type encountered. Try to check whether it can turn PageLRU by
mm/memory-failure.c:315: * lru_add_drain_all.
mm/memory-failure.c-316- */
mm/memory-failure.c=317=void shake_folio(struct folio *folio)
--
mm/memory-failure.c-327-
mm/memory-failure.c:328:	lru_add_drain_all();
mm/memory-failure.c-329-}
--
mm/memory.c=4251=static bool wp_can_reuse_anon_folio(struct folio *folio,
--
mm/memory.c-4274-		 */
mm/memory.c:4275:		lru_add_drain();
mm/memory.c-4276-	if (folio_ref_count(folio) > 1 + in_swapcache)
--
mm/migrate.c=1364=static int migrate_folio_move(free_folio_t put_new_folio, unsigned long private,
--
mm/migrate.c-1416-	if (old_folio_state & FOLIO_WAS_MLOCKED)
mm/migrate.c:1417:		lru_add_drain();
mm/migrate.c-1418-
--
mm/migrate_device.c=571=static unsigned long migrate_device_unmap(unsigned long *src_pfns,
--
mm/migrate_device.c-580-
mm/migrate_device.c:581:	lru_add_drain();
mm/migrate_device.c-582-
--
mm/migrate_device.c-604-				/* Drain CPU's lru cache */
mm/migrate_device.c:605:				lru_add_drain_all();
mm/migrate_device.c-606-				allow_drain = false;
--
mm/mlock.c=423=static void mlock_vma_pages_range(struct vm_area_struct *vma,
--
mm/mlock.c-447-
mm/mlock.c:448:	lru_add_drain();
mm/mlock.c-449-	walk_page_range_vma(vma, start, end, &mlock_walk_ops, NULL);
mm/mlock.c:450:	lru_add_drain();
mm/mlock.c-451-
--
mm/page_alloc.c=6463=static int page_alloc_cpu_dead(unsigned int cpu)
--
mm/page_alloc.c-6466-
mm/page_alloc.c:6467:	lru_add_drain_cpu(cpu);
mm/page_alloc.c-6468-	mlock_drain_remote(cpu);
--
mm/vmscan.c=1979=static unsigned long shrink_inactive_list(unsigned long nr_to_scan,
--
mm/vmscan.c-2005-
mm/vmscan.c:2006:	lru_add_drain();
mm/vmscan.c-2007-
--
mm/vmscan.c=2061=static void shrink_active_list(unsigned long nr_to_scan,
--
mm/vmscan.c-2076-
mm/vmscan.c:2077:	lru_add_drain();
mm/vmscan.c-2078-
--
mm/vmscan.c=5136=static void lru_gen_shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
--
mm/vmscan.c-5142-
mm/vmscan.c:5143:	lru_add_drain();
mm/vmscan.c-5144-
--
mm/vmscan.c=5157=static void lru_gen_shrink_node(struct pglist_data *pgdat, struct scan_control *sc)
--
mm/vmscan.c-5171-
mm/vmscan.c:5172:	lru_add_drain();
mm/vmscan.c-5173-
--
mm/vmscan.c=7886=int user_proactive_reclaim(char *buf,
--
mm/vmscan.c-7950-		if (!nr_retries)
mm/vmscan.c:7951:			lru_add_drain_all();
mm/vmscan.c-7952-
]

107/2 2026/08/27 19:25 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 59494
							output: 34
							thoughts: 3417
						

Thoughts:
**The Race Condition in `munlock_folio` and `__zone_stat_mod_folio`**

I've been investigating a subtle race condition that can occur within the kernel's memory management subsystem, specifically involving the `mlock` and `munmap` operations and how they interact with the LRU (Least Recently Used) page lists. My primary goal has been to find a reliable way to trigger a scenario where a page is considered "not on the LRU" when it shouldn't be, leading to an incorrect update of memory statistics.

My thought process initially centered on the observation that `munmap` doesn't seem to directly call `lru_add_drain()`. This immediately suggested that there might be an opportunity for a race. The core of the problem, as I understand it, lies in the functions `__munlock_folio` and `__zone_stat_mod_folio`. The warning condition highlights a specific scenario: `CONFIG_PREEMPT_COUNT` and `__lockdep_enabled` are active, and importantly, `preempt_count() == 0` and `hardirqs_enabled` are true. This is the state that allows `__zone_stat_mod_folio` to be called without proper preemption protection, especially when it encounters a folio that isn't cleared from the LRU as expected.

To demonstrate this, I've constructed a C reproducer. The strategy is to create two threads and carefully orchestrate their execution across different CPUs.

*   **Thread 0 (CPU 0):** This thread is responsible for "faulting in" a page into memory. By pinning it to CPU 0 and making it touch the page (`*(volatile char *)addr = 1;`), I ensure that this page is initially added to CPU 0's per-CPU `lru_add` batch. To prevent this batch from being drained prematurely, I have Thread 0 enter a busy-wait loop, effectively holding onto the page in its batch.

*   **Thread 1 (CPU 1):** This thread is designed to interact with the page after Thread 0 has prepared it. It first waits for Thread 0 to complete its initial step. Then, it performs an `mlock` operation on the page. The crucial point here is that `mlock` on CPU 1 will trigger `lru_add_drain()` on CPU 1. However, since the page is in Thread 0's `lru_add` batch on CPU 0, it's not yet on CPU 1's LRU list. `mlock_folio` will add the page to CPU 1's `mlock_fbatch` with the `LRU_FOLIO` flag, and then `lru_add_drain()` on CPU 1 will attempt to drain this batch. Because the page is not actually on the LRU list (it's in the `lru_add` batch on CPU 0), `__mlock_folio` sees this and does nothing with respect to the LRU.

    Next, Thread 1 calls `munmap` on the page. This operation calls `munlock_vma_folio`, which in turn calls `munlock_folio`. `munlock_folio` adds the page to CPU 1's `mlock_fbatch`, but importantly, *without* the `LRU_FOLIO` flag. Critically, `munmap` *does not* drain the `mlock_fbatch`. This leaves the page in a state where it was recently part of an `mlock` operation but is no longer marked with `LRU_FOLIO`.

The race is triggered when CPU 1 is taken offline. The `page_alloc_cpu_dead` callback, executed on a *surviving* CPU, eventually leads to `mlock_drain_remote`. This function, under certain conditions (preemption and interrupts enabled), calls `__munlock_folio`. At this point, the page is in the `mlock_fbatch` on CPU 1, and it's *not* on the LRU. The `__munlock_folio` function attempts to clear the LRU flag using `folio_test_clear_lru(folio)`. Since the flag isn't set (as expected), this function returns true, and the subsequent call to `__zone_stat_mod_folio` updates the statistics *as if* the page had just been removed from the LRU, even though it was never properly added or was removed in a way that bypasses the standard LRU management.

I've carefully considered alternative scenarios:

*   **`mlock` permissions and speed:** I've assumed root privileges for `mlock` and reasoned that pinning Thread 0 to CPU 0 and having it spin effectively prevents other processes from interfering with its `lru_add` batch being drained by other means.
*   **`mlock` calling `lru_add_drain_all()`:** My checks indicate that `mlock_vma_pages_range` calls `lru_add_drain()`, not `lru_add_drain_all()`, so it only affects the local CPU.
*   **Page freeing during `munmap`:** The `munlock_folio` function takes a reference to the folio before adding it to `mlock_fbatch`, ensuring the page isn't freed prematurely.
*   **`munmap` calling `lru_add_drain()`:** I've confirmed that `munmap`'s path involving `tlb_finish_mmu` and `free_pages_and_swap_cache` does not call `lru_add_drain()`.
*   **`mlock_drain_remote` not being called on CPU 1:** `mlock_drain_remote` is called by a surviving CPU when another CPU goes offline, meaning it's not executed on the dying CPU itself.

I also explored using `madvise(MADV_PAGEOUT)` as an alternative way to isolate a page, but this approach seemed more complex and less deterministic than the `lru_add` batch method, especially since `madvise(MADV_PAGEOUT)` can reclaim the page if not handled carefully.

Therefore, the `lru_add` batch isolation combined with CPU offline appears to be the most elegant and reliable way to expose this specific race condition. The reproducer I've developed aims to create this precise sequence of events to trigger the incorrect statistic update.


108/2 2026/08/27 19:26 tool grepper
0m Args:
map[Expression:SYSCALL_DEFINE.*mlock PathPrefix:mm/mlock.c]

Results:
map[Output:mm/mlock.c=619=static __must_check int do_mlock(unsigned long start, size_t len,
--
mm/mlock.c-666-
mm/mlock.c:667:SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len)
mm/mlock.c-668-{
--
mm/mlock.c-673-
mm/mlock.c:674:SYSCALL_DEFINE3(mlock2, unsigned long, start, size_t, len, int, flags)
mm/mlock.c-675-{
--
mm/mlock.c=716=static int apply_mlockall_flags(int flags)
--
mm/mlock.c-757-
mm/mlock.c:758:SYSCALL_DEFINE1(mlockall, int, flags)
mm/mlock.c-759-{
]

109/2 2026/08/27 19:26 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 63176
							output: 34
							thoughts: 10
						

Thoughts:
**My Thought Process on `do_mlock`**

Alright, so my immediate thought is to dive into the `do_mlock` function. I need to understand its purpose and how it's implemented. My expertise in this area tells me this is likely related to memory locking, which is a critical performance and security consideration.

My first step is to examine its definition. I'm looking for its signature, what arguments it takes, and what it returns. This will give me a fundamental understanding of its interface and how I might interact with it.

Then, I'll trace the execution flow. Where is `do_mlock` called from? What are the conditions that lead to its invocation? Understanding the context in which it operates is crucial for grasping its full impact.

I'll pay close attention to the actual operations within `do_mlock`. What system calls is it making? Is it using `mlock()`, `mlockall()`, or perhaps a custom implementation? The specifics of these operations will reveal its intended behavior regarding memory protection and availability.

Furthermore, I'm curious about the implications. What are the potential benefits of using `do_mlock`? I'm thinking about reduced page faulting, improved real-time performance, and preventing sensitive data from being swapped out. Conversely, what are the potential downsides? I'll consider memory fragmentation, increased resource consumption, and potential deadlocks if not managed carefully.

Finally, I'll be looking for any error handling or edge case considerations. How does `do_mlock` behave when memory is unavailable, or when permissions are insufficient? Robustness is paramount, and understanding its failure modes is as important as understanding its success path.


110/2 2026/08/27 19:26 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:615 LineCount:40]

Results:
map[Contents: 615:			retval = -EAGAIN;
 616:		return retval;
 617:	}
 618:	
 619:	static __must_check int do_mlock(unsigned long start, size_t len,
 620:					 vma_flags_t *flags)
 621:	{
 622:		unsigned long locked;
 623:		unsigned long lock_limit;
 624:		int error = -ENOMEM;
 625:	
 626:		start = untagged_addr(start);
 627:	
 628:		if (!can_do_mlock())
 629:			return -EPERM;
 630:	
 631:		len = PAGE_ALIGN(len + (offset_in_page(start)));
 632:		start &= PAGE_MASK;
 633:	
 634:		lock_limit = rlimit(RLIMIT_MEMLOCK);
 635:		lock_limit >>= PAGE_SHIFT;
 636:		locked = len >> PAGE_SHIFT;
 637:	
 638:		if (mmap_write_lock_killable(current->mm))
 639:			return -EINTR;
 640:	
 641:		locked += current->mm->locked_vm;
 642:		if ((locked > lock_limit) && (!capable(CAP_IPC_LOCK))) {
 643:			/*
 644:			 * It is possible that the regions requested intersect with
 645:			 * previously mlocked areas, that part area in "mm->locked_vm"
 646:			 * should not be counted to new mlock increment count. So check
 647:			 * and adjust locked count if necessary.
 648:			 */
 649:			locked -= count_mm_mlocked_page_nr(current->mm,
 650:					start, len);
 651:		}
 652:	
 653:		/* check against resource limits */
 654:		if ((locked <= lock_limit) || capable(CAP_IPC_LOCK))
]

111/2 2026/08/27 19:26 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 63779
							output: 34
							thoughts: 13
						

Thoughts:
**My Internal Monologue on `do_mlock`**

Alright, I need to deep-dive into the `do_mlock` function. I want to understand its inner workings completely, so I'm going to meticulously examine every line of code. My goal here isn't just to see *what* it does, but to grasp the *why* behind each decision and implementation detail. I'm looking for potential edge cases, any subtle behaviors that might not be immediately obvious, and, of course, any areas that could be optimized for performance or robustness. Given my expertise, I expect to encounter well-reasoned code, but I'm not going to assume anything. I'll be scrutinizing the system calls it makes, how it handles memory, and its interaction with the kernel's memory management subsystems. Essentially, I'm performing a thorough, expert-level code review of this specific function, aiming for a comprehensive and nuanced understanding.


112/2 2026/08/27 19:26 tool read-file
0m Args:
map[File:mm/mlock.c FirstLine:655 LineCount:20]

Results:
map[Contents: 655:			error = apply_vma_lock_flags(start, len, flags);
 656:	
 657:		mmap_write_unlock(current->mm);
 658:		if (error)
 659:			return error;
 660:	
 661:		error = __mm_populate(start, len, 0);
 662:		if (error)
 663:			return __mlock_posix_error_return(error);
 664:		return 0;
 665:	}
 666:	
 667:	SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len)
 668:	{
 669:		vma_flags_t flags = mk_vma_flags(VMA_LOCKED_BIT);
 670:	
 671:		return do_mlock(start, len, &flags);
 672:	}
 673:	
 674:	SYSCALL_DEFINE3(mlock2, unsigned long, start, size_t, len, int, flags)
]

113/2 2026/08/27 19:26 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 64120
							output: 33
							thoughts: 2276
						

Thoughts:
**My Thought Process on Reproducing a Kernel Bug via CPU Hotplug and MLOCK Interaction**

This entire exercise has been about meticulously tracing the kernel's memory management and locking mechanisms to construct a reliable reproducer for a subtle bug. I've been wrestling with the sequence of operations in `do_mlock`, its internal calls, and how page faults, LRU batching, and CPU hotplug interact.

My initial exploration led me through the call chain: `do_mlock` -> `apply_vma_lock_flags` -> `mlock_fixup` -> `mlock_vma_pages_range`. I then observed that `__mm_populate(start, len, 0)` was invoked, which in turn calls `populate_vma_page_range` and then `faultin_page_range`. Crucially, I noticed that `faultin_page_range` calls `lru_add_drain()`, but *not* `lru_add_drain_all()`. This was a key observation: individual CPUs manage their own `lru_add` batches, and only specific scenarios trigger a global drain.

The core of my hypothesis revolves around page faulting and its timing relative to `mlock`. If `__mm_populate` were to fault a page in on CPU 1, that page would end up in CPU 1's `lru_add` batch. When `lru_add_drain()` on CPU 1 is called, it would then be placed on the LRU list. My goal was to *prevent* this on CPU 1 and instead ensure the page was already faulted in on CPU 0.

This led me to the strategy:
1.  **Thread 0 (CPU 0):** Must fault the page *before* `mlock` is called. I envisioned this by having Thread 0 write to the memory region, thus triggering a page fault on CPU 0.
2.  **Thread 0:** Signals Thread 1 after the page is faulted in.
3.  **Thread 1 (CPU 1):** Calls `mlock`. Now, `__mm_populate` (called by `mlock`) would find the page already present and perform no further faulting.

However, I realized I had the order of operations slightly wrong. `mlock_vma_pages_range` is called *before* `__mm_populate`. My refined understanding is:
*   `mlock_vma_pages_range` walks the page tables and finds the page already faulted in by CPU 0.
*   It calls `mlock_folio`.
*   Crucially, `mlock_vma_pages_range` then calls `lru_add_drain()` on CPU 1.
*   *Then*, `do_mlock` calls `__mm_populate`.
*   `__mm_populate` finds the page is already present and does nothing.
*   And it again calls `lru_add_drain()` on CPU 1.

This sequence, I believe, *preserves* the page in CPU 0's `lru_add` batch. This is precisely what I want.

The next critical question was about the `mlock` operation itself: could `mlock_folio` add the page to CPU 1's `mlock_fbatch` and then `lru_add_drain()` on CPU 1 drain it, leading `__mlock_folio` to see it's not on the LRU and do nothing? This was a crucial point of doubt. I traced this further:
*   `__mlock_folio` checks `folio_test_clear_lru(folio)`.
*   If the page is in CPU 0's `lru_add` batch, it *does not* yet have the `PG_lru` bit set.
*   Therefore, `folio_test_clear_lru` returns `FALSE`.
*   `__mlock_folio` then returns the `lruvec` without incrementing the `mlock_count`. This means the page is *not* properly locked, even though the VMA has `VM_LOCKED`.

This leads to a problematic scenario when `munmap` is called:
*   `munmap` calls `munlock_vma_folio`.
*   It checks `vma->vm_flags & VM_LOCKED`, which is `TRUE`.
*   It calls `munlock_folio`.
*   `munlock_folio` adds the page to CPU 1's `mlock_fbatch` *without* any flags.
*   Then `munmap` returns.

The real problem surfaces when CPU 1 is offlined:
*   The `page_alloc_cpu_dead` callback is invoked by the CPU hotplug mechanism. This callback, running on a *surviving* CPU (likely CPU 0 or another available CPU), calls `mlock_drain_remote(1)`.
*   `mlock_drain_remote(1)` calls `__munlock_folio` for pages in CPU 1's `mlock_fbatch`.
*   Inside `__munlock_folio`, `folio_test_clear_lru` is called again. Since the page is still in CPU 0's `lru_add` batch and not on the LRU, this returns `FALSE`.
*   The code then proceeds to call `__zone_stat_mod_folio` with preemption enabled. This is the point where the kernel warning is triggered because we are attempting to modify zone statistics with preemption on, which is an invalid state.

This detailed breakdown confirms my reproducer strategy. The key is to have the page faulted on CPU 0, leading to its presence in CPU 0's `lru_add` batch, while the `mlock` and subsequent `munmap` operations are handled by CPU 1. The offline of CPU 1 then forces a remote drain of CPU 1's `mlock_fbatch`, leading to the race condition and the kernel warning.

Regarding practicalities:
*   **RLIMITs:** I've considered `mlock` failures due to resource limits. Running as root or using `mlock2`/`MAP_LOCKED` are alternatives, but `MAP_LOCKED` itself faults the page on CPU 1, which defeats my objective. So, `mlock` on a pre-faulted page on CPU 0 is the precise mechanism.
*   **LRU Batch Drainage:** To minimize the window for CPU 0's `lru_add` batch being drained by timers or other interrupts, Thread 0 can simply spin. While a loop within a loop might be needed for absolute certainty, this is typically sufficient for a reproducer.
*   **`mlock_drain_remote` Execution:** I've analyzed that the CPU hotplug callback (`page_alloc_cpu_dead`) will execute `mlock_drain_remote(1)` on a surviving CPU, which is where the issue will manifest. The critical part is that `_cpu_down` or `cpuhp_invoke_callback` *do not* call `lru_add_drain_all()`, thus preserving the separate `lru_add` batches across CPUs.

My C program is designed to orchestrate these precise timing and CPU pinning requirements to expose this race condition. The strategy appears robust.


114/2 2026/08/27 19:27 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:lru_add_drain_all PathPrefix:kernel/cpu.c]

Results:
map[Output:]

115/2 2026/08/27 19:27 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 66427
							output: 31
							thoughts: 17
						

Thoughts:
**My Thought Process on CPU Hotplug Callbacks in `mm/folio.c`**

Alright, my immediate objective here is to dive into the heart of memory management, specifically within the `mm/folio.c` file, and meticulously examine its CPU hotplug callback mechanisms. I need to understand precisely how the system reacts and adapts when CPUs are brought online or taken offline, and what specific functions within this file are responsible for managing these transitions from a memory management perspective. This isn't just about a superficial glance; I'm looking for the granular details of how memory pages, or "folios" as they're referred to here, are handled during these dynamic CPU state changes. My expectation is to find registration points for these callbacks and then trace the execution flow to understand what memory-related operations are triggered. I'm particularly interested in any potential race conditions or synchronization challenges that might arise during hotplug events and how `mm/folio.c` is designed to mitigate them. This deep dive is crucial for ensuring the robustness and efficiency of our memory management subsystem under dynamic hardware configurations.


116/2 2026/08/27 19:27 tool grepper
0m Args:
map[Expression:lru_add_drain PathPrefix:mm/folio.c]

Results:
map[Output:mm/folio.c=655=static void lru_lazyfree(struct lruvec *lruvec, struct folio *folio)
--
mm/folio.c-685- */
mm/folio.c:686:void lru_add_drain_cpu(int cpu)
mm/folio.c-687-{
--
mm/folio.c-693-		folio_batch_move_lru(fbatch, lru_add);
mm/folio.c:694:		trace_mm_lru_add_drain_tp(cpu, nr_folios);
mm/folio.c-695-	}
--
mm/folio.c=771=void folio_mark_lazyfree(struct folio *folio)
--
mm/folio.c-780-
mm/folio.c:781:void lru_add_drain(void)
mm/folio.c-782-{
mm/folio.c-783-	local_lock(&cpu_fbatches.lock);
mm/folio.c:784:	lru_add_drain_cpu(smp_processor_id());
mm/folio.c-785-	local_unlock(&cpu_fbatches.lock);
--
mm/folio.c-790- * It's called from per-cpu workqueue context in SMP case so
mm/folio.c:791: * lru_add_drain_cpu and invalidate_bh_lrus_cpu should run on
mm/folio.c-792- * the same cpu. It shouldn't be a problem in !SMP case since
--
mm/folio.c=795=static void lru_add_and_bh_lrus_drain(void)
--
mm/folio.c-797-	local_lock(&cpu_fbatches.lock);
mm/folio.c:798:	lru_add_drain_cpu(smp_processor_id());
mm/folio.c-799-	local_unlock(&cpu_fbatches.lock);
--
mm/folio.c-803-
mm/folio.c:804:void lru_add_drain_cpu_zone(struct zone *zone)
mm/folio.c-805-{
mm/folio.c-806-	local_lock(&cpu_fbatches.lock);
mm/folio.c:807:	lru_add_drain_cpu(smp_processor_id());
mm/folio.c-808-	drain_local_pages(zone);
--
mm/folio.c-814-
mm/folio.c:815:static DEFINE_PER_CPU(struct work_struct, lru_add_drain_work);
mm/folio.c-816-
mm/folio.c:817:static void lru_add_drain_per_cpu(struct work_struct *dummy)
mm/folio.c-818-{
--
mm/folio.c=822=static bool cpu_needs_drain(unsigned int cpu)
--
mm/folio.c-843- */
mm/folio.c:844:static inline void __lru_add_drain_all(bool force_all_cpus)
mm/folio.c-845-{
--
mm/folio.c-867-
mm/folio.c:868:	trace_mm_lru_add_drain_all_tp(force_all_cpus);
mm/folio.c-869-
--
mm/folio.c-886-	/* It helps everyone if we do our own local drain immediately. */
mm/folio.c:887:	lru_add_drain();
mm/folio.c-888-
--
mm/folio.c-892-	 * (C) Exit the draining operation if a newer generation, from another
mm/folio.c:893:	 * lru_add_drain_all(), was already scheduled for draining. Check (A).
mm/folio.c-894-	 */
--
mm/folio.c-912-	 * along, adds some pages to its per-cpu vectors, then calls
mm/folio.c:913:	 * lru_add_drain_all().
mm/folio.c-914-	 *
--
mm/folio.c-923-	for_each_online_cpu(cpu) {
mm/folio.c:924:		struct work_struct *work = &per_cpu(lru_add_drain_work, cpu);
mm/folio.c-925-
mm/folio.c-926-		if (cpu_needs_drain(cpu)) {
mm/folio.c:927:			INIT_WORK(work, lru_add_drain_per_cpu);
mm/folio.c-928-			queue_work_on(cpu, mm_percpu_wq, work);
--
mm/folio.c-933-	for_each_cpu(cpu, &has_work)
mm/folio.c:934:		flush_work(&per_cpu(lru_add_drain_work, cpu));
mm/folio.c-935-
--
mm/folio.c-939-
mm/folio.c:940:void lru_add_drain_all(void)
mm/folio.c-941-{
mm/folio.c:942:	__lru_add_drain_all(false);
mm/folio.c-943-}
mm/folio.c-944-#else
mm/folio.c:945:void lru_add_drain_all(void)
mm/folio.c-946-{
mm/folio.c:947:	lru_add_drain();
mm/folio.c-948-}
--
mm/folio.c=961=void lru_cache_disable(void)
--
mm/folio.c-978-#ifdef CONFIG_SMP
mm/folio.c:979:	__lru_add_drain_all(true);
mm/folio.c-980-#else
--
mm/folio.c=1109=void __folio_batch_release(struct folio_batch *fbatch)
--
mm/folio.c-1111-	if (!fbatch->percpu_pvec_drained) {
mm/folio.c:1112:		lru_add_drain();
mm/folio.c-1113-		fbatch->percpu_pvec_drained = true;
]

117/2 2026/08/27 19:27 llm initial-researcher
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 68089
							output: 1678
							thoughts: 1567
						

Thoughts:
**The Kernel Race Condition Explained: An Expert's Reflection**

Alright, let's break down this intricate kernel bug. My thought process has been a journey through the labyrinthine world of page allocation, LRU management, and CPU hotplugging. I've zeroed in on a specific interaction that, under the right circumstances, triggers an unfortunate `__mod_zone_page_state` warning due to preemption being enabled.

The core of the issue, as I've pieced it together, lies in how the kernel handles pages when a CPU goes offline. When `page_alloc_cpu_dead` is invoked for a dying CPU, it calls `lru_add_drain_cpu` on that specific CPU. Crucially, it *doesn't* drain the `lru_add` batch of any *surviving* CPU. This is the key insight. If a page is "stuck" in a surviving CPU's `lru_add` batch and hasn't yet made it onto the global LRU list, it remains in this limbo.

My reproducer is designed to exploit this exact scenario. Here's how it unfolds in my mind, step by step:

1.  **Thread 0's Initial Fault:** I envision a thread (let's call it Thread 0) faulting in a page. This action, occurring on CPU 0, adds the page to CPU 0's `lru_add` batch. At this point, the page isn't yet formally on the LRU list of any zone; it's just queued up on the CPU-local batch.

2.  **Thread 1's `mlock` Attempt:** Next, I have another thread (Thread 1) operating on CPU 1. This thread attempts to `mlock` the very same page. The `mlock` operation, when processing the page on CPU 1, adds it to CPU 1's `mlock_fbatch` with the `LRU_FOLIO` flag. Following this, `mlock` triggers a drain of CPU 1's batch. During this drain, `__mlock_folio` is called. It checks if the page is on the LRU list. Since the page is still languishing in CPU 0's `lru_add` batch, it's *not* on any LRU list, so `__mlock_folio` does nothing further with it in terms of LRU management.

3.  **Thread 1's `munmap`:** The plot thickens with `munmap`. Because the Virtual Memory Area (VMA) associated with this page is locked (due to the prior `mlock`), `munmap` delegates to `munlock_vma_folio`. This function adds the page to CPU 1's `mlock_fbatch`, but this time, it's *without* any flags like `LRU_FOLIO`. Importantly, `munmap` itself does *not* initiate a drain of this `mlock_fbatch`.

4.  **CPU 1 Goes Offline:** The critical event then occurs: the main thread orchestrates the offline process for CPU 1. This is where the kernel's CPU hotplug logic kicks in.

5.  **The Survivors React:** The surviving CPU (in my setup, CPU 0) will eventually execute `page_alloc_cpu_dead(1)` as part of the CPU offline sequence. This function, as I noted, calls `mlock_drain_remote(1)`. This is the crucial point where we interact with the *dead* CPU's state from a *surviving* CPU's perspective.

6.  **`mlock_drain_remote` and `__munlock_folio`:** `mlock_drain_remote` processes CPU 1's `mlock_fbatch`. It calls `__munlock_folio` for the page. Again, `__munlock_folio` checks if the page is on the LRU list. Because the page is still in CPU 0's `lru_add` batch and never made it to the LRU list, `__munlock_folio` discovers it's not there.

7.  **The Preemption Problem:** Here's the rub: when `__munlock_folio` finds the page is not on the LRU list, it bypasses the acquisition of the LRU lock altogether. Instead, it proceeds directly to call `__zone_stat_mod_folio`. And critically, this call happens with preemption *enabled*.

8.  **The Warning Ignored:** Finally, `__zone_stat_mod_folio` invokes `__mod_zone_page_state`. Because preemption is still enabled at this point, the kernel detects a potential race condition (or rather, a violation of its own rules about modifying zone statistics without disabling preemption) and emits the warning.

So, in essence, the bug isn't about the `lru_add` batch itself being undrained on the surviving CPU. It's about a page being in that undrained state, combined with operations on a dying CPU that lead to `__munlock_folio` being called on a *surviving* CPU, which then incorrectly bypasses LRU locking and triggers the preemption-sensitive zone state modification. The reproducer precisely orchestrates this sequence of events, leading to a clean and concise demonstration of the problem.


118/1 2026/08/27 19:28 loop
20m
119/2 2026/08/27 19:28 iteration 0
4m
120/3 2026/08/27 19:28 action If
0m Args:
map[OracleFeedback:]

121/3 2026/08/27 19:28 action merge-strategy
0m Results:
map[CurrentReproStrategy:### Bug Analysis

The warning `WARNING in __mod_zone_page_state` is triggered because `__mod_zone_page_state()` expects preemption (or interrupts) to be disabled when updating per-CPU vmstat counters, but it is called with preemption enabled.

The call trace shows this happens during CPU offline:
1. `_cpu_down()` invokes the CPU hotplug callback `page_alloc_cpu_dead()` on a **surviving** CPU with preemption enabled.
2. `page_alloc_cpu_dead()` calls `mlock_drain_remote(cpu)` to drain the dead CPU's `mlock_fbatch`.
3. `mlock_drain_remote()` calls `mlock_folio_batch()` without disabling preemption.
4. `mlock_folio_batch()` processes a folio added via `munlock_folio()` and calls `__munlock_folio()`.
5. `__munlock_folio()` checks if the folio is on the LRU list via `folio_test_clear_lru()`. If it is, it locks the LRU lock (which disables interrupts) and proceeds safely.
6. However, if the folio is **not** on the LRU list, `folio_test_clear_lru()` returns false. `__munlock_folio()` skips taking the LRU lock and jumps directly to `munlock:`, calling `__zone_stat_mod_folio()` with preemption still enabled, triggering the warning.

To reproduce this, we need a folio that is added to `mlock_fbatch` via `munlock_folio()`, but is **not** on the LRU list when `mlock_drain_remote()` processes it. We can achieve this by exploiting the per-CPU `lru_add` batch:
1. **Thread 0 (CPU 0)** faults in a new page. The page is added to CPU 0's `lru_add` batch, but is not yet on the actual LRU list. Thread 0 then spins to prevent its batch from draining.
2. **Thread 1 (CPU 1)** calls `mlock()` on the page. `mlock()` adds the page to CPU 1's `mlock_fbatch` and drains it. `__mlock_folio()` sees the page is not on the LRU list and does nothing.
3. **Thread 1 (CPU 1)** calls `munmap()`. Since the VMA is locked, `munmap()` calls `munlock_vma_folio()`, which adds the page to CPU 1's `mlock_fbatch` with NO flags. `munmap()` does not drain the batch.
4. **Main Thread** offlines CPU 1. A surviving CPU executes `mlock_drain_remote(1)`, processes the folio, sees it's still not on the LRU list (still in CPU 0's batch), and calls `__zone_stat_mod_folio()` with preemption enabled.

### Minimal C Reproducer

```c
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <sched.h>
#include <string.h>

volatile int step = 0;
void *addr;

void pin_to_cpu(int cpu) {
    cpu_set_t set;
    CPU_ZERO(&set);
    CPU_SET(cpu, &set);
    if (sched_setaffinity(0, sizeof(set), &set) < 0) {
        perror("sched_setaffinity");
        exit(1);
    }
}

void *thread0(void *arg) {
    pin_to_cpu(0);
    
    while (step != 1) {}
    
    // Fault in the page on CPU 0.
    // It gets added to CPU 0's lru_add batch, but not yet on the LRU list.
    *(volatile char *)addr = 1;
    
    step = 2;
    
    // Spin to prevent CPU 0 from draining its lru_add batch.
    while (step != 5) {}
    
    return NULL;
}

void *thread1(void *arg) {
    pin_to_cpu(1);
    
    while (step != 2) {}
    
    // mlock the page on CPU 1.
    // It adds the page to CPU 1's mlock_fbatch with LRU_FOLIO, then drains it.
    // __mlock_folio sees the page is not on LRU (still in CPU 0's batch) and does nothing.
    if (mlock(addr, 4096) < 0) {
        perror("mlock");
    }
    
    // munmap the page on CPU 1.
    // Since the VMA is locked, it calls munlock_vma_folio, which adds the page
    // to CPU 1's mlock_fbatch with NO flags. munmap does not drain the batch.
    munmap(addr, 4096);
    
    step = 3;
    
    // Spin until this CPU goes offline.
    while (1) {}
    
    return NULL;
}

int main() {
    // Ensure CPU 1 is online initially.
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "1\n", 2);
        close(fd);
    }
    
    addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    if (addr == MAP_FAILED) {
        perror("mmap");
        return 1;
    }
    
    pthread_t t0, t1;
    pthread_create(&t0, NULL, thread0, NULL);
    pthread_create(&t1, NULL, thread1, NULL);
    
    step = 1;
    
    while (step != 3) {}
    
    // Offline CPU 1.
    // This triggers page_alloc_cpu_dead -> mlock_drain_remote on a surviving CPU.
    // mlock_drain_remote calls __munlock_folio, which sees the page is not on LRU,
    // skips taking the LRU lock, and calls __zone_stat_mod_folio with preemption enabled,
    // triggering the warning.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "0\n", 2);
        close(fd);
    }
    
    step = 5;
    pthread_join(t0, NULL);
    
    // Restore CPU 1.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "1\n", 2);
        close(fd);
    }
    
    return 0;
}
```]

122/3 2026/08/27 19:28 agent repro-generator
0m Model:
deep-reasoning

Results:
map[IsProbe:true RawCandidateReproC:#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

int main() {
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_RDWR);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] Successfully opened /sys/devices/system/cpu/cpu1/online.\n");
    
    char buf[2];
    int res = read(fd, buf, 1);
    if (res < 0) {
        printf("[-] Failed to read from /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] Successfully read from /sys/devices/system/cpu/cpu1/online.\n");
    
    close(fd);
    return 0;
}
]

Instruction:
You are a security researcher with deep Linux kernel background.
Your goal is to generate a minimal, standalone C program for the strictly defensive
purpose of verifying a bugfix in an isolated environment.

To ensure that we can diagnose why a program might fail to run on the test environment,
you MUST include detailed logging and error checking in the generated C program:
1. Use 'printf(...)' for all progress messages and error logs.
2. Every system call (e.g., socket, bind, listen, connect, ioctl, send) must check for a failure return value.
3. If a call fails, it must print a specific error message including the function name
   and the error string (use strerror(errno)), and then exit with a non-zero status.
4. The program must print a message after every successful major step.
5. Generate code that follows this pattern for all operations:
    int res = do_something();
    if (res < 0) {
        printf("[-] Failed to do_something: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] do_something successful.\n");
6. The compilation and development environment (including compilers, build
   systems, makefiles, and kernel build/header directories) is NOT available
   on the target test VM guest. Do NOT check for, build, or reference any
   compilation tools, build files, or kernel development directories.
7. Do NOT execute shell commands or run external binaries (e.g. by using
   functions like 'system()', 'popen()', or the 'exec' family such as
   'execve()'). All environment checks, capability probings, and reproduction
   steps must be performed directly using standard Linux system calls (such
   as 'open', 'socket', 'ioctl', 'stat', etc.).
8. When reproducing asynchronous kernel timeouts or warnings, always
   include a sufficient delay (using sleep or similar) after deleting
   or unregistering the device to allow the kernel's asynchronous
   timeout to trigger before program exit.


=== PHASE 1: CAPABILITY PROBING (GENERATION) ===
You MUST start by generating a simple 'probe' program first. This is a strict, non-negotiable requirement
to verify that the test environment has the necessary kernel capabilities and privileges.
This program's sole purpose is to verify subsystem availability and privileges by probing specific
device files, subsystems, or syscalls (for example: opening /dev/vhci to check if the virtual
Bluetooth controller is accessible, loading a minimal dummy BPF program, or making a specific
socket/ioctl call).

Print clear messages indicating success or failure of these probes, and exit with 0 only if
all checks pass.
Do NOT attempt complex logic, and do NOT try to trigger the actual bug/crash in this first version,
regardless of how simple the reproducer seems. You must wait until a successful probe run has been
confirmed in the environment (i.e., when CapabilitiesVerified becomes true).

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:
Bug Description: WARNING in __mod_zone_page_state

smpboot: CPU 1 is now offline
------------[ cut here ]------------
IS_ENABLED(CONFIG_PREEMPT_COUNT) && __lockdep_enabled && (preempt_count() == 0 && this_cpu_read(hardirqs_enabled))
WARNING: mm/vmstat.c:361 at __mod_zone_page_state+0x96/0x190 mm/vmstat.c:361, CPU#0: syz.0.301/7156
Modules linked in:
CPU: 0 UID: 0 PID: 7156 Comm: syz.0.301 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__mod_zone_page_state+0x96/0x190 mm/vmstat.c:361
Code: d0 00 00 00 8b 05 7e 0b ed 0e 85 c0 74 1f 65 8b 05 e7 56 32 12 65 0b 05 30 10 32 12 75 0f 65 8b 05 33 52 32 12 85 c0 74 04 90 <0f> 0b 90 48 c7 c7 40 e3 ff 8b e8 9b 69 71 09 65 48 0f be 5d 00 48
RSP: 0000:ffffc900033ef8c0 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000000 RCX: 1ffffffff2289b6c
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88807ffd69b8
RBP: ffffffff948bfd88 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffffffffffffffff
R13: 0000000000000008 R14: ffff88807ffd6940 R15: ffffffff948bfd80
FS:  0000000000000000(0000) GS:ffff888096982000(0063) knlGS:00000000f5486b40
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000f5453ff4 CR3: 0000000053822000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 __zone_stat_mod_folio include/linux/vmstat.h:410 [inline]
 __munlock_folio mm/mlock.c:144 [inline]
 mlock_folio_batch+0xf97/0x36e0 mm/mlock.c:204
 mlock_drain_remote+0xe5/0x140 mm/mlock.c:230
 page_alloc_cpu_dead+0x16/0x130 mm/page_alloc.c:6468
 cpuhp_invoke_callback+0x3b4/0x9a0 kernel/cpu.c:194
 __cpuhp_invoke_callback_range+0x158/0x1d0 kernel/cpu.c:972
 cpuhp_invoke_callback_range kernel/cpu.c:996 [inline]
 cpuhp_down_callbacks kernel/cpu.c:1386 [inline]
 _cpu_down+0x523/0x1020 kernel/cpu.c:1457
 cpu_down_maps_locked kernel/cpu.c:1483 [inline]
 cpu_down kernel/cpu.c:1491 [inline]
 cpu_device_down+0x82/0xc0 kernel/cpu.c:1508
 device_offline drivers/base/core.c:4283 [inline]
 device_offline+0x2f4/0x400 drivers/base/core.c:4267
 online_store+0xd1/0x180 drivers/base/core.c:2883
 dev_attr_store+0x58/0x80 drivers/base/core.c:2509
 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x6af/0x1050 fs/read_write.c:687
 ksys_write+0x12a/0x250 fs/read_write.c:739
 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline]
 __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291
 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316
 entry_SYSENTER_compat_after_hwframe+0x84/0x8e
RIP: 0023:0xf7fc5fec
Code: Unable to access opcode bytes at 0xf7fc5fc2.
RSP: 002b:00000000f548650c EFLAGS: 00000292 ORIG_RAX: 0000000000000004
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000080000180
RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

Strategy: ### Bug Analysis

The warning `WARNING in __mod_zone_page_state` is triggered because `__mod_zone_page_state()` expects preemption (or interrupts) to be disabled when updating per-CPU vmstat counters, but it is called with preemption enabled.

The call trace shows this happens during CPU offline:
1. `_cpu_down()` invokes the CPU hotplug callback `page_alloc_cpu_dead()` on a **surviving** CPU with preemption enabled.
2. `page_alloc_cpu_dead()` calls `mlock_drain_remote(cpu)` to drain the dead CPU's `mlock_fbatch`.
3. `mlock_drain_remote()` calls `mlock_folio_batch()` without disabling preemption.
4. `mlock_folio_batch()` processes a folio added via `munlock_folio()` and calls `__munlock_folio()`.
5. `__munlock_folio()` checks if the folio is on the LRU list via `folio_test_clear_lru()`. If it is, it locks the LRU lock (which disables interrupts) and proceeds safely.
6. However, if the folio is **not** on the LRU list, `folio_test_clear_lru()` returns false. `__munlock_folio()` skips taking the LRU lock and jumps directly to `munlock:`, calling `__zone_stat_mod_folio()` with preemption still enabled, triggering the warning.

To reproduce this, we need a folio that is added to `mlock_fbatch` via `munlock_folio()`, but is **not** on the LRU list when `mlock_drain_remote()` processes it. We can achieve this by exploiting the per-CPU `lru_add` batch:
1. **Thread 0 (CPU 0)** faults in a new page. The page is added to CPU 0's `lru_add` batch, but is not yet on the actual LRU list. Thread 0 then spins to prevent its batch from draining.
2. **Thread 1 (CPU 1)** calls `mlock()` on the page. `mlock()` adds the page to CPU 1's `mlock_fbatch` and drains it. `__mlock_folio()` sees the page is not on the LRU list and does nothing.
3. **Thread 1 (CPU 1)** calls `munmap()`. Since the VMA is locked, `munmap()` calls `munlock_vma_folio()`, which adds the page to CPU 1's `mlock_fbatch` with NO flags. `munmap()` does not drain the batch.
4. **Main Thread** offlines CPU 1. A surviving CPU executes `mlock_drain_remote(1)`, processes the folio, sees it's still not on the LRU list (still in CPU 0's batch), and calls `__zone_stat_mod_folio()` with preemption enabled.

### Minimal C Reproducer

```c
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <sched.h>
#include <string.h>

volatile int step = 0;
void *addr;

void pin_to_cpu(int cpu) {
    cpu_set_t set;
    CPU_ZERO(&set);
    CPU_SET(cpu, &set);
    if (sched_setaffinity(0, sizeof(set), &set) < 0) {
        perror("sched_setaffinity");
        exit(1);
    }
}

void *thread0(void *arg) {
    pin_to_cpu(0);
    
    while (step != 1) {}
    
    // Fault in the page on CPU 0.
    // It gets added to CPU 0's lru_add batch, but not yet on the LRU list.
    *(volatile char *)addr = 1;
    
    step = 2;
    
    // Spin to prevent CPU 0 from draining its lru_add batch.
    while (step != 5) {}
    
    return NULL;
}

void *thread1(void *arg) {
    pin_to_cpu(1);
    
    while (step != 2) {}
    
    // mlock the page on CPU 1.
    // It adds the page to CPU 1's mlock_fbatch with LRU_FOLIO, then drains it.
    // __mlock_folio sees the page is not on LRU (still in CPU 0's batch) and does nothing.
    if (mlock(addr, 4096) < 0) {
        perror("mlock");
    }
    
    // munmap the page on CPU 1.
    // Since the VMA is locked, it calls munlock_vma_folio, which adds the page
    // to CPU 1's mlock_fbatch with NO flags. munmap does not drain the batch.
    munmap(addr, 4096);
    
    step = 3;
    
    // Spin until this CPU goes offline.
    while (1) {}
    
    return NULL;
}

int main() {
    // Ensure CPU 1 is online initially.
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "1\n", 2);
        close(fd);
    }
    
    addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    if (addr == MAP_FAILED) {
        perror("mmap");
        return 1;
    }
    
    pthread_t t0, t1;
    pthread_create(&t0, NULL, thread0, NULL);
    pthread_create(&t1, NULL, thread1, NULL);
    
    step = 1;
    
    while (step != 3) {}
    
    // Offline CPU 1.
    // This triggers page_alloc_cpu_dead -> mlock_drain_remote on a surviving CPU.
    // mlock_drain_remote calls __munlock_folio, which sees the page is not on LRU,
    // skips taking the LRU lock, and calls __zone_stat_mod_folio with preemption enabled,
    // triggering the warning.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "0\n", 2);
        close(fd);
    }
    
    step = 5;
    pthread_join(t0, NULL);
    
    // Restore CPU 1.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "1\n", 2);
        close(fd);
    }
    
    return 0;
}
```




123/4 2026/08/27 19:28 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 6705
							output: 289
							thoughts: 733
						

Thoughts:
**My Thought Process for Reproducing the Bug**

My primary goal here is to meticulously reproduce a specific kernel bug, which manifests as a `WARNING` within the `__mod_zone_page_state` function during a CPU offline event. I understand the criticality of creating a minimal, self-contained C program to achieve this.

Initially, I considered directly diving into generating the C reproducer, as a strategy for this already exists and provides a clear explanation along with a C program. However, I've encountered a strict, non-negotiable constraint in the prompt: I *must* begin by crafting a "probe" program. This probe is essential for verifying that my test environment possesses the necessary kernel capabilities and privileges to even attempt triggering the bug.

The core capability required in this scenario is the ability to manipulate CPU states, specifically to offline and online a CPU through interactions with `/sys/devices/system/cpu/cpu1/online`. Therefore, my immediate task is to develop this probe program.

My first attempt at a probe program focused on simply checking if I could open `/sys/devices/system/cpu/cpu1/online` in read-write mode.

```c
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

int main() {
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_RDWR);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        return 1; // Original thought: return 1, but prompt implies exit(0) for success.
    }
    printf("[+] Successfully opened /sys/devices/system/cpu/cpu1/online.\n");
    close(fd);
    return 0;
}
```

However, I recalled the prompt's explicit instructions regarding the probe's output and exit behavior: "Print clear messages indicating success or failure of these probes, and exit with 0 only if all checks pass." This means my initial return 1 on failure needs to be an `exit(1)`, and the success condition must be a clean exit with 0.

Furthermore, just being able to *open* the file might not be sufficient. I need to ensure that the environment permits actual operations that would occur during a CPU offline/online cycle. Therefore, I decided to refine the probe program to also attempt a read operation on the file, which is a common interaction. This addition will provide a more robust check of the environment's readiness.

Here's the refined probe program:

```c
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

int main() {
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_RDWR);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1); // Corrected to exit(1) for failure.
    }
    printf("[+] Successfully opened /sys/devices/system/cpu/cpu1/online.\n");
    
    // Add a read check for more thorough verification.
    char buf[2]; // A small buffer should suffice for the '0' or '1' expected.
    int res = read(fd, buf, 1);
    if (res < 0) {
        printf("[-] Failed to read from /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1); // Exit on read failure.
    }
    printf("[+] Successfully read from /sys/devices/system/cpu/cpu1/online.\n");
    
    close(fd);
    // If all checks pass, the program will naturally reach this point and return 0.
    return 0; 
}
```

My next step, as per the prompt's implied workflow, is to package this probe program for submission, using the `set-results` tool to communicate its content. This ensures that the environment's readiness is validated *before* I proceed with generating the actual minimal C program to reproduce the bug.


124/4 2026/08/27 19:28 tool set-results
0m Args:
map[IsProbe:true RawCandidateReproC:#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

int main() {
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_RDWR);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] Successfully opened /sys/devices/system/cpu/cpu1/online.\n");
    
    char buf[2];
    int res = read(fd, buf, 1);
    if (res < 0) {
        printf("[-] Failed to read from /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] Successfully read from /sys/devices/system/cpu/cpu1/online.\n");
    
    close(fd);
    return 0;
}
]

Results:
map[IsProbe:true RawCandidateReproC:#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

int main() {
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_RDWR);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] Successfully opened /sys/devices/system/cpu/cpu1/online.\n");
    
    char buf[2];
    int res = read(fd, buf, 1);
    if (res < 0) {
        printf("[-] Failed to read from /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] Successfully read from /sys/devices/system/cpu/cpu1/online.\n");
    
    close(fd);
    return 0;
}
]

125/3 2026/08/27 19:28 loop
0m
126/4 2026/08/27 19:28 iteration 0
0m
127/5 2026/08/27 19:28 action merge-repro-c
0m Results:
map[CurrentCandidateReproC:#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

int main() {
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_RDWR);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] Successfully opened /sys/devices/system/cpu/cpu1/online.\n");
    
    char buf[2];
    int res = read(fd, buf, 1);
    if (res < 0) {
        printf("[-] Failed to read from /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] Successfully read from /sys/devices/system/cpu/cpu1/online.\n");
    
    close(fd);
    return 0;
}
]

128/5 2026/08/27 19:28 action compile-c-prog
0m Results:
map[CompilerError: FormattedReproC:#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

int main() {
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_RDWR);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] Successfully opened /sys/devices/system/cpu/cpu1/online.\n");
    
    char buf[2];
    int res = read(fd, buf, 1);
    if (res < 0) {
        printf("[-] Failed to read from /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] Successfully read from /sys/devices/system/cpu/cpu1/online.\n");
    
    close(fd);
    return 0;
}
]

129/5 2026/08/27 19:28 action If
0m Args:
map[CompilerError:]

130/3 2026/08/27 19:28 action run-c-repro
4m Results:
map[CandidateBugTitle: CandidateCrashReport: CandidateReproduced:false ConsoleOutput:[  109.152107][   T33] kauditd_printk_skb: 10 callbacks suppressed
[  109.152120][   T33] audit: type=1400 audit(1787859018.078:201): avc:  denied  { transition } for  pid=5832 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  109.170026][   T33] audit: type=1400 audit(1787859018.088:202): avc:  denied  { noatsecure } for  pid=5832 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  109.180898][   T33] audit: type=1400 audit(1787859018.088:203): avc:  denied  { rlimitinh } for  pid=5832 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  109.190084][   T33] audit: type=1400 audit(1787859018.088:204): avc:  denied  { siginh } for  pid=5832 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  112.500251][   T33] audit: type=1400 audit(1787859021.428:205): avc:  denied  { write } for  pid=5836 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.580642][   T33] audit: type=1400 audit(1787859021.508:206): avc:  denied  { write } for  pid=5839 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.779329][   T33] audit: type=1400 audit(1787859021.708:207): avc:  denied  { write } for  pid=5842 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.891391][   T33] audit: type=1400 audit(1787859021.818:208): avc:  denied  { write } for  pid=5845 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  113.045898][   T33] audit: type=1400 audit(1787859021.978:209): avc:  denied  { write } for  pid=5848 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  113.153515][   T33] audit: type=1400 audit(1787859022.078:210): avc:  denied  { write } for  pid=5851 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.870264][   T33] kauditd_printk_skb: 6 callbacks suppressed
[  114.870280][   T33] audit: type=1400 audit(1787859023.798:217): avc:  denied  { write } for  pid=5873 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.979567][   T33] audit: type=1400 audit(1787859023.908:218): avc:  denied  { write } for  pid=5876 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  116.140514][   T33] audit: type=1400 audit(1787859025.068:219): avc:  denied  { write } for  pid=5883 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  116.232834][   T33] audit: type=1400 audit(1787859025.158:220): avc:  denied  { write } for  pid=5886 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:8698' (ED25519) to the list of known hosts.
[+] Successfully opened /sys/devices/system/cpu/cpu1/online.
[+] Successfully read from /sys/devices/system/cpu/cpu1/online.
 OtherCrashReports:<nil> StraceOutput:/strace -e \!wait4,clock_nanosleep,nanosleep -s 100 -x -f /syz-executor2519909875

<...>
[  106.459870][   T33] kauditd_printk_skb: 10 callbacks suppressed
[  106.459881][   T33] audit: type=1400 audit(1787859151.308:202): avc:  denied  { transition } for  pid=5831 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  106.468843][   T33] audit: type=1400 audit(1787859151.308:203): avc:  denied  { noatsecure } for  pid=5831 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  106.474958][   T33] audit: type=1400 audit(1787859151.308:204): avc:  denied  { rlimitinh } for  pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  106.480735][   T33] audit: type=1400 audit(1787859151.308:205): avc:  denied  { siginh } for  pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  108.871598][   T33] audit: type=1400 audit(1787859153.718:206): avc:  denied  { write } for  pid=5838 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  108.922525][   T33] audit: type=1400 audit(1787859153.768:207): avc:  denied  { write } for  pid=5841 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  110.013997][   T33] audit: type=1400 audit(1787859154.858:208): avc:  denied  { write } for  pid=5845 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  110.062166][   T33] audit: type=1400 audit(1787859154.908:209): avc:  denied  { write } for  pid=5848 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  110.346245][   T33] audit: type=1400 audit(1787859155.198:210): avc:  denied  { write } for  pid=5854 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  110.398152][   T33] audit: type=1400 audit(1787859155.238:211): avc:  denied  { write } for  pid=5858 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.456822][   T33] kauditd_printk_skb: 8 callbacks suppressed
[  112.456832][   T33] audit: type=1400 audit(1787859157.308:220): avc:  denied  { write } for  pid=5886 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.511596][   T33] audit: type=1400 audit(1787859157.358:221): avc:  denied  { write } for  pid=5890 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:36236' (ED25519) to the list of known hosts.
execve("/syz-executor2519909875", ["/syz-executor2519909875"], 0x7fff2d48ba20 /* 11 vars */) = 0
brk(NULL)                               = 0x5555699b8000
brk(0x5555699b8d80)                     = 0x5555699b8d80
arch_prctl(ARCH_SET_FS, 0x5555699b8400) = 0
set_tid_address(0x5555699b86d0)         = 5901
set_robust_list(0x5555699b86e0, 24)     = 0
rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
readlinkat(AT_FDCWD, "/proc/self/exe", "/syz-executor2519909875", 4096) = 23
getrandom("\xd5\xdd\xde\x88\x01\x1a\x00\x1d", 8, GRND_NONBLOCK) = 8
brk(NULL)                               = 0x5555699b8d80
brk(0x5555699d9d80)                     = 0x5555699d9d80
brk(0x5555699da000)                     = 0x5555699da000
mprotect(0x7fbc44260000, 20480, PROT_READ) = 0
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/online", O_RDWR) = 3
fstat(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
read(3, "1", 1)                         = 1
close(3)                                = 0
write(1, "[+] Successfully opened /sys/devices/system/cpu/cpu1/online.\n[+] Successfully read from /sys/devices"..., 125) = 125
[+] Successfully opened /sys/devices/system/cpu/cpu1/online.
[+] Successfully read from /sys/devices/system/cpu/cpu1/online.
exit_group(0)                           = ?
+++ exited with 0 +++
 TestError:]

131/3 2026/08/27 19:32 action truncate-log
0m Results:
map[TruncatedConsoleOutput:[  109.152107][   T33] kauditd_printk_skb: 10 callbacks suppressed
[  109.152120][   T33] audit: type=1400 audit(1787859018.078:201): avc:  denied  { transition } for  pid=5832 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  109.170026][   T33] audit: type=1400 audit(1787859018.088:202): avc:  denied  { noatsecure } for  pid=5832 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  109.180898][   T33] audit: type=1400 audit(1787859018.088:203): avc:  denied  { rlimitinh } for  pid=5832 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  109.190084][   T33] audit: type=1400 audit(1787859018.088:204): avc:  denied  { siginh } for  pid=5832 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  112.500251][   T33] audit: type=1400 audit(1787859021.428:205): avc:  denied  { write } for  pid=5836 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.580642][   T33] audit: type=1400 audit(1787859021.508:206): avc:  denied  { write } for  pid=5839 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.779329][   T33] audit: type=1400 audit(1787859021.708:207): avc:  denied  { write } for  pid=5842 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.891391][   T33] audit: type=1400 audit(1787859021.818:208): avc:  denied  { write } for  pid=5845 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  113.045898][   T33] audit: type=1400 audit(1787859021.978:209): avc:  denied  { write } for  pid=5848 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  113.153515][   T33] audit: type=1400 audit(1787859022.078:210): avc:  denied  { write } for  pid=5851 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.870264][   T33] kauditd_printk_skb: 6 callbacks suppressed
[  114.870280][   T33] audit: type=1400 audit(1787859023.798:217): avc:  denied  { write } for  pid=5873 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.979567][   T33] audit: type=1400 audit(1787859023.908:218): avc:  denied  { write } for  pid=5876 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  116.140514][   T33] audit: type=1400 audit(1787859025.068:219): avc:  denied  { write } for  pid=5883 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  116.232834][   T33] audit: type=1400 audit(1787859025.158:220): avc:  denied  { write } for  pid=5886 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:8698' (ED25519) to the list of known hosts.
[+] Successfully opened /sys/devices/system/cpu/cpu1/online.
[+] Successfully read from /sys/devices/system/cpu/cpu1/online.
 TruncatedCrashReport: TruncatedStraceOutput:/strace -e \!wait4,clock_nanosleep,nanosleep -s 100 -x -f /syz-executor2519909875

<...>
[  106.459870][   T33] kauditd_printk_skb: 10 callbacks suppressed
[  106.459881][   T33] audit: type=1400 audit(1787859151.308:202): avc:  denied  { transition } for  pid=5831 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  106.468843][   T33] audit: type=1400 audit(1787859151.308:203): avc:  denied  { noatsecure } for  pid=5831 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  106.474958][   T33] audit: type=1400 audit(1787859151.308:204): avc:  denied  { rlimitinh } for  pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  106.480735][   T33] audit: type=1400 audit(1787859151.308:205): avc:  denied  { siginh } for  pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  108.871598][   T33] audit: type=1400 audit(1787859153.718:206): avc:  denied  { write } for  pid=5838 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  108.922525][   T33] audit: type=1400 audit(1787859153.768:207): avc:  denied  { write } for  pid=5841 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  110.013997][   T33] audit: type=1400 audit(1787859154.858:208): avc:  denied  { write } for  pid=5845 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  110.062166][   T33] audit: type=1400 audit(1787859154.908:209): avc:  denied  { write } for  pid=5848 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  110.346245][   T33] audit: type=1400 audit(1787859155.198:210): avc:  denied  { write } for  pid=5854 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  110.398152][   T33] audit: type=1400 audit(1787859155.238:211): avc:  denied  { write } for  pid=5858 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.456822][   T33] kauditd_printk_skb: 8 callbacks suppressed
[  112.456832][   T33] audit: type=1400 audit(1787859157.308:220): avc:  denied  { write } for  pid=5886 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.511596][   T33] audit: type=1400 audit(1787859157.358:221): avc:  denied  { write } for  pid=5890 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:36236' (ED25519) to the list of known hosts.
execve("/syz-executor2519909875", ["/syz-executor2519909875"], 0x7fff2d48ba20 /* 11 vars */) = 0
brk(NULL)                               = 0x5555699b8000
brk(0x5555699b8d80)                     = 0x5555699b8d80
arch_prctl(ARCH_SET_FS, 0x5555699b8400) = 0
set_tid_address(0x5555699b86d0)         = 5901
set_robust_list(0x5555699b86e0, 24)     = 0
rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
readlinkat(AT_FDCWD, "/proc/self/exe", "/syz-executor2519909875", 4096) = 23
getrandom("\xd5\xdd\xde\x88\x01\x1a\x00\x1d", 8, GRND_NONBLOCK) = 8
brk(NULL)                               = 0x5555699b8d80
brk(0x5555699d9d80)                     = 0x5555699d9d80
brk(0x5555699da000)                     = 0x5555699da000
mprotect(0x7fbc44260000, 20480, PROT_READ) = 0
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/online", O_RDWR) = 3
fstat(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
read(3, "1", 1)                         = 1
close(3)                                = 0
write(1, "[+] Successfully opened /sys/devices/system/cpu/cpu1/online.\n[+] Successfully read from /sys/devices"..., 125) = 125
[+] Successfully opened /sys/devices/system/cpu/cpu1/online.
[+] Successfully read from /sys/devices/system/cpu/cpu1/online.
exit_group(0)                           = ?
+++ exited with 0 +++
]

132/3 2026/08/27 19:32 agent repro-oracle
0m Model:
deep-reasoning

Results:
map[Feedback:The capability probe successfully opened and read from `/sys/devices/system/cpu/cpu1/online`. The environment is ready. In the next iteration, you should proceed to write "0" to this file to trigger the CPU offline path. To reproduce the bug, you will likely need to set up some mlocked pages (using `mlock()` or `mlockall()`) on the CPU being offlined, so that `page_alloc_cpu_dead` calls `mlock_drain_remote` and hits the warning in `__mod_zone_page_state`. ProbePassed:true TerminalError: TitleMatches:false]

Instruction:
You are a security researcher with deep Linux kernel background.
Analyze the results of running the generated program.

=== CRITICAL ENVIRONMENT & TARGET CLASSIFICATION ===
Set 'TerminalError' to a descriptive error message ONLY if:
1. The execution failed due to missing hardware device nodes, subsystems, kernel modules, or privilege limits
   that cannot be loaded, created, or bypassed by user-space C code edits in the VM guest.
2. The target source files or functions described in the bug description do not exist in the checked-out codebase,
   meaning the codebase version is mismatched and the target code is absent.

=== CRITICAL PROHIBITIONS ===
- Do NOT classify a run as a terminal failure or assume a bug is fixed based on git log entries, commit titles,
  or commit messages. Reproducibility can ONLY be determined by executing reproducer candidates in the VM.
- Do NOT suggest C code strategies, repairs, or namespace bypasses when setting 'TerminalError'.


=== PHASE 1: CAPABILITY PROBING (EVALUATION) ===
The executed program was a simple environment probe.
Use this to guide your classification and feedback:
1. If the execution was successful (all environment/subsystem probes passed and program exited with 0),
   set the field 'ProbePassed' to true and provide feedback explicitly indicating that the environment
   is ready and the agent should now proceed to generate the full reproducer in the next iteration.
2. If the probe failed (e.g., missing permissions, missing devices, or sandbox restrictions),
   set the field 'ProbePassed' to false, and explain what failed in the 'Feedback'
   field so the generator can adjust its setups.

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:
Bug Description: WARNING in __mod_zone_page_state

smpboot: CPU 1 is now offline
------------[ cut here ]------------
IS_ENABLED(CONFIG_PREEMPT_COUNT) && __lockdep_enabled && (preempt_count() == 0 && this_cpu_read(hardirqs_enabled))
WARNING: mm/vmstat.c:361 at __mod_zone_page_state+0x96/0x190 mm/vmstat.c:361, CPU#0: syz.0.301/7156
Modules linked in:
CPU: 0 UID: 0 PID: 7156 Comm: syz.0.301 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__mod_zone_page_state+0x96/0x190 mm/vmstat.c:361
Code: d0 00 00 00 8b 05 7e 0b ed 0e 85 c0 74 1f 65 8b 05 e7 56 32 12 65 0b 05 30 10 32 12 75 0f 65 8b 05 33 52 32 12 85 c0 74 04 90 <0f> 0b 90 48 c7 c7 40 e3 ff 8b e8 9b 69 71 09 65 48 0f be 5d 00 48
RSP: 0000:ffffc900033ef8c0 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000000 RCX: 1ffffffff2289b6c
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88807ffd69b8
RBP: ffffffff948bfd88 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffffffffffffffff
R13: 0000000000000008 R14: ffff88807ffd6940 R15: ffffffff948bfd80
FS:  0000000000000000(0000) GS:ffff888096982000(0063) knlGS:00000000f5486b40
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000f5453ff4 CR3: 0000000053822000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 __zone_stat_mod_folio include/linux/vmstat.h:410 [inline]
 __munlock_folio mm/mlock.c:144 [inline]
 mlock_folio_batch+0xf97/0x36e0 mm/mlock.c:204
 mlock_drain_remote+0xe5/0x140 mm/mlock.c:230
 page_alloc_cpu_dead+0x16/0x130 mm/page_alloc.c:6468
 cpuhp_invoke_callback+0x3b4/0x9a0 kernel/cpu.c:194
 __cpuhp_invoke_callback_range+0x158/0x1d0 kernel/cpu.c:972
 cpuhp_invoke_callback_range kernel/cpu.c:996 [inline]
 cpuhp_down_callbacks kernel/cpu.c:1386 [inline]
 _cpu_down+0x523/0x1020 kernel/cpu.c:1457
 cpu_down_maps_locked kernel/cpu.c:1483 [inline]
 cpu_down kernel/cpu.c:1491 [inline]
 cpu_device_down+0x82/0xc0 kernel/cpu.c:1508
 device_offline drivers/base/core.c:4283 [inline]
 device_offline+0x2f4/0x400 drivers/base/core.c:4267
 online_store+0xd1/0x180 drivers/base/core.c:2883
 dev_attr_store+0x58/0x80 drivers/base/core.c:2509
 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x6af/0x1050 fs/read_write.c:687
 ksys_write+0x12a/0x250 fs/read_write.c:739
 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline]
 __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291
 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316
 entry_SYSENTER_compat_after_hwframe+0x84/0x8e
RIP: 0023:0xf7fc5fec
Code: Unable to access opcode bytes at 0xf7fc5fc2.
RSP: 002b:00000000f548650c EFLAGS: 00000292 ORIG_RAX: 0000000000000004
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000080000180
RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

IsProbe: true
Reproduced: false
Console Output: [  109.152107][   T33] kauditd_printk_skb: 10 callbacks suppressed
[  109.152120][   T33] audit: type=1400 audit(1787859018.078:201): avc:  denied  { transition } for  pid=5832 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  109.170026][   T33] audit: type=1400 audit(1787859018.088:202): avc:  denied  { noatsecure } for  pid=5832 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  109.180898][   T33] audit: type=1400 audit(1787859018.088:203): avc:  denied  { rlimitinh } for  pid=5832 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  109.190084][   T33] audit: type=1400 audit(1787859018.088:204): avc:  denied  { siginh } for  pid=5832 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  112.500251][   T33] audit: type=1400 audit(1787859021.428:205): avc:  denied  { write } for  pid=5836 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.580642][   T33] audit: type=1400 audit(1787859021.508:206): avc:  denied  { write } for  pid=5839 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.779329][   T33] audit: type=1400 audit(1787859021.708:207): avc:  denied  { write } for  pid=5842 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.891391][   T33] audit: type=1400 audit(1787859021.818:208): avc:  denied  { write } for  pid=5845 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  113.045898][   T33] audit: type=1400 audit(1787859021.978:209): avc:  denied  { write } for  pid=5848 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  113.153515][   T33] audit: type=1400 audit(1787859022.078:210): avc:  denied  { write } for  pid=5851 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.870264][   T33] kauditd_printk_skb: 6 callbacks suppressed
[  114.870280][   T33] audit: type=1400 audit(1787859023.798:217): avc:  denied  { write } for  pid=5873 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.979567][   T33] audit: type=1400 audit(1787859023.908:218): avc:  denied  { write } for  pid=5876 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  116.140514][   T33] audit: type=1400 audit(1787859025.068:219): avc:  denied  { write } for  pid=5883 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  116.232834][   T33] audit: type=1400 audit(1787859025.158:220): avc:  denied  { write } for  pid=5886 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:8698' (ED25519) to the list of known hosts.
[+] Successfully opened /sys/devices/system/cpu/cpu1/online.
[+] Successfully read from /sys/devices/system/cpu/cpu1/online.

Strace Output: /strace -e \!wait4,clock_nanosleep,nanosleep -s 100 -x -f /syz-executor2519909875

<...>
[  106.459870][   T33] kauditd_printk_skb: 10 callbacks suppressed
[  106.459881][   T33] audit: type=1400 audit(1787859151.308:202): avc:  denied  { transition } for  pid=5831 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  106.468843][   T33] audit: type=1400 audit(1787859151.308:203): avc:  denied  { noatsecure } for  pid=5831 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  106.474958][   T33] audit: type=1400 audit(1787859151.308:204): avc:  denied  { rlimitinh } for  pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  106.480735][   T33] audit: type=1400 audit(1787859151.308:205): avc:  denied  { siginh } for  pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  108.871598][   T33] audit: type=1400 audit(1787859153.718:206): avc:  denied  { write } for  pid=5838 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  108.922525][   T33] audit: type=1400 audit(1787859153.768:207): avc:  denied  { write } for  pid=5841 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  110.013997][   T33] audit: type=1400 audit(1787859154.858:208): avc:  denied  { write } for  pid=5845 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  110.062166][   T33] audit: type=1400 audit(1787859154.908:209): avc:  denied  { write } for  pid=5848 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  110.346245][   T33] audit: type=1400 audit(1787859155.198:210): avc:  denied  { write } for  pid=5854 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  110.398152][   T33] audit: type=1400 audit(1787859155.238:211): avc:  denied  { write } for  pid=5858 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.456822][   T33] kauditd_printk_skb: 8 callbacks suppressed
[  112.456832][   T33] audit: type=1400 audit(1787859157.308:220): avc:  denied  { write } for  pid=5886 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.511596][   T33] audit: type=1400 audit(1787859157.358:221): avc:  denied  { write } for  pid=5890 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:36236' (ED25519) to the list of known hosts.
execve("/syz-executor2519909875", ["/syz-executor2519909875"], 0x7fff2d48ba20 /* 11 vars */) = 0
brk(NULL)                               = 0x5555699b8000
brk(0x5555699b8d80)                     = 0x5555699b8d80
arch_prctl(ARCH_SET_FS, 0x5555699b8400) = 0
set_tid_address(0x5555699b86d0)         = 5901
set_robust_list(0x5555699b86e0, 24)     = 0
rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
readlinkat(AT_FDCWD, "/proc/self/exe", "/syz-executor2519909875", 4096) = 23
getrandom("\xd5\xdd\xde\x88\x01\x1a\x00\x1d", 8, GRND_NONBLOCK) = 8
brk(NULL)                               = 0x5555699b8d80
brk(0x5555699d9d80)                     = 0x5555699d9d80
brk(0x5555699da000)                     = 0x5555699da000
mprotect(0x7fbc44260000, 20480, PROT_READ) = 0
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/online", O_RDWR) = 3
fstat(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
read(3, "1", 1)                         = 1
close(3)                                = 0
write(1, "[+] Successfully opened /sys/devices/system/cpu/cpu1/online.\n[+] Successfully read from /sys/devices"..., 125) = 125
[+] Successfully opened /sys/devices/system/cpu/cpu1/online.
[+] Successfully read from /sys/devices/system/cpu/cpu1/online.
exit_group(0)                           = ?
+++ exited with 0 +++

Crash Report: 


133/4 2026/08/27 19:32 llm repro-oracle
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 9200
							output: 152
							thoughts: 507
						

Thoughts:
**My Thought Process on the Capability Probe Results**

Alright, let's break down what just happened here. My primary objective was to analyze the results from that capability probe we ran. This probe was a pretty straightforward C program designed to test our ability to interact with `/sys/devices/system/cpu/cpu1/online`.

Looking at the console output, it seems unambiguous: `[+] Successfully opened /sys/devices/system/cpu/cpu1/online.` and `[+] Successfully read from /sys/devices/system/cpu/cpu1/online.`. That's a clear indication that the initial steps of file access were successful.

To be absolutely certain, I cross-referenced this with the `strace` output. And indeed, the syscalls confirm it: we saw `openat` with the correct path, followed by `read` which successfully returned `1` (implying it read the character '1' from the file, indicating the CPU was online), and finally `close`. Everything lines up.

So, the probe **passed successfully**. This means we have confirmed that the fundamental capability of opening and reading from `/sys/devices/system/cpu/cpu1/online` exists and works as expected.

Now, the real meat of the problem, as I understand it from the bug description, lies with the `WARNING in __mod_zone_page_state` that occurs specifically during CPU offline operations. I traced the call chain that leads to this warning: writing to `/sys/devices/system/cpu/cpu1/online` initiates the CPU offline process. This, in turn, triggers `page_alloc_cpu_dead`, which then calls `mlock_drain_remote`. It's within `mlock_drain_remote` that we see a call to `mlock_folio_batch`, which then leads to `__munlock_folio`, and subsequently `__zone_stat_mod_folio`. This is where the `WARNING in __mod_zone_page_state` is actually triggered.

Given that our probe successfully opened the file with `O_RDWR` and read from it, the logical next step is to proceed with *writing* to it. This is what will actually initiate the CPU offline sequence. However, looking at the call trace, specifically the `mlock_drain_remote` and `mlock_folio_batch` functions, it seems highly probable that we'll need to ensure some `mlock` state is already set up. Otherwise, we might not hit that specific problematic code path, and the warning might not manifest.

Therefore, my conclusion is that the probe has passed, and we are ready to move on to the next phase. I'll be using the `set-results` command with `ProbePassed: true`. Since we haven't triggered the actual crash or warning yet, `TitleMatches` will be `false`. There's no terminal error encountered, so `TerminalError` will be an empty string. My `Feedback` will clearly state that the probe was successful and that we are now positioned to attempt writing to the file to trigger CPU offline. Crucially, I'll emphasize the need to potentially set up some mlocked pages beforehand, as this seems to be a prerequisite for hitting the `mlock_drain_remote` path where the bug resides.


134/4 2026/08/27 19:32 tool set-results
0m Args:
map[Feedback:The capability probe successfully opened and read from `/sys/devices/system/cpu/cpu1/online`. The environment is ready. In the next iteration, you should proceed to write "0" to this file to trigger the CPU offline path. To reproduce the bug, you will likely need to set up some mlocked pages (using `mlock()` or `mlockall()`) on the CPU being offlined, so that `page_alloc_cpu_dead` calls `mlock_drain_remote` and hits the warning in `__mod_zone_page_state`. ProbePassed:true TerminalError: TitleMatches:false]

Results:
map[Feedback:The capability probe successfully opened and read from `/sys/devices/system/cpu/cpu1/online`. The environment is ready. In the next iteration, you should proceed to write "0" to this file to trigger the CPU offline path. To reproduce the bug, you will likely need to set up some mlocked pages (using `mlock()` or `mlockall()`) on the CPU being offlined, so that `page_alloc_cpu_dead` calls `mlock_drain_remote` and hits the warning in `__mod_zone_page_state`. ProbePassed:true TerminalError: TitleMatches:false]

135/3 2026/08/27 19:32 action loop-controller
0m Results:
map[CapabilitiesVerified:true ContinueSignal:continue EquivalenceAnalysis: OracleFeedback:The capability probe successfully opened and read from `/sys/devices/system/cpu/cpu1/online`. The environment is ready. In the next iteration, you should proceed to write "0" to this file to trigger the CPU offline path. To reproduce the bug, you will likely need to set up some mlocked pages (using `mlock()` or `mlockall()`) on the CPU being offlined, so that `page_alloc_cpu_dead` calls `mlock_drain_remote` and hits the warning in `__mod_zone_page_state`. ReproC: Reproduced:false ReproducedBugTitle: ReproducedCrashReport:]

136/2 2026/08/27 19:32 iteration 1
15m
137/3 2026/08/27 19:32 action If
6m Args:
map[OracleFeedback:The capability probe successfully opened and read from `/sys/devices/system/cpu/cpu1/online`. The environment is ready. In the next iteration, you should proceed to write "0" to this file to trigger the CPU offline path. To reproduce the bug, you will likely need to set up some mlocked pages (using `mlock()` or `mlockall()`) on the CPU being offlined, so that `page_alloc_cpu_dead` calls `mlock_drain_remote` and hits the warning in `__mod_zone_page_state`.]

138/4 2026/08/27 19:32 agent strategy-refiner
6m Model:
deep-reasoning

Instruction:
You are an expert in Linux kernel debugging.
Refine the reproduction strategy based on feedback from previous attempts.
Analyze the technical diagnosis provided in the oracle feedback and translate it into concrete,
step-by-step instructions for the repro-generator on how to modify the code structure, alignments,
offsets, or parameters of the candidate program.

=== TOOL SELECTION GUIDELINES ===
- Prefer codesearch-definition-source and codesearch-struct-layout first for symbol lookups.
- Fall back to read-file or grepper for macros, headers, or if symbol lookup fails.

=== CRITICAL PROHIBITIONS ===
- Do NOT repeat searches for the same symbols or files. Use information you have already gathered.
- Do NOT write long explanations. Keep your reasoning short and focused on actionable changes.
- Do NOT assume a bug is fixed based on git commit history.
- If you are stuck, try a different approach or proceed to generate a candidate reproducer.
Prefer calling several tools at the same time to save round-trips.

Prompt:
Bug Description: WARNING in __mod_zone_page_state

smpboot: CPU 1 is now offline
------------[ cut here ]------------
IS_ENABLED(CONFIG_PREEMPT_COUNT) && __lockdep_enabled && (preempt_count() == 0 && this_cpu_read(hardirqs_enabled))
WARNING: mm/vmstat.c:361 at __mod_zone_page_state+0x96/0x190 mm/vmstat.c:361, CPU#0: syz.0.301/7156
Modules linked in:
CPU: 0 UID: 0 PID: 7156 Comm: syz.0.301 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__mod_zone_page_state+0x96/0x190 mm/vmstat.c:361
Code: d0 00 00 00 8b 05 7e 0b ed 0e 85 c0 74 1f 65 8b 05 e7 56 32 12 65 0b 05 30 10 32 12 75 0f 65 8b 05 33 52 32 12 85 c0 74 04 90 <0f> 0b 90 48 c7 c7 40 e3 ff 8b e8 9b 69 71 09 65 48 0f be 5d 00 48
RSP: 0000:ffffc900033ef8c0 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000000 RCX: 1ffffffff2289b6c
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88807ffd69b8
RBP: ffffffff948bfd88 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffffffffffffffff
R13: 0000000000000008 R14: ffff88807ffd6940 R15: ffffffff948bfd80
FS:  0000000000000000(0000) GS:ffff888096982000(0063) knlGS:00000000f5486b40
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000f5453ff4 CR3: 0000000053822000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 __zone_stat_mod_folio include/linux/vmstat.h:410 [inline]
 __munlock_folio mm/mlock.c:144 [inline]
 mlock_folio_batch+0xf97/0x36e0 mm/mlock.c:204
 mlock_drain_remote+0xe5/0x140 mm/mlock.c:230
 page_alloc_cpu_dead+0x16/0x130 mm/page_alloc.c:6468
 cpuhp_invoke_callback+0x3b4/0x9a0 kernel/cpu.c:194
 __cpuhp_invoke_callback_range+0x158/0x1d0 kernel/cpu.c:972
 cpuhp_invoke_callback_range kernel/cpu.c:996 [inline]
 cpuhp_down_callbacks kernel/cpu.c:1386 [inline]
 _cpu_down+0x523/0x1020 kernel/cpu.c:1457
 cpu_down_maps_locked kernel/cpu.c:1483 [inline]
 cpu_down kernel/cpu.c:1491 [inline]
 cpu_device_down+0x82/0xc0 kernel/cpu.c:1508
 device_offline drivers/base/core.c:4283 [inline]
 device_offline+0x2f4/0x400 drivers/base/core.c:4267
 online_store+0xd1/0x180 drivers/base/core.c:2883
 dev_attr_store+0x58/0x80 drivers/base/core.c:2509
 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x6af/0x1050 fs/read_write.c:687
 ksys_write+0x12a/0x250 fs/read_write.c:739
 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline]
 __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291
 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316
 entry_SYSENTER_compat_after_hwframe+0x84/0x8e
RIP: 0023:0xf7fc5fec
Code: Unable to access opcode bytes at 0xf7fc5fc2.
RSP: 002b:00000000f548650c EFLAGS: 00000292 ORIG_RAX: 0000000000000004
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000080000180
RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

Current Strategy: ### Bug Analysis

The warning `WARNING in __mod_zone_page_state` is triggered because `__mod_zone_page_state()` expects preemption (or interrupts) to be disabled when updating per-CPU vmstat counters, but it is called with preemption enabled.

The call trace shows this happens during CPU offline:
1. `_cpu_down()` invokes the CPU hotplug callback `page_alloc_cpu_dead()` on a **surviving** CPU with preemption enabled.
2. `page_alloc_cpu_dead()` calls `mlock_drain_remote(cpu)` to drain the dead CPU's `mlock_fbatch`.
3. `mlock_drain_remote()` calls `mlock_folio_batch()` without disabling preemption.
4. `mlock_folio_batch()` processes a folio added via `munlock_folio()` and calls `__munlock_folio()`.
5. `__munlock_folio()` checks if the folio is on the LRU list via `folio_test_clear_lru()`. If it is, it locks the LRU lock (which disables interrupts) and proceeds safely.
6. However, if the folio is **not** on the LRU list, `folio_test_clear_lru()` returns false. `__munlock_folio()` skips taking the LRU lock and jumps directly to `munlock:`, calling `__zone_stat_mod_folio()` with preemption still enabled, triggering the warning.

To reproduce this, we need a folio that is added to `mlock_fbatch` via `munlock_folio()`, but is **not** on the LRU list when `mlock_drain_remote()` processes it. We can achieve this by exploiting the per-CPU `lru_add` batch:
1. **Thread 0 (CPU 0)** faults in a new page. The page is added to CPU 0's `lru_add` batch, but is not yet on the actual LRU list. Thread 0 then spins to prevent its batch from draining.
2. **Thread 1 (CPU 1)** calls `mlock()` on the page. `mlock()` adds the page to CPU 1's `mlock_fbatch` and drains it. `__mlock_folio()` sees the page is not on the LRU list and does nothing.
3. **Thread 1 (CPU 1)** calls `munmap()`. Since the VMA is locked, `munmap()` calls `munlock_vma_folio()`, which adds the page to CPU 1's `mlock_fbatch` with NO flags. `munmap()` does not drain the batch.
4. **Main Thread** offlines CPU 1. A surviving CPU executes `mlock_drain_remote(1)`, processes the folio, sees it's still not on the LRU list (still in CPU 0's batch), and calls `__zone_stat_mod_folio()` with preemption enabled.

### Minimal C Reproducer

```c
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <sched.h>
#include <string.h>

volatile int step = 0;
void *addr;

void pin_to_cpu(int cpu) {
    cpu_set_t set;
    CPU_ZERO(&set);
    CPU_SET(cpu, &set);
    if (sched_setaffinity(0, sizeof(set), &set) < 0) {
        perror("sched_setaffinity");
        exit(1);
    }
}

void *thread0(void *arg) {
    pin_to_cpu(0);
    
    while (step != 1) {}
    
    // Fault in the page on CPU 0.
    // It gets added to CPU 0's lru_add batch, but not yet on the LRU list.
    *(volatile char *)addr = 1;
    
    step = 2;
    
    // Spin to prevent CPU 0 from draining its lru_add batch.
    while (step != 5) {}
    
    return NULL;
}

void *thread1(void *arg) {
    pin_to_cpu(1);
    
    while (step != 2) {}
    
    // mlock the page on CPU 1.
    // It adds the page to CPU 1's mlock_fbatch with LRU_FOLIO, then drains it.
    // __mlock_folio sees the page is not on LRU (still in CPU 0's batch) and does nothing.
    if (mlock(addr, 4096) < 0) {
        perror("mlock");
    }
    
    // munmap the page on CPU 1.
    // Since the VMA is locked, it calls munlock_vma_folio, which adds the page
    // to CPU 1's mlock_fbatch with NO flags. munmap does not drain the batch.
    munmap(addr, 4096);
    
    step = 3;
    
    // Spin until this CPU goes offline.
    while (1) {}
    
    return NULL;
}

int main() {
    // Ensure CPU 1 is online initially.
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "1\n", 2);
        close(fd);
    }
    
    addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    if (addr == MAP_FAILED) {
        perror("mmap");
        return 1;
    }
    
    pthread_t t0, t1;
    pthread_create(&t0, NULL, thread0, NULL);
    pthread_create(&t1, NULL, thread1, NULL);
    
    step = 1;
    
    while (step != 3) {}
    
    // Offline CPU 1.
    // This triggers page_alloc_cpu_dead -> mlock_drain_remote on a surviving CPU.
    // mlock_drain_remote calls __munlock_folio, which sees the page is not on LRU,
    // skips taking the LRU lock, and calls __zone_stat_mod_folio with preemption enabled,
    // triggering the warning.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "0\n", 2);
        close(fd);
    }
    
    step = 5;
    pthread_join(t0, NULL);
    
    // Restore CPU 1.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "1\n", 2);
        close(fd);
    }
    
    return 0;
}
```
Feedback: The capability probe successfully opened and read from `/sys/devices/system/cpu/cpu1/online`. The environment is ready. In the next iteration, you should proceed to write "0" to this file to trigger the CPU offline path. To reproduce the bug, you will likely need to set up some mlocked pages (using `mlock()` or `mlockall()`) on the CPU being offlined, so that `page_alloc_cpu_dead` calls `mlock_drain_remote` and hits the warning in `__mod_zone_page_state`.

Reply:
The bug is caused by `mlock_drain_remote()` processing a folio that is not yet on the LRU list (e.g., it is still in another CPU's `lru_add` batch). When this happens, `__munlock_folio()` skips taking the LRU lock (which would disable interrupts) and calls `__zone_stat_mod_folio()` with preemption enabled, triggering the warning.

To reproduce this:
1. **Thread 0 (CPU 0)** faults in a new page. The page is added to CPU 0's `lru_add` batch. Thread 0 then spins to prevent its batch from draining.
2. **Thread 1 (CPU 1)** calls `mlock()` on the page. `mlock()` adds the page to CPU 1's `mlock_fbatch` with `LRU_FOLIO` and drains it. `__mlock_folio()` sees the page is not on the LRU list (still in CPU 0's batch) and does nothing, leaving `PG_mlocked` set.
3. **Thread 1 (CPU 1)** calls `munmap()`. Since the VMA is locked, it calls `munlock_vma_folio()`, which adds the page to CPU 1's `mlock_fbatch` with NO flags. `munmap()` does not drain the batch.
4. **Main Thread** offlines CPU 1. A surviving CPU executes `mlock_drain_remote(1)`, processes the folio, sees it's still not on the LRU list, and calls `__zone_stat_mod_folio()` with preemption enabled.

Here is the concrete C reproducer using the race toolkit:

```c
#include "race_toolkit.h"
#include <sys/mman.h>

volatile int step = 0;
void *addr;

void *thread0(void *arg) {
    PIN_TO_CPU(0);
    
    WAIT_ON(&step, 1);
    
    // Fault in the page on CPU 0.
    // It gets added to CPU 0's lru_add batch, but not yet on the LRU list.
    *(volatile char *)addr = 1;
    
    SIGNAL(&step, 2);
    
    // Spin to prevent CPU 0 from draining its lru_add batch.
    WAIT_ON(&step, 5);
    
    return NULL;
}

void *thread1(void *arg) {
    PIN_TO_CPU(1);
    
    WAIT_ON(&step, 2);
    
    // mlock the page on CPU 1.
    // It adds the page to CPU 1's mlock_fbatch with LRU_FOLIO, then drains it.
    // __mlock_folio sees the page is not on LRU (still in CPU 0's batch) and does nothing.
    if (mlock(addr, 4096) < 0) {
        perror("mlock");
    }
    
    // munmap the page on CPU 1.
    // Since the VMA is locked, it calls munlock_vma_folio, which adds the page
    // to CPU 1's mlock_fbatch with NO flags. munmap does not drain the batch.
    munmap(addr, 4096);
    
    SIGNAL(&step, 3);
    
    // Sleep until the test finishes.
    WAIT_ON(&step, 5);
    
    return NULL;
}

int main() {
    SETUP_UNBUFFERED_IO();
    
    // Pin main thread to CPU 2+ to avoid interfering with CPU 0 and 1.
    // If CPU 2 is not available, it will just fail and run anywhere.
    cpu_set_t set;
    CPU_ZERO(&set);
    for (int i = 2; i < 8; i++) {
        CPU_SET(i, &set);
    }
    sched_setaffinity(0, sizeof(set), &set);
    
    // Ensure CPU 1 is online initially.
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "1\n", 2);
        close(fd);
    }
    
    addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    if (addr == MAP_FAILED) {
        perror("mmap");
        return 1;
    }
    
    pthread_t t0, t1;
    pthread_create(&t0, NULL, thread0, NULL);
    pthread_create(&t1, NULL, thread1, NULL);
    
    SIGNAL(&step, 1);
    
    WAIT_ON(&step, 3);
    
    // Offline CPU 1.
    // This triggers page_alloc_cpu_dead -> mlock_drain_remote on a surviving CPU.
    // mlock_drain_remote calls __munlock_folio, which sees the page is not on LRU,
    // skips taking the LRU lock, and calls __zone_stat_mod_folio with preemption enabled,
    // triggering the warning.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "0\n", 2);
        close(fd);
    }
    
    SIGNAL(&step, 5);
    pthread_join(t0, NULL);
    pthread_join(t1, NULL);
    
    // Restore CPU 1.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "1\n", 2);
        close(fd);
    }
    
    return 0;
}
```

139/5 2026/08/27 19:32 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 6266
							output: 30
							thoughts: 310
						

Thoughts:
**My Thought Process on Reproducing the `__mod_zone_page_state` Warning**

Alright, so I've been digging into this `__mod_zone_page_state` warning that's showing up during CPU offline scenarios. It seems to be triggered when `__munlock_folio` calls `mlock_drain_remote`, which in turn is invoked by `page_alloc_cpu_dead` when a CPU is going offline. The core of the problem, as I understand it, is that `__mod_zone_page_state` is expecting preemption to be disabled, but it's finding preemption enabled when it's called.

Now, I just received some feedback from a capability probe. It looks like the probe successfully tested the ability to offline a CPU by reading from `/sys/devices/system/cpu/cpu1/online`, confirming the environment is ready for this operation. This means the basic setup for triggering the CPU offline path is likely in place. The feedback also suggests that for the *next* iteration, I should try writing "0" to that file to actually *initiate* the CPU offline process.

This is where a bit of confusion crept in for a moment. I thought my previous strategy *already* involved writing "0" to that file. But then I realized the feedback is coming from a *capability probe*. This probe just confirmed that the *mechanism* to offline a CPU works; it didn't necessarily execute the full scenario that leads to the bug. So, my previous strategy *was* heading in the right direction, but the probe's feedback is a confirmation and a refinement for the *next* step.

The crucial piece of advice from the feedback is that to reliably reproduce this bug, I'll likely need to ensure there are some `mlocked` pages on the CPU that's about to be offlined. This is because this condition forces `page_alloc_cpu_dead` to call `mlock_drain_remote`, which is the direct path to hitting that problematic `__mod_zone_page_state` warning.

So, my refined strategy is to:
1.  Ensure the system is set up to allow CPU offlining (which the probe has confirmed).
2.  Execute the write of "0" to `/sys/devices/system/cpu/cpu1/online` to initiate the CPU offline process for CPU1.
3.  *Crucially*, *before* initiating the offline, I need to actively `mlock()` or `mlockall()` some pages on that specific CPU (CPU1) to guarantee that `mlock_drain_remote` is called during the shutdown sequence.

I'm going to re-examine the source code for `mlock_drain_remote` and `__munlock_folio` to solidify my understanding of the exact interaction and ensure I'm not missing any subtle dependencies or edge cases that might prevent the warning from appearing even with `mlocked` pages present. This approach seems to be the most robust way to reliably hit the warning.


140/5 2026/08/27 19:33 tool codesearch-definition-source
0m Args:
map[ContextFile: Name:mlock_drain_remote]

Results:
map[SourceCode: 223:	void mlock_drain_remote(int cpu)
 224:	{
 225:		struct folio_batch *fbatch;
 226:	
 227:		WARN_ON_ONCE(cpu_online(cpu));
 228:		fbatch = &per_cpu(mlock_fbatch.fbatch, cpu);
 229:		if (folio_batch_count(fbatch))
 230:			mlock_folio_batch(fbatch);
 231:	}
 SourceFile:mm/mlock.c]

141/5 2026/08/27 19:33 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 6752
							output: 36
							thoughts: 12
						

Thoughts:
**My Thought Process on `mlock_folio_batch`**

Right, so the first thing on my mind is to dive into the `mlock_folio_batch` function. I want to get a really clear understanding of what it's doing, how it's structured, and what its core purpose is within the larger system. My initial focus will be on grasping its overall functionality – what problem does it aim to solve? What are the inputs and outputs? I'll be paying close attention to the logic flow, looking for any potential edge cases or non-obvious behaviors. I need to see if the implementation aligns with my expectations or if there are any surprises. Essentially, I'm looking to build a comprehensive mental model of this specific piece of code.


142/5 2026/08/27 19:33 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:mlock_folio_batch]

Results:
map[SourceCode: 179:	/*
 180:	 * mlock_folio_batch() is derived from folio_batch_move_lru(): perhaps that can
 181:	 * make use of such folio pointer flags in future, but for now just keep it for
 182:	 * mlock.  We could use three separate folio batches instead, but one feels
 183:	 * better (munlocking a full folio batch does not need to drain mlocking folio
 184:	 * batches first).
 185:	 */
 186:	static void mlock_folio_batch(struct folio_batch *fbatch)
 187:	{
 188:		struct lruvec *lruvec = NULL;
 189:		unsigned long mlock;
 190:		struct folio *folio;
 191:		int i;
 192:	
 193:		for (i = 0; i < folio_batch_count(fbatch); i++) {
 194:			folio = fbatch->folios[i];
 195:			mlock = (unsigned long)folio & (LRU_FOLIO | NEW_FOLIO);
 196:			folio = (struct folio *)((unsigned long)folio - mlock);
 197:			fbatch->folios[i] = folio;
 198:	
 199:			if (mlock & LRU_FOLIO)
 200:				lruvec = __mlock_folio(folio, lruvec);
 201:			else if (mlock & NEW_FOLIO)
 202:				lruvec = __mlock_new_folio(folio, lruvec);
 203:			else
 204:				lruvec = __munlock_folio(folio, lruvec);
 205:		}
 206:	
 207:		if (lruvec)
 208:			lruvec_unlock_irq(lruvec);
 209:		folios_put(fbatch);
 210:	}
 SourceFile:mm/mlock.c]

143/5 2026/08/27 19:33 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 7333
							output: 35
							thoughts: 11
						

Thoughts:
**My Deep Dive into `__munlock_folio`**

Alright, so my immediate inclination is to really scrutinize the `__munlock_folio` function. I need to understand its precise mechanics, its role within the broader memory management subsystem, and any potential implications it might have. This isn't just a casual glance; I'm talking about a thorough dissection. I want to know exactly what it *does*, the conditions under which it's called, and what its success or failure would mean for the system's stability and performance. I'll be looking for any edge cases, any potential race conditions, or anything that could lead to unexpected behavior. Essentially, I'm diving headfirst into this function to ensure I have an absolutely ironclad grasp of its functionality and its place in the system's architecture.


144/5 2026/08/27 19:33 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:__munlock_folio]

Results:
map[SourceCode: 122:	static struct lruvec *__munlock_folio(struct folio *folio, struct lruvec *lruvec)
 123:	{
 124:		int nr_pages = folio_nr_pages(folio);
 125:		bool isolated = false;
 126:	
 127:		if (!folio_test_clear_lru(folio))
 128:			goto munlock;
 129:	
 130:		isolated = true;
 131:		lruvec = folio_lruvec_relock_irq(folio, lruvec);
 132:	
 133:		if (folio_test_unevictable(folio)) {
 134:			/* Then mlock_count is maintained, but might undercount */
 135:			if (folio->mlock_count)
 136:				folio->mlock_count--;
 137:			if (folio->mlock_count)
 138:				goto out;
 139:		}
 140:		/* else assume that was the last mlock: reclaim will fix it if not */
 141:	
 142:	munlock:
 143:		if (folio_test_clear_mlocked(folio)) {
 144:			__zone_stat_mod_folio(folio, NR_MLOCK, -nr_pages);
 145:			if (isolated || !folio_test_unevictable(folio))
 146:				__count_vm_events(UNEVICTABLE_PGMUNLOCKED, nr_pages);
 147:			else
 148:				__count_vm_events(UNEVICTABLE_PGSTRANDED, nr_pages);
 149:		}
 150:	
 151:		/* folio_evictable() has to be checked *after* clearing Mlocked */
 152:		if (isolated && folio_test_unevictable(folio) && folio_evictable(folio)) {
 153:			lruvec_del_folio(lruvec, folio);
 154:			folio_clear_unevictable(folio);
 155:			lruvec_add_folio(lruvec, folio);
 156:			__count_vm_events(UNEVICTABLE_PGRESCUED, nr_pages);
 157:		}
 158:	out:
 159:		if (isolated)
 160:			folio_set_lru(folio);
 161:		return lruvec;
 162:	}
 SourceFile:mm/mlock.c]

145/5 2026/08/27 19:33 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 8056
							output: 37
							thoughts: 477
						

Thoughts:
**My Thought Process Regarding `__munlock_folio` and Folio State**

My current line of thinking is dissecting the execution path within `__munlock_folio`, specifically focusing on a potential race condition or unexpected state that leads to a warning.

I've observed that `__munlock_folio` will call `__zone_stat_mod_folio` if the `folio_test_clear_mlocked(folio)` condition evaluates to true. This is the primary branch I'm concerned with.

The logic then bifurcates based on `folio_test_clear_lru(folio)`. If this condition is *false*, the execution jumps directly to the `munlock:` label. Crucially, at this point, `__zone_stat_mod_folio` is called *without* acquiring the `lruvec` lock. This is significant because acquiring the `lruvec` lock typically involves disabling IRQs.

Now, here's where my concern solidifies: `__zone_stat_mod_folio` has an expectation that either preemption is disabled or IRQs are disabled before it's invoked.

If `folio_test_clear_lru(folio)` is false, as in the jump path, then the `isolated` flag is also false, and critically, the `lruvec` is *not* re-locked. This means IRQs are *not* explicitly disabled by the `folio_lruvec_relock_irq` mechanism.

I'm realizing a potential problem: if this is the *first* folio being processed in a batch (meaning `lruvec` is initially NULL), then IRQs are still enabled. However, if `lruvec` *was* already locked from a previous folio within the same batch, then IRQs *would* be disabled, and this specific issue wouldn't arise. But in the case where it's the first folio and `folio_test_clear_lru(folio)` is false, IRQs remain enabled.

The core of the problem is that `__zone_stat_mod_folio` proceeds to call `__mod_zone_page_state`. And `__mod_zone_page_state` relies on `this_cpu_read`, which, in turn, expects preemption to be disabled. Therefore, if `folio_test_clear_lru(folio)` is false (leading to enabled IRQs) and `folio_test_clear_mlocked(folio)` is true (triggering the call to `__zone_stat_mod_folio`), we hit the warning.

This leads me to the next crucial question: how can a folio be in the `mlock_fbatch` list (which is being processed by `munlock` operations, implied by `mlock == 0`) such that `folio_test_clear_lru(folio)` is false, yet `folio_test_clear_mlocked(folio)` is true?

My understanding is that if a folio is mlocked, it will have the `PG_mlocked` flag set. Conversely, if it's not on the LRU, the `PG_lru` flag will be clear. The puzzle is: can a folio be mlocked *and* not be on the LRU simultaneously?

My current hypothesis is that this can indeed happen. Specifically, if a folio is currently in the `lru_add` batch (or `lru_add_pvec`), it might be mlocked but not yet officially placed on the LRU. This state could be reached by operations like `mlock_vma_folio` or `munlock_vma_folio`, which are responsible for adding folios to the `mlock_fbatch`. I need to delve into the specifics of `munlock_vma_folio` to confirm this scenario and understand the exact transition that leads to this particular combination of flags.


146/5 2026/08/27 19:33 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:munlock_vma_folio]

Results:
map[SourceCode: 997:	static inline void munlock_vma_folio(struct folio *folio,
 998:						struct vm_area_struct *vma)
 999:	{
1000:		/*
1001:		 * munlock if the function is called. Ideally, we should only
1002:		 * do munlock if any page of folio is unmapped from VMA and
1003:		 * cause folio not fully mapped to VMA.
1004:		 *
1005:		 * But it's not easy to confirm that's the situation. So we
1006:		 * always munlock the folio and page reclaim will correct it
1007:		 * if it's wrong.
1008:		 */
1009:		if (unlikely(vma->vm_flags & VM_LOCKED))
1010:			munlock_folio(folio);
1011:	}
 SourceFile:mm/internal.h]

147/5 2026/08/27 19:33 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 8814
							output: 34
							thoughts: 10
						

Thoughts:
**My Thought Process**

Right, first things first, I need to investigate `munlock_folio`. That's where I'm going to start digging.


148/5 2026/08/27 19:33 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:munlock_folio]

Results:
map[SourceCode: 286:	/**
 287:	 * munlock_folio - munlock a folio
 288:	 * @folio: folio to be munlocked, either normal or a THP head.
 289:	 */
 290:	void munlock_folio(struct folio *folio)
 291:	{
 292:		struct folio_batch *fbatch;
 293:	
 294:		local_lock(&mlock_fbatch.lock);
 295:		fbatch = this_cpu_ptr(&mlock_fbatch.fbatch);
 296:		/*
 297:		 * folio_test_clear_mlocked(folio) must be left to __munlock_folio(),
 298:		 * which will check whether the folio is multiply mlocked.
 299:		 */
 300:		folio_get(folio);
 301:		if (!folio_batch_add(fbatch, folio) ||
 302:		    !folio_may_be_lru_cached(folio) || lru_cache_disabled())
 303:			mlock_folio_batch(fbatch);
 304:		local_unlock(&mlock_fbatch.lock);
 305:	}
 SourceFile:mm/mlock.c]

149/5 2026/08/27 19:33 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 9189
							output: 38
							thoughts: 93
						

Thoughts:
**My Thought Process Regarding `munlock_folio` and CPU Offline Handling**

Okay, so my initial focus lands on the `munlock_folio` function. My understanding is that when `munlock_folio` is called, it's responsible for adding the provided `folio` to a data structure called `mlock_fbatch`. Crucially, it does this *without* any special flags being set within the pointer used to manage this batch. This seems like a standard operation, adding an item to a collection.

However, my mind immediately jumps to a potential critical scenario: what happens if a CPU goes offline while these operations are in progress or while the folio is held in this batch? This is where the complexity arises. If a CPU goes offline, the system needs to handle any resources or data associated with that CPU's processing. My thought is that in such a situation, a function named `mlock_drain_remote` will be invoked. This function appears to be designed to process and clear out the `mlock_fbatch` that was specific to the CPU that has now gone offline.

Now, I'm pausing to trace the causality. I need to confirm *where* this `mlock_drain_remote` function is actually called from. My current hypothesis is that it's not a direct consequence of `munlock_folio` itself, but rather a downstream effect of the CPU going offline. Specifically, I'm suspecting that `page_alloc_cpu_dead` is the trigger. This function, as its name suggests, is likely involved in the cleanup and deallocation processes when a CPU is no longer active. Therefore, my next logical step is to delve into the implementation of `page_alloc_cpu_dead` to verify if it indeed orchestrates the call to `mlock_drain_remote` and, by extension, confirms my understanding of how `munlock_folio`'s additions to `mlock_fbatch` are handled during CPU offline events.


150/5 2026/08/27 19:33 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/page_alloc.c Name:page_alloc_cpu_dead]

Results:
map[SourceCode:6463:	static int page_alloc_cpu_dead(unsigned int cpu)
6464:	{
6465:		struct zone *zone;
6466:	
6467:		lru_add_drain_cpu(cpu);
6468:		mlock_drain_remote(cpu);
6469:		drain_pages(cpu);
6470:	
6471:		/*
6472:		 * Spill the event counters of the dead processor
6473:		 * into the current processors event counters.
6474:		 * This artificially elevates the count of the current
6475:		 * processor.
6476:		 */
6477:		vm_events_fold_cpu(cpu);
6478:	
6479:		/*
6480:		 * Zero the differential counters of the dead processor
6481:		 * so that the vm statistics are consistent.
6482:		 *
6483:		 * This is only okay since the processor is dead and cannot
6484:		 * race with what we are doing.
6485:		 */
6486:		cpu_vm_stats_fold(cpu);
6487:	
6488:		for_each_populated_zone(zone)
6489:			zone_pcp_update(zone, 0);
6490:	
6491:		return 0;
6492:	}
 SourceFile:mm/page_alloc.c]

151/5 2026/08/27 19:33 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 9705
							output: 37
							thoughts: 526
						

Thoughts:
**My Thought Process Unpacked: A Deep Dive into the LRU Drainage and MLOCK Interaction**

Ah, I've been following this logic, and a critical sequence of events has just clicked into place regarding how folios are handled when a CPU goes offline, specifically in relation to the LRU (Least Recently Used) lists and memory locking.

It seems the order of operations is paramount. I've noticed that `lru_add_drain_cpu(cpu)` is consistently called *before* `mlock_drain_remote(cpu)` during the CPU offline process. My understanding is that `lru_add_drain_cpu(cpu)` is designed to clear out the `lru_add` batch associated with a dead CPU. This means if a folio happens to be residing in that specific dead CPU's `lru_add` batch, it will be processed and moved to the actual LRU list *before* `mlock_drain_remote` even gets a chance to look at it.

This is where the potential problem arises, and I've been considering the edge cases. What if the folio *isn't* in the dead CPU's `lru_add` batch, but rather in *another* CPU's `lru_add` batch?

Let's trace that scenario. Imagine a folio is sitting in CPU 0's `lru_add` batch. Now, CPU 1 is being offlined. When CPU 1 is offlined, the kernel invokes `page_alloc_cpu_dead(1)`. This function, in turn, calls `lru_add_drain_cpu(1)`. As established, this drains CPU 1's `lru_add` batch. Crucially, it *doesn't* touch CPU 0's `lru_add` batch.

Following that, `mlock_drain_remote(1)` is called. This function is responsible for draining CPU 1's `mlock_fbatch`. If our folio is in CPU 0's `lru_add` batch, it's still there, not yet on the main LRU. Now, `mlock_drain_remote(1)` iterates through its batch (which includes our folio, if it was recently mlocked), and when it processes this folio, it finds it's still not on the LRU. This is where the critical failure occurs: the subsequent `__munlock_folio` call will detect that `!folio_test_clear_lru(folio)`. This condition will then cause it to jump to the `munlock:` label. From there, it proceeds to call `__zone_stat_mod_folio` with preemption enabled. This is precisely the condition that triggers the warning I'm seeing, because the folio isn't in the expected state on the LRU when the statistics are being updated.

I've also been exploring if it's even possible for a folio to be in CPU 0's `lru_add` batch and then be mlocked and subsequently munlocked on CPU 1. Yes, I believe it is. The path seems to be:

1.  CPU 0 allocates a page and adds it to its `lru_add` batch. This could happen, for instance, if the page is fault-in.
2.  CPU 1 then mlocks this page. The `mlock` operation will eventually call `mlock_folio_batch`, which, among other things, processes the folio.
3.  This `mlock` operation seems to add the folio to CPU 1's `mlock_fbatch` with the `LRU_FOLIO` flag set. I need to double-check the specifics within `mlock_vma_folio` to be absolutely certain about the precise interaction and flags involved here, but the general idea is that the folio can be in one CPU's `lru_add` batch and later be subject to mlock/munlock operations on another CPU, leading to this state where it's not properly on the LRU when `mlock_drain_remote` is invoked during an offline event.


152/5 2026/08/27 19:33 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:mlock_vma_folio]

Results:
map[SourceCode: 981:	static inline void mlock_vma_folio(struct folio *folio,
 982:					struct vm_area_struct *vma)
 983:	{
 984:		/*
 985:		 * The VM_SPECIAL check here serves two purposes.
 986:		 * 1) VM_IO check prevents migration from double-counting during mlock.
 987:		 * 2) Although mmap_region() and mlock_fixup() take care that VM_LOCKED
 988:		 *    is never left set on a VM_SPECIAL vma, there is an interval while
 989:		 *    file->f_op->mmap() is using vm_insert_page(s), when VM_LOCKED may
 990:		 *    still be set while VM_SPECIAL bits are added: so ignore it then.
 991:		 */
 992:		if (unlikely((vma->vm_flags & (VM_LOCKED|VM_SPECIAL)) == VM_LOCKED))
 993:			mlock_folio(folio);
 994:	}
 SourceFile:mm/internal.h]

153/5 2026/08/27 19:33 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10556
							output: 34
							thoughts: 10
						

Thoughts:
**My Thought Process on `mlock_folio`**

Okay, so my immediate thought is to dive into the `mlock_folio` functionality. I need to understand precisely what it's doing under the hood. This isn't just a quick glance; I want to get to the core of its operations. What are the underlying mechanisms it's employing? How is it interacting with the memory management system? What are the specific system calls it's leveraging, or if it's a kernel-level feature, what kernel structures and logic is it manipulating? I’m trying to anticipate potential edge cases and performance bottlenecks. Are there any implicit assumptions being made that could lead to unexpected behavior in certain scenarios? What are the resource implications – memory usage, CPU overhead, and importantly, any potential for locking contention or deadlocks? I’m also considering the broader context: how does `mlock_folio` fit into the larger memory management strategy? Is it a performance optimization, a security feature, or both? Understanding its purpose and limitations is crucial for me to correctly assess its impact.


154/5 2026/08/27 19:33 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:mlock_folio]

Results:
map[SourceCode: 238:	/**
 239:	 * mlock_folio - mlock a folio already on (or temporarily off) LRU
 240:	 * @folio: folio to be mlocked.
 241:	 */
 242:	void mlock_folio(struct folio *folio)
 243:	{
 244:		struct folio_batch *fbatch;
 245:	
 246:		local_lock(&mlock_fbatch.lock);
 247:		fbatch = this_cpu_ptr(&mlock_fbatch.fbatch);
 248:	
 249:		if (!folio_test_set_mlocked(folio)) {
 250:			int nr_pages = folio_nr_pages(folio);
 251:	
 252:			zone_stat_mod_folio(folio, NR_MLOCK, nr_pages);
 253:			__count_vm_events(UNEVICTABLE_PGMLOCKED, nr_pages);
 254:		}
 255:	
 256:		folio_get(folio);
 257:		if (!folio_batch_add(fbatch, mlock_lru(folio)) ||
 258:		    !folio_may_be_lru_cached(folio) || lru_cache_disabled())
 259:			mlock_folio_batch(fbatch);
 260:		local_unlock(&mlock_fbatch.lock);
 261:	}
 SourceFile:mm/mlock.c]

155/5 2026/08/27 19:33 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10997
							output: 35
							thoughts: 104
						

Thoughts:
**A Deep Dive into the `mlock_folio` Mechanism**

My initial observation is quite striking: the `mlock_folio` function appears to be directly responsible for setting the `PG_mlocked` flag within the page structure. This is confirmed by the conditional logic `if (!folio_test_set_mlocked(folio))`, which explicitly indicates that this function is where the flag is set and, crucially, that it handles the logic of avoiding redundant operations if the flag is already present. Beyond just setting the flag, it also seems to immediately update the relevant zone statistics, which suggests an immediate reflection of the mlocked status on memory accounting. Following this, the folio is integrated into the `mlock_fbatch` data structure. The use of `LRU_FOLIO` here, passed through `mlock_lru(folio)`, is particularly interesting. This implies that mlocked folios are being managed within an LRU (Least Recently Used) framework, which, on the face of it, might seem counterintuitive for locked pages. However, this hints at a more nuanced approach to managing memory pressure, perhaps allowing for more granular control or specific eviction policies for mlocked pages under extreme conditions. Finally, I note that if `mlock_folio_batch` is invoked, it will subsequently call `__mlock_folio`. This suggests a hierarchical or batched approach to mlocking, where the batch function orchestrates the individual mlocking operations, potentially for efficiency.


156/5 2026/08/27 19:33 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:__mlock_folio]

Results:
map[SourceCode:  61:	static struct lruvec *__mlock_folio(struct folio *folio, struct lruvec *lruvec)
  62:	{
  63:		/* There is nothing more we can do while it's off LRU */
  64:		if (!folio_test_clear_lru(folio))
  65:			return lruvec;
  66:	
  67:		lruvec = folio_lruvec_relock_irq(folio, lruvec);
  68:	
  69:		if (unlikely(folio_evictable(folio))) {
  70:			/*
  71:			 * This is a little surprising, but quite possible: PG_mlocked
  72:			 * must have got cleared already by another CPU.  Could this
  73:			 * folio be unevictable?  I'm not sure, but move it now if so.
  74:			 */
  75:			if (folio_test_unevictable(folio)) {
  76:				lruvec_del_folio(lruvec, folio);
  77:				folio_clear_unevictable(folio);
  78:				lruvec_add_folio(lruvec, folio);
  79:	
  80:				__count_vm_events(UNEVICTABLE_PGRESCUED,
  81:						  folio_nr_pages(folio));
  82:			}
  83:			goto out;
  84:		}
  85:	
  86:		if (folio_test_unevictable(folio)) {
  87:			if (folio_test_mlocked(folio))
  88:				folio->mlock_count++;
  89:			goto out;
  90:		}
  91:	
  92:		lruvec_del_folio(lruvec, folio);
  93:		folio_clear_active(folio);
  94:		folio_set_unevictable(folio);
  95:		folio->mlock_count = !!folio_test_mlocked(folio);
  96:		lruvec_add_folio(lruvec, folio);
  97:		__count_vm_events(UNEVICTABLE_PGCULLED, folio_nr_pages(folio));
  98:	out:
  99:		folio_set_lru(folio);
 100:		return lruvec;
 101:	}
 SourceFile:mm/mlock.c]

157/5 2026/08/27 19:33 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 11763
							output: 32
							thoughts: 677
						

Thoughts:
**My Thought Process Unraveling a Kernel Bug**

This is quite the rabbit hole I've gone down. It started with a subtle observation about how folios are handled when `PG_mlocked` is set but the folio isn't actually being moved to the unevictable list.

Here's the breakdown of what I've figured out:

The core of the issue lies in the interaction between `__mlock_folio`, `munlock_folio`, and how CPU offline events are processed. My initial observation was that if `!folio_test_clear_lru(folio)` is true when `__mlock_folio` is called, it basically does nothing. The `PG_mlocked` flag gets set, sure, but the folio isn't added to the unevictable list, and `mlock_count` isn't incremented. It remains in a sort of limbo.

Now, the problem really manifests when we `munlock` this "limbo" folio. `munlock_folio` adds it to the `mlock_fbatch` without any specific flags. If this batch isn't immediately drained (which it might not be), the folio just sits there.

The critical point arrives when a CPU goes offline. The `mlock_drain_remote` function is invoked, which in turn calls `mlock_folio_batch` and then `__munlock_folio`. Inside `__munlock_folio`, the check `!folio_test_clear_lru(folio)` is still false, as the folio is still lurking in the CPU 0's `lru_add` batch. This causes it to jump to the `munlock:` label.

At the `munlock:` label, it checks `folio_test_clear_mlocked(folio)`, which *is* true because `mlock_folio` initially set it. This is where the alarm bells should be ringing. It proceeds to call `__zone_stat_mod_folio(folio, NR_MLOCK, -nr_pages)`. The crucial detail here is that if `lruvec` is NULL, IRQs are enabled. And `__zone_stat_mod_folio` is expecting preemption to be disabled for its operations. Boom! A warning is triggered.

So, to trace the exact sequence of events that leads to this warning, it looks like this:

1.  **CPU 0**: A page is allocated, and it lands in CPU 0's `lru_add` batch.
2.  **CPU 1**: `mlock(page)` is called. This sets the `PG_mlocked` flag and adds the folio to CPU 1's `mlock_fbatch`.
3.  **CPU 1**: At some point, CPU 1's `mlock_fbatch` is drained (perhaps by `lru_add_drain()`). However, because `!PG_lru` is true, `__mlock_folio` effectively does nothing, leaving the folio in its awkward state.
4.  **CPU 1**: `munlock(page)` is called. This adds the folio back to CPU 1's `mlock_fbatch`.
5.  **CPU 1**: CPU 1 goes offline.
6.  **CPU 0 (or another active CPU)**: The `page_alloc_cpu_dead(1)` path is triggered, leading to `mlock_drain_remote(1)`, then `mlock_folio_batch`, and finally `__munlock_folio`.
7.  **Inside `__munlock_folio`**: The function sees `!PG_lru`, jumps to `munlock:`, clears `PG_mlocked`, and critically, calls `__zone_stat_mod_folio` with IRQs enabled, triggering the warning.

This leads me to question how we can ensure that `mlock(page)` actually *does* drain the `mlock_fbatch` and avoid this precarious state. My understanding is that the `mlock` system call itself, through `apply_vma_lock_flags` and `mlock_fixup`, eventually calls `mlock_page` or `mlock_vma_folio`. The next logical step for me is to dive into the `mlock` system call's implementation to see if it inherently handles draining the batch or if there's a missing piece there.


158/5 2026/08/27 19:33 tool codesearch-definition-source
0m Error:
log-in to see details

Args:
map[ContextFile:mm/mlock.c Name:mlock]

Results:
map[SourceCode: SourceFile:]

159/5 2026/08/27 19:33 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 12477
							output: 34
							thoughts: 11
						

Thoughts:
**My Thought Process on Exploring `sys_mlock`**

Okay, so my immediate instinct here, given the context (which I'm assuming involves system-level programming, memory management, or perhaps performance optimization related to memory), is to dive into the specifics of `sys_mlock`. I need to understand its exact functionality, its purpose, and how it operates at the kernel level.

My first step is to perform a search for `sys_mlock`. I anticipate this will lead me to documentation, man pages, or kernel source code that details its behavior. I'm looking for answers to a few key questions:

*   **What does `sys_mlock` *do*?** The name itself suggests memory locking. My hypothesis is that it prevents a specific range of memory pages from being swapped out to disk. This is a crucial detail for applications that require predictable memory latency and want to avoid the performance hit of page faults when accessing critical data structures or code.
*   **What are its parameters?** I need to know what arguments `sys_mlock` takes. Typically, such a system call would require a memory address and a size, specifying the region to be locked. Are there any flags or options I should be aware of?
*   **What are the implications of using it?** Locking memory has consequences. I need to consider:
    *   **Resource Consumption:** Locking memory directly impacts the available physical RAM. If I lock too much, I could starve other processes or even the kernel itself, leading to system instability or performance degradation elsewhere.
    *   **Permissions/Privileges:** Is `sys_mlock` an operation that any user can perform? My intuition is that it's likely a privileged operation, requiring root access or specific capabilities, precisely because of its potential to impact system resources.
    *   **Error Handling:** What are the possible error codes returned by `sys_mlock`? This will tell me about failures like insufficient memory, invalid arguments, or insufficient privileges.
    *   **Scope:** Does it lock pages within the current process's address space, or does it have a broader impact? (Likely the former, but good to confirm).
*   **When would I *use* `sys_mlock`?** I'm thinking about scenarios where low-latency memory access is paramount. This could include:
    *   Real-time systems.
    *   High-performance computing (HPC) applications where critical data sets need to remain in RAM.
    *   Security-sensitive applications where keeping sensitive data out of swap files is a requirement.
    *   Certain database or caching mechanisms.
*   **Are there related system calls?** If `sys_mlock` locks memory, there's almost certainly an `sys_munlock` to release it. I'll also want to look for `mlockall` and `munlockall` which operate on the entire process's address space. Understanding these counterparts is essential for proper resource management.

Ultimately, my search for `sys_mlock` is driven by a desire to understand a low-level mechanism for ensuring memory residency. I'm anticipating a need to fine-tune system performance or guarantee predictable behavior by directly controlling how the operating system manages memory for critical data. This is a deep dive into the heart of memory management, and I'm ready to extract the precise details.


160/5 2026/08/27 19:34 tool codesearch-definition-source
0m Error:
log-in to see details

Args:
map[ContextFile:mm/mlock.c Name:sys_mlock]

Results:
map[SourceCode: SourceFile:]

161/5 2026/08/27 19:34 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 12527
							output: 30
							thoughts: 15
						

Thoughts:
**My Thought Process**

Okay, so my immediate instinct when faced with understanding how `mlock` is implemented at the kernel level is to go straight to the source code. I need to find the definitive definition of this system call. The most efficient way to do that, given I'm likely working within a Linux kernel source tree or have it readily accessible, is to use `grep`.

Specifically, I'm looking for function definitions that are part of the kernel's system call interface and relate to `mlock`. The convention for defining system calls in the Linux kernel is `SYSCALL_DEFINE<n>`, where `<n>` represents the number of arguments the system call takes. Since I'm interested in `mlock` (and potentially `mlockall`), I'll use a wildcard to catch any variant and then filter by the name itself.

So, the command that pops into my head is `grep SYSCALL_DEFINE.*mlock`. This command will search through all files in the current directory and its subdirectories (assuming I'm in the right spot in the kernel source) for lines that start with `SYSCALL_DEFINE`, followed by any characters (`.`), and then contain `mlock`. This should pinpoint the exact definition of the `mlock` system call within the kernel's C code. Once I find that, I can then dive into the implementation details.


162/5 2026/08/27 19:34 tool grepper
0m Args:
map[Expression:SYSCALL_DEFINE.*mlock PathPrefix:mm/]

Results:
map[Output:mm/mlock.c=619=static __must_check int do_mlock(unsigned long start, size_t len,
--
mm/mlock.c-666-
mm/mlock.c:667:SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len)
mm/mlock.c-668-{
--
mm/mlock.c-673-
mm/mlock.c:674:SYSCALL_DEFINE3(mlock2, unsigned long, start, size_t, len, int, flags)
mm/mlock.c-675-{
--
mm/mlock.c=716=static int apply_mlockall_flags(int flags)
--
mm/mlock.c-757-
mm/mlock.c:758:SYSCALL_DEFINE1(mlockall, int, flags)
mm/mlock.c-759-{
]

163/5 2026/08/27 19:34 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 12803
							output: 34
							thoughts: 10
						

Thoughts:
**My Thought Process on `do_mlock`**

Alright, so my immediate thought is to dive into the `do_mlock` function. I need to understand its purpose and how it's implemented. My expertise in this area tells me this is likely related to memory locking, which is a critical performance and security consideration.

My first step is to examine its definition. I'm looking for its signature, what arguments it takes, and what it returns. This will give me a fundamental understanding of its interface and how I might interact with it.

Then, I'll trace the execution flow. Where is `do_mlock` called from? What are the conditions that lead to its invocation? Understanding the context in which it operates is crucial for grasping its full impact.

I'll pay close attention to the actual operations within `do_mlock`. What system calls is it making? Is it using `mlock()`, `mlockall()`, or perhaps a custom implementation? The specifics of these operations will reveal its intended behavior regarding memory protection and availability.

Furthermore, I'm curious about the implications. What are the potential benefits of using `do_mlock`? I'm thinking about reduced page faulting, improved real-time performance, and preventing sensitive data from being swapped out. Conversely, what are the potential downsides? I'll consider memory fragmentation, increased resource consumption, and potential deadlocks if not managed carefully.

Finally, I'll be looking for any error handling or edge case considerations. How does `do_mlock` behave when memory is unavailable, or when permissions are insufficient? Robustness is paramount, and understanding its failure modes is as important as understanding its success path.


164/5 2026/08/27 19:34 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:do_mlock]

Results:
map[SourceCode: 619:	static __must_check int do_mlock(unsigned long start, size_t len,
 620:					 vma_flags_t *flags)
 621:	{
 622:		unsigned long locked;
 623:		unsigned long lock_limit;
 624:		int error = -ENOMEM;
 625:	
 626:		start = untagged_addr(start);
 627:	
 628:		if (!can_do_mlock())
 629:			return -EPERM;
 630:	
 631:		len = PAGE_ALIGN(len + (offset_in_page(start)));
 632:		start &= PAGE_MASK;
 633:	
 634:		lock_limit = rlimit(RLIMIT_MEMLOCK);
 635:		lock_limit >>= PAGE_SHIFT;
 636:		locked = len >> PAGE_SHIFT;
 637:	
 638:		if (mmap_write_lock_killable(current->mm))
 639:			return -EINTR;
 640:	
 641:		locked += current->mm->locked_vm;
 642:		if ((locked > lock_limit) && (!capable(CAP_IPC_LOCK))) {
 643:			/*
 644:			 * It is possible that the regions requested intersect with
 645:			 * previously mlocked areas, that part area in "mm->locked_vm"
 646:			 * should not be counted to new mlock increment count. So check
 647:			 * and adjust locked count if necessary.
 648:			 */
 649:			locked -= count_mm_mlocked_page_nr(current->mm,
 650:					start, len);
 651:		}
 652:	
 653:		/* check against resource limits */
 654:		if ((locked <= lock_limit) || capable(CAP_IPC_LOCK))
 655:			error = apply_vma_lock_flags(start, len, flags);
 656:	
 657:		mmap_write_unlock(current->mm);
 658:		if (error)
 659:			return error;
 660:	
 661:		error = __mm_populate(start, len, 0);
 662:		if (error)
 663:			return __mlock_posix_error_return(error);
 664:		return 0;
 665:	}
 SourceFile:mm/mlock.c]

165/5 2026/08/27 19:34 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 13528
							output: 34
							thoughts: 317
						

Thoughts:
**My Thought Process Regarding Page Faulting and `mlock`**

Okay, so I'm thinking about how `__mm_populate` is going to bring pages into memory. My initial thought is that this process, faulting in pages, will naturally add them to the CPU's Least Recently Used (LRU) add batch. This seems straightforward enough.

However, I'm immediately hit with a crucial realization: if `mlock` itself is what triggers the page faulting (which it often does, or at least the scenario I'm considering involves it), then those faulted-in pages will end up in the `lru_add` batch of *whatever CPU happens to be running `mlock` at that moment*.

This is where the problem arises. If CPU 1 is executing `mlock`, and `mlock` causes the pages to fault in, those pages will be added to CPU 1's `lru_add` batch. Following that, `mlock` will set the `PG_mlocked` flag on these pages and, importantly, add them to CPU 1's `mlock_fbatch` (the batch for mlocked pages that have been faulted in).

The critical issue is that I need these pages to end up in CPU 0's `lru_add` batch. This is a requirement for some subsequent operation or optimization I'm aiming for. The current flow, where `mlock` on CPU 1 dictates the batch, is fundamentally misaligned with my objective.

Therefore, the logical solution is to preemptively fault these pages in on CPU 0 *before* I even consider calling `mlock` on CPU 1. If I force the initial faulting to happen on CPU 0, those pages will correctly be placed into CPU 0's `lru_add` batch.

Now, I move to the `mlock` call on CPU 1. What happens then? `mlock` will invoke `apply_vma_lock_flags`. My understanding is that `apply_vma_lock_flags` primarily focuses on updating the Virtual Memory Area (VMA) flags, specifically setting the `VM_LOCKED` flag. I need to double-check this, but my current understanding is that it *does not* iterate over the individual pages at this stage; it's a VMA-level operation.

So, after `apply_vma_lock_flags` has set the VMA flags, the system will likely proceed to call `__mm_populate` again. This is where it gets interesting. If the pages have *already been faulted in* on CPU 0 (as per my planned preemptive step), what does `__mm_populate` do? My hypothesis is that `__mm_populate` won't re-fault them. Instead, it will likely perform a lookup to see that they are already present and then proceed to call a function like `mlock_vma_folio`. This seems to be the path where the pre-faulted pages are then integrated into the mlocked state without triggering new faults on CPU 1. I need to confirm the exact behavior of `__mm_populate` in this scenario to be certain.


166/5 2026/08/27 19:34 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/gup.c Name:__mm_populate]

Results:
map[SourceCode:1918:	/*
1919:	 * __mm_populate - populate and/or mlock pages within a range of address space.
1920:	 *
1921:	 * This is used to implement mlock() and the MAP_POPULATE / MAP_LOCKED mmap
1922:	 * flags. VMAs must be already marked with the desired vm_flags, and
1923:	 * mmap_lock must not be held.
1924:	 */
1925:	int __mm_populate(unsigned long start, unsigned long len, int ignore_errors)
1926:	{
1927:		struct mm_struct *mm = current->mm;
1928:		unsigned long end, nstart, nend;
1929:		struct vm_area_struct *vma = NULL;
1930:		int locked = 0;
1931:		long ret = 0;
1932:	
1933:		end = start + len;
1934:	
1935:		for (nstart = start; nstart < end; nstart = nend) {
1936:			/*
1937:			 * We want to fault in pages for [nstart; end) address range.
1938:			 * Find first corresponding VMA.
1939:			 */
1940:			if (!locked) {
1941:				locked = 1;
1942:				mmap_read_lock(mm);
1943:				vma = find_vma_intersection(mm, nstart, end);
1944:			} else if (nstart >= vma->vm_end)
1945:				vma = find_vma_intersection(mm, vma->vm_end, end);
1946:	
1947:			if (!vma)
1948:				break;
1949:			/*
1950:			 * Set [nstart; nend) to intersection of desired address
1951:			 * range with the first VMA. Also, skip undesirable VMA types.
1952:			 */
1953:			nend = min(end, vma->vm_end);
1954:			if (vma->vm_flags & (VM_IO | VM_PFNMAP))
1955:				continue;
1956:			if (nstart < vma->vm_start)
1957:				nstart = vma->vm_start;
1958:			/*
1959:			 * Now fault in a range of pages. populate_vma_page_range()
1960:			 * double checks the vma flags, so that it won't mlock pages
1961:			 * if the vma was already munlocked.
1962:			 */
1963:			ret = populate_vma_page_range(vma, nstart, nend, &locked);
1964:			if (ret < 0) {
1965:				if (ignore_errors) {
1966:					ret = 0;
1967:					continue;	/* continue at next VMA */
1968:				}
1969:				break;
1970:			}
1971:			nend = nstart + ret * PAGE_SIZE;
1972:			ret = 0;
1973:		}
1974:		if (locked)
1975:			mmap_read_unlock(mm);
1976:		return ret;	/* 0 or negative error code */
1977:	}
 SourceFile:mm/gup.c]

167/5 2026/08/27 19:34 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 14813
							output: 38
							thoughts: 22
						

Thoughts:
**My Thought Process on `populate_vma_page_range` and its Relatives**

Right, so when I'm faced with the task of populating a virtual memory area (VMA) page range – which, let's be honest, is a pretty fundamental operation in memory management – my immediate thought is about the underlying mechanism that actually brings those pages into physical memory. My mental model immediately points towards `populate_vma_page_range` as the entry point, or at least a key function orchestrating this.

However, I know these things rarely operate in isolation. `populate_vma_page_range` isn't going to be doing the heavy lifting of fetching data from disk or allocating physical frames itself. It's more likely a higher-level manager. My intuition, honed by experience with kernel memory management, tells me it must delegate the actual page population to a more specialized function.

And that's where the "or similar" part comes in. My mind immediately drifts to functions that deal with page faults or page table manipulation, because that's precisely what needs to happen when a VMA needs to be populated – a page fault is triggered, and the kernel's page fault handler needs to intervene. Therefore, I'm anticipating that `populate_vma_page_range` will, in some way, invoke something like `faultin_page_range`.

This connection is crucial. `faultin_page_range`, or whatever its exact name might be in the specific kernel version I'm analyzing, is where the real work of resolving a page fault happens. It's responsible for figuring out *why* the page fault occurred (e.g., is it a demand-paged executable, a shared memory segment, or an anonymous mapping?), locating the relevant data (if any), allocating a physical page frame, mapping that frame into the VMA's page table entry, and finally, updating the page table to reflect the presence of the now-populated page.

So, my thought process is essentially: `populate_vma_page_range` is the high-level request to ensure a range of virtual memory is backed by physical memory. This request, in turn, will trigger the kernel's page fault handling machinery, and the core logic for resolving individual page faults within that range will reside in a function like `faultin_page_range`. It's a chain of command, with `populate_vma_page_range` initiating the process and `faultin_page_range` (or its equivalent) executing the critical steps of bringing the data into physical memory.


168/5 2026/08/27 19:34 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/gup.c Name:populate_vma_page_range]

Results:
map[SourceCode:1793:	/**
1794:	 * populate_vma_page_range() -  populate a range of pages in the vma.
1795:	 * @vma:   target vma
1796:	 * @start: start address
1797:	 * @end:   end address
1798:	 * @locked: whether the mmap_lock is still held
1799:	 *
1800:	 * This takes care of mlocking the pages too if VM_LOCKED is set.
1801:	 *
1802:	 * Return either number of pages pinned in the vma, or a negative error
1803:	 * code on error.
1804:	 *
1805:	 * vma->vm_mm->mmap_lock must be held.
1806:	 *
1807:	 * If @locked is NULL, it may be held for read or write and will
1808:	 * be unperturbed.
1809:	 *
1810:	 * If @locked is non-NULL, it must held for read only and may be
1811:	 * released.  If it's released, *@locked will be set to 0.
1812:	 */
1813:	long populate_vma_page_range(struct vm_area_struct *vma,
1814:			unsigned long start, unsigned long end, int *locked)
1815:	{
1816:		struct mm_struct *mm = vma->vm_mm;
1817:		unsigned long nr_pages = (end - start) / PAGE_SIZE;
1818:		int local_locked = 1;
1819:		int gup_flags;
1820:		long ret;
1821:	
1822:		VM_WARN_ON_ONCE(!PAGE_ALIGNED(start));
1823:		VM_WARN_ON_ONCE(!PAGE_ALIGNED(end));
1824:		VM_WARN_ON_ONCE_VMA(start < vma->vm_start, vma);
1825:		VM_WARN_ON_ONCE_VMA(end   > vma->vm_end, vma);
1826:		mmap_assert_locked(mm);
1827:	
1828:		/*
1829:		 * Rightly or wrongly, the VM_LOCKONFAULT case has never used
1830:		 * faultin_page() to break COW, so it has no work to do here.
1831:		 */
1832:		if (vma->vm_flags & VM_LOCKONFAULT)
1833:			return nr_pages;
1834:	
1835:		/* ... similarly, we've never faulted in PROT_NONE pages */
1836:		if (!vma_is_accessible(vma))
1837:			return -EFAULT;
1838:	
1839:		gup_flags = FOLL_TOUCH;
1840:		/*
1841:		 * We want to touch writable mappings with a write fault in order
1842:		 * to break COW, except for shared mappings because these don't COW
1843:		 * and we would not want to dirty them for nothing.
1844:		 *
1845:		 * Otherwise, do a read fault, and use FOLL_FORCE in case it's not
1846:		 * readable (ie write-only or executable).
1847:		 */
1848:		if ((vma->vm_flags & (VM_WRITE | VM_SHARED)) == VM_WRITE)
1849:			gup_flags |= FOLL_WRITE;
1850:		else
1851:			gup_flags |= FOLL_FORCE;
1852:	
1853:		if (locked)
1854:			gup_flags |= FOLL_UNLOCKABLE;
1855:	
1856:		/*
1857:		 * We made sure addr is within a VMA, so the following will
1858:		 * not result in a stack expansion that recurses back here.
1859:		 */
1860:		ret = __get_user_pages(mm, start, nr_pages, gup_flags,
1861:				       NULL, locked ? locked : &local_locked);
1862:		lru_add_drain();
1863:		return ret;
1864:	}
 SourceFile:mm/gup.c]

169/5 2026/08/27 19:34 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 16041
							output: 36
							thoughts: 249
						

Thoughts:
**My Thought Process Unraveling the `mlock` and `lru_add` Interaction**

It dawns on me that `populate_vma_page_range` makes a call to `lru_add_drain()`. This is a crucial connection. My immediate thought is: if `lru_add_drain()` is invoked, it means the `lru_add` batch associated with the *current* CPU running the `mlock` operation will be drained.

Then, a more specific scenario pops into my head. Imagine a page was initially faulted in on CPU 0. This would place it into CPU 0's local `lru_add` batch. Now, let's say CPU 1 subsequently calls `mlock`. The `mlock` operation, in turn, calls `populate_vma_page_range`. This function, as I know, might call `__get_user_pages`. Now, `__get_user_pages` could very well find that the page we're interested in is *already present* in memory.

Following this, `populate_vma_page_range` proceeds to call `lru_add_drain()`. Here's where the potential misunderstanding lies. My initial thought might have been that `lru_add_drain()` drains *all* `lru_add` batches, or at least the one on the originating CPU (CPU 0 in my example). However, I quickly correct myself: `lru_add_drain()` operates on the *local* CPU's `lru_add` batch. It *does not* drain the batch on CPU 0.

Therefore, the page that was faulted in on CPU 0 and added to its `lru_add` batch remains there, unaffected by the `lru_add_drain()` call on CPU 1. This means the page is still in CPU 0's `lru_add` batch, which has significant implications for memory management and LRU eviction policies.

This realization then prompts a deeper dive into the specifics. I start questioning: does `__get_user_pages` itself have a path that might directly call `mlock_vma_folio` in this context? To confirm, I decide I need to meticulously inspect the source code of `__get_user_pages`.


170/5 2026/08/27 19:34 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/gup.c Name:__get_user_pages]

Results:
map[SourceCode:1300:	/**
1301:	 * __get_user_pages() - pin user pages in memory
1302:	 * @mm:		mm_struct of target mm
1303:	 * @start:	starting user address
1304:	 * @nr_pages:	number of pages from start to pin
1305:	 * @gup_flags:	flags modifying pin behaviour
1306:	 * @pages:	array that receives pointers to the pages pinned.
1307:	 *		Should be at least nr_pages long. Or NULL, if caller
1308:	 *		only intends to ensure the pages are faulted in.
1309:	 * @locked:     whether we're still with the mmap_lock held
1310:	 *
1311:	 * Returns either number of pages pinned (which may be less than the
1312:	 * number requested), or an error. Details about the return value:
1313:	 *
1314:	 * -- If nr_pages is 0, returns 0.
1315:	 * -- If nr_pages is >0, but no pages were pinned, returns -errno.
1316:	 * -- If nr_pages is >0, and some pages were pinned, returns the number of
1317:	 *    pages pinned. Again, this may be less than nr_pages.
1318:	 * -- 0 return value is possible when the fault would need to be retried.
1319:	 *
1320:	 * The caller is responsible for releasing returned @pages, via put_page().
1321:	 *
1322:	 * Must be called with mmap_lock held.  It may be released.  See below.
1323:	 *
1324:	 * __get_user_pages walks a process's page tables and takes a reference to
1325:	 * each struct page that each user address corresponds to at a given
1326:	 * instant. That is, it takes the page that would be accessed if a user
1327:	 * thread accesses the given user virtual address at that instant.
1328:	 *
1329:	 * This does not guarantee that the page exists in the user mappings when
1330:	 * __get_user_pages returns, and there may even be a completely different
1331:	 * page there in some cases (eg. if mmapped pagecache has been invalidated
1332:	 * and subsequently re-faulted). However it does guarantee that the page
1333:	 * won't be freed completely. And mostly callers simply care that the page
1334:	 * contains data that was valid *at some point in time*. Typically, an IO
1335:	 * or similar operation cannot guarantee anything stronger anyway because
1336:	 * locks can't be held over the syscall boundary.
1337:	 *
1338:	 * If @gup_flags & FOLL_WRITE == 0, the page must not be written to. If
1339:	 * the page is written to, set_page_dirty (or set_page_dirty_lock, as
1340:	 * appropriate) must be called after the page is finished with, and
1341:	 * before put_page is called.
1342:	 *
1343:	 * If FOLL_UNLOCKABLE is set without FOLL_NOWAIT then the mmap_lock may
1344:	 * be released. If this happens *@locked will be set to 0 on return.
1345:	 *
1346:	 * A caller using such a combination of @gup_flags must therefore hold the
1347:	 * mmap_lock for reading only, and recognize when it's been released. Otherwise,
1348:	 * it must be held for either reading or writing and will not be released.
1349:	 *
1350:	 * In most cases, get_user_pages or get_user_pages_fast should be used
1351:	 * instead of __get_user_pages. __get_user_pages should be used only if
1352:	 * you need some special @gup_flags.
1353:	 */
1354:	static long __get_user_pages(struct mm_struct *mm,
1355:			unsigned long start, unsigned long nr_pages,
1356:			unsigned int gup_flags, struct page **pages,
1357:			int *locked)
1358:	{
1359:		long ret = 0, i = 0;
1360:		struct vm_area_struct *vma = NULL;
1361:		unsigned long page_mask = 0;
1362:	
1363:		if (!nr_pages)
1364:			return 0;
1365:	
1366:		start = untagged_addr_remote(mm, start);
1367:	
1368:		VM_WARN_ON_ONCE(!!pages != !!(gup_flags & (FOLL_GET | FOLL_PIN)));
1369:	
1370:		/* FOLL_GET and FOLL_PIN are mutually exclusive. */
1371:		VM_WARN_ON_ONCE((gup_flags & (FOLL_PIN | FOLL_GET)) ==
1372:				(FOLL_PIN | FOLL_GET));
1373:	
1374:		do {
1375:			struct page *page;
1376:			unsigned int page_increm;
1377:	
1378:			/* first iteration or cross vma bound */
1379:			if (!vma || start >= vma->vm_end) {
1380:				/*
1381:				 * MADV_POPULATE_(READ|WRITE) wants to handle VMA
1382:				 * lookups+error reporting differently.
1383:				 */
1384:				if (gup_flags & FOLL_MADV_POPULATE) {
1385:					vma = vma_lookup(mm, start);
1386:					if (!vma) {
1387:						ret = -ENOMEM;
1388:						goto out;
1389:					}
1390:					if (check_vma_flags(vma, gup_flags)) {
1391:						ret = -EINVAL;
1392:						goto out;
1393:					}
1394:					goto retry;
1395:				}
1396:				vma = gup_vma_lookup(mm, start);
1397:				if (!vma && in_gate_area(mm, start)) {
1398:					ret = get_gate_page(mm, start & PAGE_MASK,
1399:							gup_flags, &vma,
1400:							pages ? &page : NULL);
1401:					if (ret)
1402:						goto out;
1403:					page_mask = 0;
1404:					goto next_page;
1405:				}
1406:	
1407:				if (!vma) {
1408:					ret = -EFAULT;
1409:					goto out;
1410:				}
1411:				ret = check_vma_flags(vma, gup_flags);
1412:				if (ret)
1413:					goto out;
1414:			}
1415:	retry:
1416:			/*
1417:			 * If we have a pending SIGKILL, don't keep faulting pages and
1418:			 * potentially allocating memory.
1419:			 */
1420:			if (fatal_signal_pending(current)) {
1421:				ret = -EINTR;
1422:				goto out;
1423:			}
1424:			cond_resched();
1425:	
1426:			page = follow_page_mask(vma, start, gup_flags, &page_mask);
1427:			if (!page || PTR_ERR(page) == -EMLINK) {
1428:				ret = faultin_page(vma, start, gup_flags,
1429:						   PTR_ERR(page) == -EMLINK, locked);
1430:				switch (ret) {
1431:				case 0:
1432:					goto retry;
1433:				case -EBUSY:
1434:				case -EAGAIN:
1435:					ret = 0;
1436:					fallthrough;
1437:				case -EFAULT:
1438:				case -ENOMEM:
1439:				case -EHWPOISON:
1440:					goto out;
1441:				}
1442:				BUG();
1443:			} else if (PTR_ERR(page) == -EEXIST) {
1444:				/*
1445:				 * Proper page table entry exists, but no corresponding
1446:				 * struct page. If the caller expects **pages to be
1447:				 * filled in, bail out now, because that can't be done
1448:				 * for this page.
1449:				 */
1450:				if (pages) {
1451:					ret = PTR_ERR(page);
1452:					goto out;
1453:				}
1454:			} else if (IS_ERR(page)) {
1455:				ret = PTR_ERR(page);
1456:				goto out;
1457:			}
1458:	next_page:
1459:			page_increm = 1 + (~(start >> PAGE_SHIFT) & page_mask);
1460:			if (page_increm > nr_pages)
1461:				page_increm = nr_pages;
1462:	
1463:			if (pages) {
1464:				struct page *subpage;
1465:				unsigned int j;
1466:	
1467:				/*
1468:				 * This must be a large folio (and doesn't need to
1469:				 * be the whole folio; it can be part of it), do
1470:				 * the refcount work for all the subpages too.
1471:				 *
1472:				 * NOTE: here the page may not be the head page
1473:				 * e.g. when start addr is not thp-size aligned.
1474:				 * try_grab_folio() should have taken care of tail
1475:				 * pages.
1476:				 */
1477:				if (page_increm > 1) {
1478:					struct folio *folio = page_folio(page);
1479:	
1480:					/*
1481:					 * Since we already hold refcount on the
1482:					 * large folio, this should never fail.
1483:					 */
1484:					if (try_grab_folio(folio, page_increm - 1,
1485:							   gup_flags)) {
1486:						/*
1487:						 * Release the 1st page ref if the
1488:						 * folio is problematic, fail hard.
1489:						 */
1490:						gup_put_folio(folio, 1, gup_flags);
1491:						ret = -EFAULT;
1492:						goto out;
1493:					}
1494:				}
1495:	
1496:				for (j = 0; j < page_increm; j++) {
1497:					subpage = page + j;
1498:					pages[i + j] = subpage;
1499:					flush_anon_page(vma, subpage, start + j * PAGE_SIZE);
1500:					flush_dcache_page(subpage);
1501:				}
1502:			}
1503:	
1504:			i += page_increm;
1505:			start += page_increm * PAGE_SIZE;
1506:			nr_pages -= page_increm;
1507:		} while (nr_pages);
1508:	out:
1509:		return i ? i : ret;
1510:	}
 SourceFile:mm/gup.c]

171/5 2026/08/27 19:34 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 19590
							output: 34
							thoughts: 48
						

Thoughts:
**My Thought Process**

Okay, so I was reviewing the code related to memory management, specifically around page fault handling and how memory is locked. My initial assumption, based on a quick scan or prior knowledge, was that the `__get_user_pages` function – which is crucial for pinning user pages in memory – would directly invoke `mlock_vma_folio`. This function, as I understand it, is the mechanism for actually acquiring and locking a folio (a contiguous block of memory) under an mlock request.

However, upon digging deeper, I realized I had made a misstep in my assumption. I checked the implementation or the call graph and discovered that `__get_user_pages` *does not*, in fact, directly call `mlock_vma_folio`. This is a significant point; it means my initial mental model of the execution flow was incorrect, and I needed to trace the actual path.

This immediately led me to the next critical question: If `__get_user_pages` isn't the direct caller, then where *is* `mlock_vma_folio` invoked? My next logical step was to systematically examine the functions that interact with or are called by `__get_user_pages`, looking for the missing link. My intuition pointed me towards the core page fault handling routines, as memory locking often happens in response to access attempts that trigger faults. Therefore, I decided to specifically investigate the `faultin_page` function. My hypothesis is that `faultin_page` likely plays a role in orchestrating the necessary steps, including acquiring and locking the pages, and it's within its logic that the call to `mlock_vma_folio` would be found. This is where my current line of inquiry is focused.


172/5 2026/08/27 19:34 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/gup.c Name:faultin_page]

Results:
map[SourceCode:1082:	/*
1083:	 * mmap_lock must be held on entry.  If @flags has FOLL_UNLOCKABLE but not
1084:	 * FOLL_NOWAIT, the mmap_lock may be released.  If it is, *@locked will be set
1085:	 * to 0 and -EBUSY returned.
1086:	 */
1087:	static int faultin_page(struct vm_area_struct *vma,
1088:			unsigned long address, unsigned int flags, bool unshare,
1089:			int *locked)
1090:	{
1091:		unsigned int fault_flags = 0;
1092:		vm_fault_t ret;
1093:	
1094:		if (flags & FOLL_NOFAULT)
1095:			return -EFAULT;
1096:		if (flags & FOLL_WRITE)
1097:			fault_flags |= FAULT_FLAG_WRITE;
1098:		if (flags & FOLL_REMOTE)
1099:			fault_flags |= FAULT_FLAG_REMOTE;
1100:		if (flags & FOLL_UNLOCKABLE) {
1101:			fault_flags |= FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
1102:			/*
1103:			 * FAULT_FLAG_INTERRUPTIBLE is opt-in. GUP callers must set
1104:			 * FOLL_INTERRUPTIBLE to enable FAULT_FLAG_INTERRUPTIBLE.
1105:			 * That's because some callers may not be prepared to
1106:			 * handle early exits caused by non-fatal signals.
1107:			 */
1108:			if (flags & FOLL_INTERRUPTIBLE)
1109:				fault_flags |= FAULT_FLAG_INTERRUPTIBLE;
1110:		}
1111:		if (flags & FOLL_NOWAIT)
1112:			fault_flags |= FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_RETRY_NOWAIT;
1113:		if (flags & FOLL_TRIED) {
1114:			/*
1115:			 * Note: FAULT_FLAG_ALLOW_RETRY and FAULT_FLAG_TRIED
1116:			 * can co-exist
1117:			 */
1118:			fault_flags |= FAULT_FLAG_TRIED;
1119:		}
1120:		if (unshare) {
1121:			fault_flags |= FAULT_FLAG_UNSHARE;
1122:			/* FAULT_FLAG_WRITE and FAULT_FLAG_UNSHARE are incompatible */
1123:			VM_WARN_ON_ONCE(fault_flags & FAULT_FLAG_WRITE);
1124:		}
1125:	
1126:		ret = handle_mm_fault(vma, address, fault_flags, NULL);
1127:	
1128:		if (ret & VM_FAULT_COMPLETED) {
1129:			/*
1130:			 * With FAULT_FLAG_RETRY_NOWAIT we'll never release the
1131:			 * mmap lock in the page fault handler. Sanity check this.
1132:			 */
1133:			WARN_ON_ONCE(fault_flags & FAULT_FLAG_RETRY_NOWAIT);
1134:			*locked = 0;
1135:	
1136:			/*
1137:			 * We should do the same as VM_FAULT_RETRY, but let's not
1138:			 * return -EBUSY since that's not reflecting the reality of
1139:			 * what has happened - we've just fully completed a page
1140:			 * fault, with the mmap lock released.  Use -EAGAIN to show
1141:			 * that we want to take the mmap lock _again_.
1142:			 */
1143:			return -EAGAIN;
1144:		}
1145:	
1146:		if (ret & VM_FAULT_ERROR) {
1147:			int err = vm_fault_to_errno(ret, flags);
1148:	
1149:			if (err)
1150:				return err;
1151:			BUG();
1152:		}
1153:	
1154:		if (ret & VM_FAULT_RETRY) {
1155:			if (!(fault_flags & FAULT_FLAG_RETRY_NOWAIT))
1156:				*locked = 0;
1157:			return -EBUSY;
1158:		}
1159:	
1160:		return 0;
1161:	}
 SourceFile:mm/gup.c]

173/5 2026/08/27 19:34 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 20948
							output: 52
							thoughts: 39
						

Thoughts:
**My Thought Process Regarding `mlock_vma_folio` and its Call Site**

Okay, so my initial thought was to quickly identify the context in which `mlock_vma_folio` is invoked. I had a hunch it might be related to memory fault handling, specifically within `handle_mm_fault`. However, I'm not entirely confident about that direct link, and it's crucial to be precise, especially given my expertise. Therefore, my immediate next step is to explicitly verify this. I need to perform a targeted search for `mlock_vma_folio` to see its call sites and confirm or refute my initial assumption about `handle_mm_fault`. This structured approach ensures I'm building my understanding on solid ground rather than relying on potentially faulty intuition.


174/5 2026/08/27 19:34 tool codesearch-find-references
0m Args:
map[ContextFile:mm/mlock.c IncludeSnippetLines:0 Name:mlock_vma_folio SourceTreePrefix:mm/]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__folio_add_anon_rmap SourceFile:mm/rmap.c SourceLine:1576] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__folio_add_file_rmap SourceFile:mm/rmap.c SourceLine:1715] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:folio_referenced_one SourceFile:mm/rmap.c SourceLine:948] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:try_to_unmap_one SourceFile:mm/rmap.c SourceLine:2263]] TruncatedOutput:false]

175/5 2026/08/27 19:34 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 21165
							output: 35
							thoughts: 272
						

Thoughts:
**My Thought Process Unraveling the `mlock` Behavior for Already Mapped Pages**

Okay, let me trace this out. I'm trying to understand how `mlock` handles pages that are *already* mapped into a VMA when `mlock` is called. My initial understanding was that `mlock_vma_folio` is the key function, and I see it's invoked by `__folio_add_anon_rmap` and `__folio_add_file_rmap`. This leads me to believe that when a page gets mapped into a VMA, if that VMA is locked *at the time of mapping*, the page itself becomes `mlocked`.

This seems straightforward enough. But then I hit a snag. Imagine this scenario: a page faults in on CPU 0 and gets mapped into a VMA. Crucially, at that precise moment, the VMA is *not* locked. So, based on my initial premise, this page would *not* be `mlocked` yet.

Now, fast forward. On CPU 1, I call `mlock`. My understanding is that `mlock` will then set the `VM_LOCKED` flag on the relevant VMA. Following the call chain, `mlock` calls `__mm_populate`, which in turn calls `populate_vma_page_range`. This then calls `__get_user_pages`.

And here's where my confusion really sets in. `__get_user_pages` will eventually call `follow_page_mask`. In my scenario, the page is *already mapped* into the VMA. So, `follow_page_mask` is going to find this page and return it directly. The critical point is that if `__get_user_pages` *already* finds the page, it doesn't need to do any actual population or fetching. It just returns what it found.

This leads me to the core of my dilemma: if `__get_user_pages` simply returns an already mapped page without going through the usual population steps, does it ever call `mlock_vma_folio`? My current understanding suggests it *wouldn't*. And if `mlock_vma_folio` isn't called for these pre-mapped pages, then how on earth does `mlock` actually ensure that already mapped pages within a now-locked VMA become `mlocked`? This seems to contradict the expected behavior of `mlock`. I need to dive deeper into `follow_page_mask` to see if there's a subtle path I'm missing that handles this case.


176/5 2026/08/27 19:34 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/gup.c Name:follow_page_mask]

Results:
map[SourceCode: 987:	/**
 988:	 * follow_page_mask - look up a page descriptor from a user-virtual address
 989:	 * @vma: vm_area_struct mapping @address
 990:	 * @address: virtual address to look up
 991:	 * @flags: flags modifying lookup behaviour
 992:	 * @page_mask: a pointer to output page_mask
 993:	 *
 994:	 * @flags can have FOLL_ flags set, defined in <linux/mm.h>
 995:	 *
 996:	 * When getting an anonymous page and the caller has to trigger unsharing
 997:	 * of a shared anonymous page first, -EMLINK is returned. The caller should
 998:	 * trigger a fault with FAULT_FLAG_UNSHARE set. Note that unsharing is only
 999:	 * relevant with FOLL_PIN and !FOLL_WRITE.
1000:	 *
1001:	 * On output, @page_mask is set according to the size of the page.
1002:	 *
1003:	 * Return: the mapped (struct page *), %NULL if no mapping exists, or
1004:	 * an error pointer if there is a mapping to something not represented
1005:	 * by a page descriptor (see also vm_normal_page()).
1006:	 */
1007:	static struct page *follow_page_mask(struct vm_area_struct *vma,
1008:				      unsigned long address, unsigned int flags,
1009:				      unsigned long *page_mask)
1010:	{
1011:		pgd_t *pgd;
1012:		struct mm_struct *mm = vma->vm_mm;
1013:		struct page *page;
1014:	
1015:		vma_pgtable_walk_begin(vma);
1016:	
1017:		*page_mask = 0;
1018:		pgd = pgd_offset(mm, address);
1019:	
1020:		if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
1021:			page = no_page_table(vma, flags, address);
1022:		else
1023:			page = follow_p4d_mask(vma, address, pgd, flags, page_mask);
1024:	
1025:		vma_pgtable_walk_end(vma);
1026:	
1027:		return page;
1028:	}
 SourceFile:mm/gup.c]

177/5 2026/08/27 19:34 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 22166
							output: 35
							thoughts: 45
						

Thoughts:
**My Thought Process Unraveling Page Table Walks**

Okay, so when I'm trying to understand how the system navigates through the page tables, I start by tracing the execution flow. My initial instinct is to track the `follow_page_mask` function, as that seems like the entry point for this particular operation. I know that as it progresses, it's going to have to traverse different levels of the page table hierarchy.

My mental model immediately kicks in, and I predict that `follow_page_mask` won't do the entire job itself. It's highly likely to delegate the actual traversal of specific page table levels to other, more specialized functions. Based on the naming conventions I'm familiar with in memory management, I'd anticipate calls to functions that handle the PGD (Page Global Directory), PUD (Page Upper Directory), and PMD (Page Middle Directory) levels.

So, my internal debugger or thought process follows this chain: `follow_page_mask` will likely call `follow_p4d_mask` (or a similar PGD-level function). This `follow_p4d_mask` will then, in turn, need to resolve the entry in the next level down, leading me to expect a call to `follow_pud_mask`. Continuing this pattern, the `follow_pud_mask` will then be responsible for finding the relevant entry in the PMD, hence my prediction of a `follow_pmd_mask` call.

Finally, after navigating through all these intermediate page table structures, the ultimate goal is to reach the actual page table entry (PTE) that contains the physical address of the memory page. Therefore, I'm confident that the last step in this sequence, after the PMD traversal, will be a call to `follow_page_pte`, which is where the real leaf-level translation happens. This sequential calling structure is a common and efficient way to manage the complexity of multi-level page table lookups.


178/5 2026/08/27 19:34 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/gup.c Name:follow_page_pte]

Results:
map[SourceCode: 802:	static struct page *follow_page_pte(struct vm_area_struct *vma,
 803:			unsigned long address, pmd_t *pmd, unsigned int flags)
 804:	{
 805:		struct mm_struct *mm = vma->vm_mm;
 806:		struct folio *folio;
 807:		struct page *page;
 808:		spinlock_t *ptl;
 809:		pte_t *ptep, pte;
 810:		int ret;
 811:	
 812:		ptep = pte_offset_map_lock(mm, pmd, address, &ptl);
 813:		if (!ptep)
 814:			return no_page_table(vma, flags, address);
 815:		pte = ptep_get(ptep);
 816:		if (!pte_present(pte))
 817:			goto no_page;
 818:		if (pte_protnone(pte) && !gup_can_follow_protnone(vma, flags))
 819:			goto no_page;
 820:	
 821:		page = vm_normal_page(vma, address, pte);
 822:	
 823:		/*
 824:		 * We only care about anon pages in can_follow_write_pte().
 825:		 */
 826:		if ((flags & FOLL_WRITE) &&
 827:		    !can_follow_write_pte(pte, page, vma, flags)) {
 828:			page = NULL;
 829:			goto out;
 830:		}
 831:	
 832:		if (unlikely(!page)) {
 833:			if (flags & FOLL_DUMP) {
 834:				/* Avoid special (like zero) pages in core dumps */
 835:				page = ERR_PTR(-EFAULT);
 836:				goto out;
 837:			}
 838:	
 839:			if (is_zero_pfn(pte_pfn(pte))) {
 840:				page = pte_page(pte);
 841:			} else {
 842:				ret = follow_pfn_pte(vma, address, ptep, flags);
 843:				page = ERR_PTR(ret);
 844:				goto out;
 845:			}
 846:		}
 847:		folio = page_folio(page);
 848:	
 849:		if (!pte_write(pte) && gup_must_unshare(vma, flags, page)) {
 850:			page = ERR_PTR(-EMLINK);
 851:			goto out;
 852:		}
 853:	
 854:		VM_WARN_ON_ONCE_PAGE((flags & FOLL_PIN) && PageAnon(page) &&
 855:				     !PageAnonExclusive(page), page);
 856:	
 857:		/* try_grab_folio() does nothing unless FOLL_GET or FOLL_PIN is set. */
 858:		ret = try_grab_folio(folio, 1, flags);
 859:		if (unlikely(ret)) {
 860:			page = ERR_PTR(ret);
 861:			goto out;
 862:		}
 863:	
 864:		/*
 865:		 * We need to make the page accessible if and only if we are going
 866:		 * to access its content (the FOLL_PIN case).  Please see
 867:		 * Documentation/core-api/pin_user_pages.rst for details.
 868:		 */
 869:		if (flags & FOLL_PIN) {
 870:			ret = arch_make_folio_accessible(folio);
 871:			if (ret) {
 872:				unpin_user_page(page);
 873:				page = ERR_PTR(ret);
 874:				goto out;
 875:			}
 876:		}
 877:		if (flags & FOLL_TOUCH) {
 878:			if ((flags & FOLL_WRITE) &&
 879:			    !pte_dirty(pte) && !folio_test_dirty(folio))
 880:				folio_mark_dirty(folio);
 881:			/*
 882:			 * pte_mkyoung() would be more correct here, but atomic care
 883:			 * is needed to avoid losing the dirty bit: it is easier to use
 884:			 * folio_mark_accessed().
 885:			 */
 886:			folio_mark_accessed(folio);
 887:		}
 888:	out:
 889:		pte_unmap_unlock(ptep, ptl);
 890:		return page;
 891:	no_page:
 892:		pte_unmap_unlock(ptep, ptl);
 893:		if (!pte_none(pte))
 894:			return NULL;
 895:		return no_page_table(vma, flags, address);
 896:	}
 SourceFile:mm/gup.c]

179/5 2026/08/27 19:34 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 23673
							output: 35
							thoughts: 96
						

Thoughts:
**My Thought Process Regarding `mlock` and Page Table Entries**

Alright, let me walk through my recent line of inquiry here. I was digging into how page table entries (PTEs) are handled, specifically in the context of `follow_page_pte`. What struck me first was that `follow_page_pte` does indeed call `folio_mark_accessed(folio)` when the `FOLL_TOUCH` flag is present. That's the expected behavior for marking a page as recently used.

However, my immediate follow-up thought was: does it also handle memory locking (`mlock`) at this point? And the answer, as I quickly observed, is no. `follow_page_pte` does *not* call `mlock_vma_folio` directly. This led me to a critical question: if a page is already mapped into memory and `FOLL_TOUCH` is set, but `mlock_vma_folio` isn't invoked by `follow_page_pte`, does that mean the page *isn't* being mlocked even if it's already in use? This seemed like a potential gap or a point of confusion in the workflow.

To resolve this, I decided to trace the execution path further. I knew that `apply_vma_lock_flags` is where memory locking logic is typically applied. So, my next step was to examine what `apply_vma_lock_flags` does. My investigation led me to discover that `apply_vma_lock_flags` *does* indeed call `mlock_fixup`. This then prompted me to dive into the specifics of `mlock_fixup` itself to understand its precise role and how it interacts with existing mappings and the `mlock` system call's intent. This was the critical juncture to verify if the previously observed omission by `follow_page_pte` was indeed addressed elsewhere.


180/5 2026/08/27 19:34 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:mlock_fixup]

Results:
map[SourceCode: 458:	/*
 459:	 * mlock_fixup  - handle mlock[all]/munlock[all] requests.
 460:	 *
 461:	 * Filters out "special" vmas -- VMA_LOCKED_BIT never gets set for these, and
 462:	 * munlock is a no-op.  However, for some special vmas, we go ahead and
 463:	 * populate the ptes.
 464:	 *
 465:	 * For vmas that pass the filters, merge/split as appropriate.
 466:	 */
 467:	static int mlock_fixup(struct vma_iterator *vmi, struct vm_area_struct *vma,
 468:		       struct vm_area_struct **prev, unsigned long start,
 469:		       unsigned long end, vma_flags_t *new_vma_flags)
 470:	{
 471:		const vma_flags_t old_vma_flags = vma->flags;
 472:		struct mm_struct *mm = vma->vm_mm;
 473:		int nr_pages;
 474:		int ret = 0;
 475:	
 476:		if (vma_flags_same_pair(&old_vma_flags, new_vma_flags) ||
 477:		    vma_is_secretmem(vma) || !vma_supports_mlock(vma)) {
 478:			/*
 479:			 * Don't set VMA_LOCKED_BIT or VMA_LOCKONFAULT_BIT and don't
 480:			 * count.  For secretmem, don't allow the memory to be unlocked.
 481:			 */
 482:			goto out;
 483:		}
 484:	
 485:		vma = vma_modify_flags(vmi, *prev, vma, start, end, new_vma_flags);
 486:		if (IS_ERR(vma)) {
 487:			ret = PTR_ERR(vma);
 488:			goto out;
 489:		}
 490:	
 491:		/*
 492:		 * Keep track of amount of locked VM.
 493:		 */
 494:		nr_pages = (end - start) >> PAGE_SHIFT;
 495:		if (!vma_flags_test(new_vma_flags, VMA_LOCKED_BIT))
 496:			nr_pages = -nr_pages;
 497:		else if (vma_flags_test(&old_vma_flags, VMA_LOCKED_BIT))
 498:			nr_pages = 0;
 499:		mm->locked_vm += nr_pages;
 500:	
 501:		/*
 502:		 * vm_flags is protected by the mmap_lock held in write mode.
 503:		 * It's okay if try_to_unmap_one unmaps a page just after we
 504:		 * set VMA_LOCKED_BIT, populate_vma_page_range will bring it back.
 505:		 */
 506:		if (vma_flags_test(new_vma_flags, VMA_LOCKED_BIT) &&
 507:		    vma_flags_test(&old_vma_flags, VMA_LOCKED_BIT)) {
 508:			/* No work to do, and mlocking twice would be wrong */
 509:			vma_start_write(vma);
 510:			vma->flags = *new_vma_flags;
 511:		} else {
 512:			mlock_vma_pages_range(vma, start, end, new_vma_flags);
 513:		}
 514:	out:
 515:		*prev = vma;
 516:		return ret;
 517:	}
 SourceFile:mm/mlock.c]

181/5 2026/08/27 19:34 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 24872
							output: 39
							thoughts: 38
						

Thoughts:
**My Thought Process Unfolding**

So, I've just noticed this interesting chain of function calls. My attention is immediately drawn to the fact that `mlock_fixup` isn't just doing its thing in isolation; it's actively invoking `mlock_vma_pages_range`. This is a key observation because it tells me that the `mlock` operation, at least in this context, involves a more granular process of locking pages within a Virtual Memory Area (VMA). My immediate next step, therefore, is to delve deeper into `mlock_vma_pages_range` itself. I need to understand precisely *what* it's doing with those pages within the specified range. Is it iterating through them, checking their status, or perhaps performing some form of validation or modification before they are officially locked? This deeper dive is crucial to fully grasping the mechanics and implications of the `mlock` operation as implemented here.


182/5 2026/08/27 19:34 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:mlock_vma_pages_range]

Results:
map[SourceCode: 412:	/*
 413:	 * mlock_vma_pages_range() - mlock any pages already in the range,
 414:	 *                           or munlock all pages in the range.
 415:	 * @vma - vma containing range to be mlock()ed or munlock()ed
 416:	 * @start - start address in @vma of the range
 417:	 * @end - end of range in @vma
 418:	 * @new_vma_flags - the new set of flags for @vma.
 419:	 *
 420:	 * Called for mlock(), mlock2() and mlockall(), to set @vma VMA_LOCKED_BIT;
 421:	 * called for munlock() and munlockall(), to clear VMA_LOCKED_BIT from @vma.
 422:	 */
 423:	static void mlock_vma_pages_range(struct vm_area_struct *vma,
 424:		unsigned long start, unsigned long end,
 425:		vma_flags_t *new_vma_flags)
 426:	{
 427:		static const struct mm_walk_ops mlock_walk_ops = {
 428:			.pmd_entry = mlock_pte_range,
 429:			.walk_lock = PGWALK_WRLOCK_VERIFY,
 430:		};
 431:	
 432:		/*
 433:		 * There is a slight chance that concurrent page migration,
 434:		 * or page reclaim finding a page of this now-VMA_LOCKED_BIT vma,
 435:		 * will call mlock_vma_folio() and raise page's mlock_count:
 436:		 * double counting, leaving the page unevictable indefinitely.
 437:		 * Communicate this danger to mlock_vma_folio() with VMA_IO_BIT,
 438:		 * which is a VMA_SPECIAL_FLAGS flag not allowed on VMA_LOCKED_BIT vmas.
 439:		 * mmap_lock is held in write mode here, so this weird
 440:		 * combination should not be visible to other mmap_lock users;
 441:		 * but WRITE_ONCE so rmap walkers must see VMA_IO_BIT if VMA_LOCKED_BIT.
 442:		 */
 443:		if (vma_flags_test(new_vma_flags, VMA_LOCKED_BIT))
 444:			vma_flags_set(new_vma_flags, VMA_IO_BIT);
 445:		vma_start_write(vma);
 446:		vma_flags_reset_once(vma, new_vma_flags);
 447:	
 448:		lru_add_drain();
 449:		walk_page_range_vma(vma, start, end, &mlock_walk_ops, NULL);
 450:		lru_add_drain();
 451:	
 452:		if (vma_flags_test(new_vma_flags, VMA_IO_BIT)) {
 453:			vma_flags_clear(new_vma_flags, VMA_IO_BIT);
 454:			vma_flags_reset_once(vma, new_vma_flags);
 455:		}
 456:	}
 SourceFile:mm/mlock.c]

183/5 2026/08/27 19:34 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 25864
							output: 36
							thoughts: 51
						

Thoughts:
**A Deep Dive into `mlock_vma_pages_range` and its Page Table Traversal**

As I delve into the intricacies of memory locking, I've noticed a crucial connection: `mlock_vma_pages_range` initiates an `lru_add_drain()` operation. This is a significant observation because `lru_add_drain()` is responsible for managing the Least Recently Used (LRU) lists, which are fundamental to the kernel's memory reclamation strategy. My immediate thought is to understand *why* this drain is necessary or triggered in the context of memory locking.

Following this, I see that `mlock_vma_pages_range` proceeds to walk the page tables. This page table walk is the mechanism by which the kernel identifies the physical pages associated with a given virtual memory area (VMA). The fact that it iterates through the page tables suggests that memory locking operates at the granularity of individual pages.

The core of this process, as I observe, is the subsequent call to `mlock_pte_range`. This function is where the actual page table entry (PTE) manipulation for locking likely occurs. My next step, therefore, is to meticulously examine `mlock_pte_range` to fully grasp how it achieves the memory locking behavior, what specific flags or bits it manipulates within the PTEs, and what implications this has for page fault handling and memory management thereafter. Understanding `mlock_pte_range` will be key to comprehending the entire `mlock_vma_pages_range` operation.


184/5 2026/08/27 19:35 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:mlock_pte_range]

Results:
map[SourceCode: 350:	static int mlock_pte_range(pmd_t *pmd, unsigned long addr,
 351:				   unsigned long end, struct mm_walk *walk)
 352:	
 353:	{
 354:		struct vm_area_struct *vma = walk->vma;
 355:		spinlock_t *ptl;
 356:		pte_t *start_pte, *pte;
 357:		pte_t ptent;
 358:		struct folio *folio;
 359:		unsigned int step = 1;
 360:		unsigned long start = addr;
 361:	
 362:		ptl = pmd_trans_huge_lock(pmd, vma);
 363:		if (ptl) {
 364:			if (!pmd_present(*pmd))
 365:				goto out;
 366:			if (is_huge_zero_pmd(*pmd))
 367:				goto out;
 368:			folio = pmd_folio(*pmd);
 369:			if (folio_is_zone_device(folio))
 370:				goto out;
 371:			if (vma_test(vma, VMA_LOCKED_BIT))
 372:				mlock_folio(folio);
 373:			else
 374:				munlock_folio(folio);
 375:			goto out;
 376:		}
 377:	
 378:		start_pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
 379:		if (!start_pte) {
 380:			walk->action = ACTION_AGAIN;
 381:			return 0;
 382:		}
 383:	
 384:		for (pte = start_pte; addr != end; pte++, addr += PAGE_SIZE) {
 385:			ptent = ptep_get(pte);
 386:			if (!pte_present(ptent))
 387:				continue;
 388:			folio = vm_normal_folio(vma, addr, ptent);
 389:			if (!folio || folio_is_zone_device(folio))
 390:				continue;
 391:	
 392:			step = folio_mlock_step(folio, pte, addr, end);
 393:			if (!allow_mlock_munlock(folio, vma, start, end, step))
 394:				goto next_entry;
 395:	
 396:			if (vma_test(vma, VMA_LOCKED_BIT))
 397:				mlock_folio(folio);
 398:			else
 399:				munlock_folio(folio);
 400:	
 401:	next_entry:
 402:			pte += step - 1;
 403:			addr += (step - 1) << PAGE_SHIFT;
 404:		}
 405:		pte_unmap(start_pte);
 406:	out:
 407:		spin_unlock(ptl);
 408:		cond_resched();
 409:		return 0;
 410:	}
 SourceFile:mm/mlock.c]

185/5 2026/08/27 19:35 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 26850
							output: 35
							thoughts: 311
						

Thoughts:
**My Thought Process Unpacking `mlock` and LRU Batching**

Okay, so I'm tracing the execution flow here, and it's becoming clear how `mlock` interacts with the LRU page management. My first observation is that `mlock_pte_range`, which is a core part of the `mlock` operation, ultimately calls `mlock_folio(folio)`. This tells me that the actual locking mechanism is applied at the folio level.

Diving deeper, I see that `mlock_vma_pages_range` is orchestrating a lot of this. It's calling `lru_add_drain()` both *before* and *after* it proceeds with its core work. This immediately flags `lru_add_drain()` as a critical function I need to understand precisely. My initial thought is that `lru_add_drain()` is about clearing out some kind of local batching mechanism.

Now, let's consider a specific scenario. Suppose a page was originally faulted in on CPU 0. This means that this page would likely be in CPU 0's `lru_add` batch. Then, let's say another CPU, CPU 1, initiates an `mlock` operation on this page.

When CPU 1 calls `mlock`, it flows down to `mlock_vma_pages_range`. On CPU 1, `lru_add_drain()` is invoked. My understanding is that this particular call to `lru_add_drain()` will drain CPU 1's *local* `lru_add` batch.

Following that, `mlock_pte_range` is called, which in turn calls `mlock_folio(folio)`. This is where the `PG_mlocked` flag is set, and importantly, the folio is added to CPU 1's `mlock_fbatch` with the `LRU_FOLIO` designation.

Then, critically, `mlock_vma_pages_range` on CPU 1 calls `lru_add_drain()` *again*. This second invocation is what's really catching my attention. My immediate question becomes: does this second `lru_add_drain()` on CPU 1 also drain CPU 1's `mlock_fbatch`?

This is a crucial point because if it *does* drain the `mlock_fbatch`, it implies that the `mlock` operation is piggybacking on the standard LRU draining mechanism to manage its locked pages. It means the page, having been originally faulted on CPU 0 and potentially added to its `lru_add` batch, might get moved or processed when CPU 1 drains *its* local batches, including the `mlock_fbatch`.

To confirm this, my next step is to dive directly into the implementation of `lru_add_drain` to see exactly what batches it operates on. I need to verify if it indeed processes `mlock_fbatch` in addition to `lru_add`. This will solidify my understanding of the interaction between `mlock` and the per-CPU batching for LRU management.


186/5 2026/08/27 19:35 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/swap.c Name:lru_add_drain]

Results:
map[SourceCode: 781:	void lru_add_drain(void)
 782:	{
 783:		local_lock(&cpu_fbatches.lock);
 784:		lru_add_drain_cpu(smp_processor_id());
 785:		local_unlock(&cpu_fbatches.lock);
 786:		mlock_drain_local();
 787:	}
 SourceFile:mm/folio.c]

187/5 2026/08/27 19:35 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 27310
							output: 34
							thoughts: 281
						

Thoughts:
**Understanding the `PG_mlocked` State During Unmapping**

Ah, I've just had a breakthrough in tracing the `PG_mlocked` flag's behavior during an unmapping operation. My thought process started with the `lru_add_drain` function. I realized that when `lru_add_drain` is invoked, it triggers `mlock_drain_local()`. This is key because it means CPU 1's `mlock_fbatch` is now being drained.

Following that chain, when `mlock_fbatch` is drained, `mlock_folio_batch` is called. This, in turn, calls `__mlock_folio`. Now, here's the crucial part: `__mlock_folio` performs a check: `!folio_test_clear_lru(folio)`. Because this specific folio is still in CPU 0's `lru_add` batch, it hasn't actually been placed on the LRU list yet. Consequently, `folio_test_clear_lru(folio)` returns `false`, and the `!` operator makes the condition `true`. This means `__mlock_folio` returns immediately without performing any action on the folio.

So, the folio remains in this peculiar state: it has `PG_mlocked` set, but it's neither on the unevictable list nor does it have its `mlock_count` incremented.

Now, the scenario progresses to CPU 1 calling `munmap`. My immediate thought was to investigate how `munmap` handles this state. I initially suspected it might call `munlock_vma_folio` or a similar function. I decided to dive into the `munmap` implementation itself.

My investigation revealed that `munmap` doesn't directly call `munlock_vma_folio` during the unmapping process. Instead, it proceeds through `unmap_region`, which then calls `unmap_vmas`, followed by `unmap_page_range`, and finally `zap_pte_range`. This last function, `zap_pte_range`, is where I'm now focusing my attention to understand the precise handling of these folios with the `PG_mlocked` flag set but not properly accounted for on the LRU or unevictable lists.


188/5 2026/08/27 19:35 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/memory.c Name:zap_pte_range]

Results:
map[SourceCode:1969:	static unsigned long zap_pte_range(struct mmu_gather *tlb,
1970:					struct vm_area_struct *vma, pmd_t *pmd,
1971:					unsigned long addr, unsigned long end,
1972:					struct zap_details *details)
1973:	{
1974:		bool can_reclaim_pt = pte_table_reclaim_possible(addr, end, details);
1975:		bool force_flush = false, force_break = false;
1976:		struct mm_struct *mm = tlb->mm;
1977:		int rss[NR_MM_COUNTERS];
1978:		spinlock_t *ptl;
1979:		pte_t *start_pte;
1980:		pte_t *pte;
1981:		pmd_t pmdval;
1982:		unsigned long start = addr;
1983:		bool direct_reclaim = true;
1984:		int nr;
1985:	
1986:	retry:
1987:		tlb_change_page_size(tlb, PAGE_SIZE);
1988:		init_rss_vec(rss);
1989:		start_pte = pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
1990:		if (!pte)
1991:			return addr;
1992:	
1993:		flush_tlb_batched_pending(mm);
1994:		lazy_mmu_mode_enable();
1995:		do {
1996:			bool any_skipped = false;
1997:	
1998:			if (need_resched()) {
1999:				direct_reclaim = false;
2000:				break;
2001:			}
2002:	
2003:			nr = do_zap_pte_range(tlb, vma, pte, addr, end, details, rss,
2004:					      &force_flush, &force_break, &any_skipped);
2005:			if (any_skipped)
2006:				can_reclaim_pt = false;
2007:			if (unlikely(force_break)) {
2008:				addr += nr * PAGE_SIZE;
2009:				direct_reclaim = false;
2010:				break;
2011:			}
2012:		} while (pte += nr, addr += PAGE_SIZE * nr, addr != end);
2013:	
2014:		/*
2015:		 * Fast path: try to hold the pmd lock and unmap the PTE page.
2016:		 *
2017:		 * If the pte lock was released midway (retry case), or if the attempt
2018:		 * to hold the pmd lock failed, then we need to recheck all pte entries
2019:		 * to ensure they are still none, thereby preventing the pte entries
2020:		 * from being repopulated by another thread.
2021:		 */
2022:		if (can_reclaim_pt && direct_reclaim && addr == end)
2023:			direct_reclaim = zap_empty_pte_table(mm, pmd, ptl, &pmdval);
2024:	
2025:		add_mm_rss_vec(mm, rss);
2026:		lazy_mmu_mode_disable();
2027:	
2028:		/* Do the actual TLB flush before dropping ptl */
2029:		if (force_flush) {
2030:			tlb_flush_mmu_tlbonly(tlb);
2031:			tlb_flush_rmaps(tlb, vma);
2032:		}
2033:		pte_unmap_unlock(start_pte, ptl);
2034:	
2035:		/*
2036:		 * If we forced a TLB flush (either due to running out of
2037:		 * batch buffers or because we needed to flush dirty TLB
2038:		 * entries before releasing the ptl), free the batched
2039:		 * memory too. Come back again if we didn't do everything.
2040:		 */
2041:		if (force_flush)
2042:			tlb_flush_mmu(tlb);
2043:	
2044:		if (addr != end) {
2045:			cond_resched();
2046:			force_flush = false;
2047:			force_break = false;
2048:			goto retry;
2049:		}
2050:	
2051:		if (can_reclaim_pt) {
2052:			if (direct_reclaim || zap_pte_table_if_empty(mm, pmd, start, &pmdval)) {
2053:				pte_free_tlb(tlb, pmd_pgtable(pmdval), start);
2054:				mm_dec_nr_ptes(mm);
2055:			}
2056:		}
2057:	
2058:		return addr;
2059:	}
 SourceFile:mm/memory.c]

189/5 2026/08/27 19:35 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 29029
							output: 34
							thoughts: 17
						

Thoughts:
**My Thought Process:**

Alright, so I'm looking at this `do_zap_pte_range` function, and my immediate thought is, "Okay, what's its job?" It's clearly related to managing page table entries (PTEs), and the "range" part suggests it's not just one entry, but a whole contiguous block. My next step is to trace its execution path. I see it calls `zap_present_folio`. This is a key piece of information. It tells me that `do_zap_pte_range` is concerned with unmapping or invalidating page table entries that point to *present* folios. So, its core responsibility seems to be cleaning up the page tables for a given range of memory, specifically targeting those pages that are currently resident in memory (i.e., are "present" folios). The implication here is that before we can effectively unmap or invalidate these PTEs, we need to handle the underlying page data itself, hence the call to `zap_present_folio`. This suggests a two-step process: first, deal with the actual page data (making it eligible for reclamation, perhaps), and then, clean up the page table pointers to that data.


190/5 2026/08/27 19:35 tool codesearch-definition-source
0m Error:
log-in to see details

Args:
map[ContextFile:mm/memory.c Name:zap_present_folio]

Results:
map[SourceCode: SourceFile:]

191/5 2026/08/27 19:35 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 29085
							output: 36
							thoughts: 13
						

Thoughts:
**My Thought Process Regarding `do_zap_pte_range`**

Alright, I need to get a handle on what `do_zap_pte_range` is actually doing. My first instinct is to dive right into the function itself. I want to see its signature, understand the parameters it takes, and get a clear picture of its core purpose. What is it designed to achieve? Is it about clearing page table entries, unmapping memory, or something else entirely? I'm assuming it's going to be operating at a granular level within the page table structure, dealing with a *range* of entries, hence the name. I'll be looking for the fundamental operations: how it iterates through the specified range, what flags it checks, and what modifications it makes to the page table entries. I'm anticipating calls to other related functions that handle the actual unmapping or clearing of individual PTEs. My ultimate goal here is to grasp the low-level mechanics of how this function contributes to memory management within the system.


192/5 2026/08/27 19:35 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/memory.c Name:do_zap_pte_range]

Results:
map[SourceCode:1875:	static inline int do_zap_pte_range(struct mmu_gather *tlb,
1876:					   struct vm_area_struct *vma, pte_t *pte,
1877:					   unsigned long addr, unsigned long end,
1878:					   struct zap_details *details, int *rss,
1879:					   bool *force_flush, bool *force_break,
1880:					   bool *any_skipped)
1881:	{
1882:		pte_t ptent = ptep_get(pte);
1883:		int max_nr = (end - addr) / PAGE_SIZE;
1884:		int nr = 0;
1885:	
1886:		/* Skip all consecutive none ptes */
1887:		if (pte_none(ptent)) {
1888:			for (nr = 1; nr < max_nr; nr++) {
1889:				ptent = ptep_get(pte + nr);
1890:				if (!pte_none(ptent))
1891:					break;
1892:			}
1893:			max_nr -= nr;
1894:			if (!max_nr)
1895:				return nr;
1896:			pte += nr;
1897:			addr += nr * PAGE_SIZE;
1898:		}
1899:	
1900:		if (pte_present(ptent))
1901:			nr += zap_present_ptes(tlb, vma, pte, ptent, max_nr, addr,
1902:					       details, rss, force_flush, force_break,
1903:					       any_skipped);
1904:		else
1905:			nr += zap_nonpresent_ptes(tlb, vma, pte, ptent, max_nr, addr,
1906:						  details, rss, any_skipped);
1907:	
1908:		return nr;
1909:	}
 SourceFile:mm/memory.c]

193/5 2026/08/27 19:35 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 29685
							output: 35
							thoughts: 29
						

Thoughts:
**My Thought Process**

I'm trying to understand the flow of execution, specifically how the `zap_present_ptes` function interacts with other parts of the system. My immediate question is: does `zap_present_ptes` call `zap_present_folio`? To answer this, I need to dive into the implementation of `zap_present_ptes` itself. My next step, therefore, is to examine the code for `zap_present_ptes`.


194/5 2026/08/27 19:35 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/memory.c Name:zap_present_ptes]

Results:
map[SourceCode:1752:	/*
1753:	 * Zap or skip at least one present PTE, trying to batch-process subsequent
1754:	 * PTEs that map consecutive pages of the same folio.
1755:	 *
1756:	 * Returns the number of processed (skipped or zapped) PTEs (at least 1).
1757:	 */
1758:	static inline int zap_present_ptes(struct mmu_gather *tlb,
1759:			struct vm_area_struct *vma, pte_t *pte, pte_t ptent,
1760:			unsigned int max_nr, unsigned long addr,
1761:			struct zap_details *details, int *rss, bool *force_flush,
1762:			bool *force_break, bool *any_skipped)
1763:	{
1764:		struct mm_struct *mm = tlb->mm;
1765:		struct folio *folio;
1766:		struct page *page;
1767:		int nr;
1768:	
1769:		page = vm_normal_page(vma, addr, ptent);
1770:		if (!page) {
1771:			/* We don't need up-to-date accessed/dirty bits. */
1772:			ptep_get_and_clear_full(mm, addr, pte, tlb->fullmm);
1773:			arch_check_zapped_pte(vma, ptent);
1774:			tlb_remove_tlb_entry(tlb, pte, addr);
1775:			if (userfaultfd_pte_wp(vma, ptent))
1776:				*any_skipped = zap_install_uffd_wp_if_needed(vma, addr,
1777:							pte, 1, details, ptent);
1778:			ksm_might_unmap_zero_page(mm, ptent);
1779:			return 1;
1780:		}
1781:	
1782:		folio = page_folio(page);
1783:		if (unlikely(!should_zap_folio(details, folio))) {
1784:			*any_skipped = true;
1785:			return 1;
1786:		}
1787:	
1788:		/*
1789:		 * Make sure that the common "small folio" case is as fast as possible
1790:		 * by keeping the batching logic separate.
1791:		 */
1792:		if (unlikely(folio_test_large(folio) && max_nr != 1)) {
1793:			nr = folio_pte_batch(folio, pte, ptent, max_nr);
1794:			zap_present_folio_ptes(tlb, vma, folio, page, pte, ptent, nr,
1795:					       addr, details, rss, force_flush,
1796:					       force_break, any_skipped);
1797:			return nr;
1798:		}
1799:		zap_present_folio_ptes(tlb, vma, folio, page, pte, ptent, 1, addr,
1800:				       details, rss, force_flush, force_break, any_skipped);
1801:		return 1;
1802:	}
 SourceFile:mm/memory.c]

195/5 2026/08/27 19:35 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 30647
							output: 37
							thoughts: 21
						

Thoughts:
**My Thought Process for Handling `zap_present_folio_ptes`**

Okay, so when I encounter a call to `zap_present_folio_ptes`, my immediate thought is that this function is going to be responsible for cleaning up a specific range of Page Table Entries (PTEs) that are currently associated with a "folio." The "folio" concept, as I understand it, is a more modern and efficient way of managing memory pages, essentially grouping them together. The "present" in the name is a key indicator – it means I'm dealing with PTEs that are actively mapped and likely pointing to valid memory. The "zap" prefix strongly suggests that the primary action here is removal or invalidation.

My next thought, and this is where the core of the operation lies, is that `zap_present_folio_ptes` isn't going to do all the heavy lifting itself. It's more of a high-level orchestrator. I anticipate it will delegate the actual, granular work of unmapping and cleaning up those PTEs to a more specialized function. Given the context of memory management, especially dealing with shared mappings and the complexities of the Reverse Mapping (rmap) system, my gut tells me this specialized function is going to be `folio_remove_rmap_ptes`.

So, my internal flow chart looks like this: `zap_present_folio_ptes` receives a folio and the range of PTEs to zap. It then needs to ensure that these PTEs are properly detached from the page's reverse mapping structures. This is crucial to avoid stale entries, potential double-frees, or incorrect memory access after the PTEs are invalidated. Therefore, `zap_present_folio_ptes` will, in turn, call `folio_remove_rmap_ptes`. This subordinate function will be the one that actually iterates through the relevant PTEs within the folio's range, removes them from the rmap lists, and potentially handles other associated cleanup tasks like decrementing reference counts or notifying other parts of the system that these PTEs are no longer valid. The `zap_present_folio_ptes` function, in essence, acts as a gatekeeper, ensuring that the `folio_remove_rmap_ptes` function is invoked correctly and at the right time to maintain memory integrity.


196/5 2026/08/27 19:35 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/memory.c Name:zap_present_folio_ptes]

Results:
map[SourceCode:1707:	static __always_inline void zap_present_folio_ptes(struct mmu_gather *tlb,
1708:			struct vm_area_struct *vma, struct folio *folio,
1709:			struct page *page, pte_t *pte, pte_t ptent, unsigned int nr,
1710:			unsigned long addr, struct zap_details *details, int *rss,
1711:			bool *force_flush, bool *force_break, bool *any_skipped)
1712:	{
1713:		struct mm_struct *mm = tlb->mm;
1714:		bool delay_rmap = false;
1715:	
1716:		if (!folio_test_anon(folio)) {
1717:			ptent = get_and_clear_full_ptes(mm, addr, pte, nr, tlb->fullmm);
1718:			if (pte_dirty(ptent)) {
1719:				folio_mark_dirty(folio);
1720:				if (tlb_delay_rmap(tlb)) {
1721:					delay_rmap = true;
1722:					*force_flush = true;
1723:				}
1724:			}
1725:			if (pte_young(ptent) && likely(vma_has_recency(vma)))
1726:				folio_mark_accessed(folio);
1727:			rss[mm_counter(folio)] -= nr;
1728:		} else {
1729:			/* We don't need up-to-date accessed/dirty bits. */
1730:			clear_full_ptes(mm, addr, pte, nr, tlb->fullmm);
1731:			rss[MM_ANONPAGES] -= nr;
1732:		}
1733:		/* Checking a single PTE in a batch is sufficient. */
1734:		arch_check_zapped_pte(vma, ptent);
1735:		tlb_remove_tlb_entries(tlb, pte, nr, addr);
1736:		if (unlikely(userfaultfd_pte_wp(vma, ptent)))
1737:			*any_skipped = zap_install_uffd_wp_if_needed(vma, addr, pte,
1738:								     nr, details, ptent);
1739:	
1740:		if (!delay_rmap) {
1741:			folio_remove_rmap_ptes(folio, page, nr, vma);
1742:	
1743:			if (unlikely(folio_mapcount(folio) < 0))
1744:				print_bad_pte(vma, addr, ptent, page);
1745:		}
1746:		if (unlikely(__tlb_remove_folio_pages(tlb, page, nr, delay_rmap))) {
1747:			*force_flush = true;
1748:			*force_break = true;
1749:		}
1750:	}
 SourceFile:mm/memory.c]

197/5 2026/08/27 19:35 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 31519
							output: 37
							thoughts: 60
						

Thoughts:
**My Thought Process Regarding `folio_remove_rmap_ptes` and `munlock_vma_folio`**

Okay, so my initial thought here is a question about the call flow between `folio_remove_rmap_ptes` and `munlock_vma_folio`. I'm trying to ascertain which function calls the other. Is it the case that `folio_remove_rmap_ptes` *itself* invokes `munlock_vma_folio`? Or is it the other way around, with `munlock_vma_folio` being called *from* `folio_remove_rmap_ptes`? To settle this, my immediate next step is to dive into the implementation of `folio_remove_rmap_ptes` and examine its internal workings to see the exact sequence of calls.


198/5 2026/08/27 19:35 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/rmap.c Name:folio_remove_rmap_ptes]

Results:
map[SourceCode:1886:	/**
1887:	 * folio_remove_rmap_ptes - remove PTE mappings from a page range of a folio
1888:	 * @folio:	The folio to remove the mappings from
1889:	 * @page:	The first page to remove
1890:	 * @nr_pages:	The number of pages that will be removed from the mapping
1891:	 * @vma:	The vm area from which the mappings are removed
1892:	 *
1893:	 * The page range of the folio is defined by [page, page + nr_pages)
1894:	 *
1895:	 * The caller needs to hold the page table lock.
1896:	 */
1897:	void folio_remove_rmap_ptes(struct folio *folio, struct page *page,
1898:			int nr_pages, struct vm_area_struct *vma)
1899:	{
1900:		__folio_remove_rmap(folio, page, nr_pages, vma, PGTABLE_LEVEL_PTE);
1901:	}
 SourceFile:mm/rmap.c]

199/5 2026/08/27 19:35 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 31909
							output: 35
							thoughts: 12
						

Thoughts:
**My Thought Process Regarding `__folio_remove_rmap`**

Okay, before I dive deeper, my immediate instinct is to scrutinize the function `__folio_remove_rmap`. I want to understand its precise role and how it interacts with the surrounding memory management mechanisms. My primary goal here is to ensure that when a folio is being removed, its associated reverse mapping (rmap) is handled correctly and without any lingering references or data structures that could lead to inconsistencies or memory leaks. I'll be looking for how it identifies the relevant rmap entries, how it purges them, and what safeguards are in place to prevent race conditions or double-frees. Essentially, I'm trying to confirm that this function is a robust and reliable component of the folio lifecycle management, specifically concerning the removal of its mapping information.


200/5 2026/08/27 19:35 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/rmap.c Name:__folio_remove_rmap]

Results:
map[SourceCode:1776:	static __always_inline void __folio_remove_rmap(struct folio *folio,
1777:			struct page *page, int nr_pages, struct vm_area_struct *vma,
1778:			enum pgtable_level level)
1779:	{
1780:		atomic_t *mapped = &folio->_nr_pages_mapped;
1781:		int last = 0, nr = 0, nr_pmdmapped = 0;
1782:		bool partially_mapped = false;
1783:	
1784:		__folio_rmap_sanity_checks(folio, page, nr_pages, level);
1785:	
1786:		switch (level) {
1787:		case PGTABLE_LEVEL_PTE:
1788:			if (!folio_test_large(folio)) {
1789:				nr = atomic_add_negative(-1, &folio->_mapcount);
1790:				break;
1791:			}
1792:	
1793:			if (IS_ENABLED(CONFIG_NO_PAGE_MAPCOUNT)) {
1794:				nr = folio_sub_return_large_mapcount(folio, nr_pages, vma);
1795:				if (!nr) {
1796:					/* Now completely unmapped. */
1797:					nr = folio_large_nr_pages(folio);
1798:				} else {
1799:					partially_mapped = nr < folio_large_nr_pages(folio) &&
1800:							   !folio_entire_mapcount(folio);
1801:					nr = 0;
1802:				}
1803:				break;
1804:			}
1805:	
1806:			folio_sub_large_mapcount(folio, nr_pages, vma);
1807:			do {
1808:				last += atomic_add_negative(-1, &page->_mapcount);
1809:			} while (page++, --nr_pages > 0);
1810:	
1811:			if (last &&
1812:			    atomic_sub_return_relaxed(last, mapped) < ENTIRELY_MAPPED)
1813:				nr = last;
1814:	
1815:			partially_mapped = nr && atomic_read(mapped);
1816:			break;
1817:		case PGTABLE_LEVEL_PMD:
1818:		case PGTABLE_LEVEL_PUD:
1819:			if (IS_ENABLED(CONFIG_NO_PAGE_MAPCOUNT)) {
1820:				last = atomic_add_negative(-1, &folio->_entire_mapcount);
1821:				if (level == PGTABLE_LEVEL_PMD && last)
1822:					nr_pmdmapped = folio_large_nr_pages(folio);
1823:				nr = folio_dec_return_large_mapcount(folio, vma);
1824:				if (!nr) {
1825:					/* Now completely unmapped. */
1826:					nr = folio_large_nr_pages(folio);
1827:				} else {
1828:					partially_mapped = last &&
1829:							   nr < folio_large_nr_pages(folio);
1830:					nr = 0;
1831:				}
1832:				break;
1833:			}
1834:	
1835:			folio_dec_large_mapcount(folio, vma);
1836:			last = atomic_add_negative(-1, &folio->_entire_mapcount);
1837:			if (last) {
1838:				nr = atomic_sub_return_relaxed(ENTIRELY_MAPPED, mapped);
1839:				if (likely(nr < ENTIRELY_MAPPED)) {
1840:					nr_pages = folio_large_nr_pages(folio);
1841:					if (level == PGTABLE_LEVEL_PMD)
1842:						nr_pmdmapped = nr_pages;
1843:					nr = nr_pages - nr;
1844:					/* Raced ahead of another remove and an add? */
1845:					if (unlikely(nr < 0))
1846:						nr = 0;
1847:				} else {
1848:					/* An add of ENTIRELY_MAPPED raced ahead */
1849:					nr = 0;
1850:				}
1851:			}
1852:	
1853:			partially_mapped = nr && nr < nr_pmdmapped;
1854:			break;
1855:		default:
1856:			BUILD_BUG();
1857:		}
1858:	
1859:		/*
1860:		 * Queue anon large folio for deferred split if at least one page of
1861:		 * the folio is unmapped and at least one page is still mapped.
1862:		 *
1863:		 * Check partially_mapped first to ensure it is a large folio.
1864:		 *
1865:		 * Device private folios do not support deferred splitting and
1866:		 * shrinker based scanning of the folios to free.
1867:		 */
1868:		if (partially_mapped && folio_test_anon(folio) &&
1869:		    !folio_test_partially_mapped(folio) &&
1870:		    !folio_is_device_private(folio))
1871:			deferred_split_folio(folio, true);
1872:	
1873:		__folio_mod_stat(folio, -nr, -nr_pmdmapped);
1874:	
1875:		/*
1876:		 * It would be tidy to reset folio_test_anon mapping when fully
1877:		 * unmapped, but that might overwrite a racing folio_add_anon_rmap_*()
1878:		 * which increments mapcount after us but sets mapping before us:
1879:		 * so leave the reset to free_pages_prepare, and remember that
1880:		 * it's only reliable while mapped.
1881:		 */
1882:	
1883:		munlock_vma_folio(folio, vma);
1884:	}
 SourceFile:mm/rmap.c]

201/5 2026/08/27 19:35 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 33654
							output: 37
							thoughts: 208
						

Thoughts:
**The Inner Workings of `munmap` and Folio Locking**

My immediate thought upon seeing `munlock_vma_folio(folio, vma)` being called at the very end of `__folio_remove_rmap` was one of dawning realization: `munmap` *does* indeed trigger `munlock_folio`. I reasoned this through by noting that `munlock_vma_folio` specifically checks `if (unlikely(vma->vm_flags & VM_LOCKED))` before proceeding to call `munlock_folio(folio)`. This confirmed my suspicion that memory unlocked during an unmap operation would indeed go through the `munlock_folio` path.

However, my focus then shifted. I observed that `munlock_folio` adds the folio to the local CPU's `mlock_fbatch` without any specific flags set. This immediately prompted a new line of inquiry: does `munmap` actually *drain* this `mlock_fbatch`? My investigation led me to `unmap_region`, a function called by `munmap`, and subsequently to `tlb_finish_mmu`. I quickly determined that `tlb_finish_mmu` itself does not handle draining the `mlock_fbatch`. This left me with a crucial question: does `munmap` initiate a drain of `mlock_fbatch` through some other mechanism, perhaps a call to `lru_add_drain`? To answer this, my next step was to delve into the implementation of `do_vmi_munmap`.


202/5 2026/08/27 19:35 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mmap.c Name:do_vmi_munmap]

Results:
map[SourceCode:1659:	/*
1660:	 * do_vmi_munmap() - munmap a given range.
1661:	 * @vmi: The vma iterator
1662:	 * @mm: The mm_struct
1663:	 * @start: The start address to munmap
1664:	 * @len: The length of the range to munmap
1665:	 * @uf: The userfaultfd list_head
1666:	 * @unlock: set to true if the user wants to drop the mmap_lock on success
1667:	 *
1668:	 * This function takes a @mas that is either pointing to the previous VMA or set
1669:	 * to MA_START and sets it up to remove the mapping(s).  The @len will be
1670:	 * aligned.
1671:	 *
1672:	 * Return: 0 on success and drops the lock if so directed, error and leaves the
1673:	 * lock held otherwise.
1674:	 */
1675:	int do_vmi_munmap(struct vma_iterator *vmi, struct mm_struct *mm,
1676:			  unsigned long start, size_t len, struct list_head *uf,
1677:			  bool unlock)
1678:	{
1679:		unsigned long end;
1680:		struct vm_area_struct *vma;
1681:	
1682:		if ((offset_in_page(start)) || start > TASK_SIZE || len > TASK_SIZE-start)
1683:			return -EINVAL;
1684:	
1685:		end = start + PAGE_ALIGN(len);
1686:		if (end == start)
1687:			return -EINVAL;
1688:	
1689:		/* Find the first overlapping VMA */
1690:		vma = vma_find(vmi, end);
1691:		if (!vma) {
1692:			if (unlock)
1693:				mmap_write_unlock(mm);
1694:			return 0;
1695:		}
1696:	
1697:		return do_vmi_align_munmap(vmi, vma, mm, start, end, uf, unlock);
1698:	}
 SourceFile:mm/vma.c]

203/5 2026/08/27 19:35 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 34530
							output: 37
							thoughts: 152
						

Thoughts:
**My Thought Process Regarding Folio Unmapping and CPU Offline Scenarios**

Okay, so I've been digging into this interaction between `do_vmi_align_munmap`, `unmap_region`, and CPU offline events. My initial understanding was that `do_vmi_align_munmap` would handle the cleanup. However, I noticed something critical: it explicitly calls `unmap_region` but *not* `lru_add_drain`. This immediately flagged a potential issue in my mind.

If `lru_add_drain` isn't being called by `do_vmi_align_munmap`, then the folio in question – the one being unmapped – is likely still lingering in CPU 1's `mlock_fbatch`. This is a significant observation because the next step in the scenario is that CPU 1 goes offline.

When CPU 1 goes offline, the system needs to perform cleanup operations for that CPU's resources. This is where `page_alloc_cpu_dead(1)` comes into play, executing on CPU 0. My thought then was, "What exactly does `page_alloc_cpu_dead` do to ensure proper resource management when a CPU dies?"

The function `page_alloc_cpu_dead(1)` subsequently calls `lru_add_drain_cpu(1)`. This is where my mental model started to wobble a bit. My immediate assumption was that `lru_add_drain_cpu` would be the catch-all for any pending items on the dead CPU's LRU lists. But then I re-read the previous step: `do_vmi_align_munmap` *didn't* call `lru_add_drain`. This led to a crucial question: does `lru_add_drain_cpu(1)` actually *drain* the `mlock_fbatch`?

It's not immediately obvious from the names alone. The name `lru_add_drain_cpu` suggests it's about draining LRU additions, but the fact that the folio is stuck in `mlock_fbatch` means I need to confirm if this draining mechanism also encompasses the `mlock_fbatch`. My next step, therefore, is to dive into the implementation of `lru_add_drain_cpu` to verify whether it indeed handles the cleanup of `mlock_fbatch` when a CPU goes offline, especially given that the primary unmapping path didn't perform this drain itself. This verification is key to understanding if the folio is correctly reclaimed or if there's a potential leak or race condition.


204/5 2026/08/27 19:35 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/swap.c Name:lru_add_drain_cpu]

Results:
map[SourceCode: 681:	/*
 682:	 * Drain pages out of the cpu's folio_batch.
 683:	 * Either "cpu" is the current CPU, and preemption has already been
 684:	 * disabled; or "cpu" is being hot-unplugged, and is already dead.
 685:	 */
 686:	void lru_add_drain_cpu(int cpu)
 687:	{
 688:		struct cpu_fbatches *fbatches = &per_cpu(cpu_fbatches, cpu);
 689:		struct folio_batch *fbatch = &fbatches->lru_add;
 690:		unsigned int nr_folios = folio_batch_count(fbatch);
 691:	
 692:		if (nr_folios) {
 693:			folio_batch_move_lru(fbatch, lru_add);
 694:			trace_mm_lru_add_drain_tp(cpu, nr_folios);
 695:		}
 696:	
 697:		fbatch = &fbatches->lru_move_tail;
 698:		/* Disabling interrupts below acts as a compiler barrier. */
 699:		if (data_race(folio_batch_count(fbatch))) {
 700:			unsigned long flags;
 701:	
 702:			/* No harm done if a racing interrupt already did this */
 703:			local_lock_irqsave(&cpu_fbatches.lock_irq, flags);
 704:			folio_batch_move_lru(fbatch, lru_move_tail);
 705:			local_unlock_irqrestore(&cpu_fbatches.lock_irq, flags);
 706:		}
 707:	
 708:		fbatch = &fbatches->lru_deactivate_file;
 709:		if (folio_batch_count(fbatch))
 710:			folio_batch_move_lru(fbatch, lru_deactivate_file);
 711:	
 712:		fbatch = &fbatches->lru_deactivate;
 713:		if (folio_batch_count(fbatch))
 714:			folio_batch_move_lru(fbatch, lru_deactivate);
 715:	
 716:		fbatch = &fbatches->lru_lazyfree;
 717:		if (folio_batch_count(fbatch))
 718:			folio_batch_move_lru(fbatch, lru_lazyfree);
 719:	
 720:		folio_activate_drain(cpu);
 721:	}
 SourceFile:mm/folio.c]

205/5 2026/08/27 19:35 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 35433
							output: 33
							thoughts: 1461
						

Thoughts:
**The Crucial Interplay of CPU Batches and Folio States: Unraveling a Subtle Memory Management Conundrum**

I've been deep in thought, tracing the intricate dance of folios across different CPU-local batches and the implications for memory locking and unlocking. It all started with a crucial realization: `lru_add_drain_cpu` *doesn't* actually drain the `mlock_fbatch`. My initial assumption was flawed, and that led me down a rabbit hole of understanding how `mlock_fbatch` *is* drained – by `mlock_drain_remote(cpu)`, which is called right after `lru_add_drain_cpu(cpu)` in `page_alloc_cpu_dead`.

The real complexity arises when a folio is faulted in on one CPU (let's say CPU 0) but then subjected to an `mlock` operation on another (CPU 1). Here's how I'm piecing it together:

When `lru_add_drain_cpu(1)` is called, it's attempting to drain CPU 1's `lru_add` batch. However, if the folio was initially faulted in on CPU 0, it resides in CPU 0's `lru_add` batch. Consequently, `lru_add_drain_cpu(1)` does *not* touch this folio.

Then, `mlock_drain_remote(1)` gets involved. This function *does* drain CPU 1's `mlock_fbatch`. This is where the folio, having been previously affected by `munmap` and subsequently `munlock_vma_folio`, is present in CPU 1's `mlock_fbatch` (added via `munlock_vma_folio`). `mlock_drain_remote(1)` calls `mlock_folio_batch`, which in turn calls `__munlock_folio`.

Here's the critical fork in the road: `__munlock_folio` checks `!folio_test_clear_lru(folio)`. Since the folio is *still* in CPU 0's `lru_add` batch, this check fails. It then jumps to the `munlock:` label. The folio's `PG_mlocked` flag is cleared, and `__zone_stat_mod_folio` is called with IRQs enabled – this is the point where I felt a pang of alarm, suspecting a potential issue.

I then began to question if `mlock` on CPU 1 could somehow drain CPU 0's `lru_add` batch. My understanding solidified that `lru_add_drain()` operates locally, only draining the current CPU's batch. While `mlock` on CPU 1 *could* drain CPU 1's `lru_add` batch, it wouldn't affect the folio that's stuck in CPU 0's batch. So, the folio remains in CPU 0's `lru_add` batch.

Continuing the thought experiment, when `mlock` on CPU 1 is initiated, it calls `mlock_vma_pages_range`, then `mlock_pte_range`, and finally `mlock_folio`. `mlock_folio` sets the `PG_mlocked` flag and adds the folio to CPU 1's `mlock_fbatch`, crucially marking it with `LRU_FOLIO`. Subsequently, `mlock_vma_pages_range` invokes `lru_add_drain()` on CPU 1, which *does* drain CPU 1's `mlock_fbatch`. This leads to `mlock_folio_batch` calling `__mlock_folio`.

Again, `__mlock_folio` encounters `!folio_test_clear_lru(folio)` because the folio is still in CPU 0's `lru_add` batch. It returns without performing any actions, leaving the folio with `PG_mlocked` still set.

The plot thickens with the subsequent `munmap` operation on CPU 1. This unmaps the folio, calls `munlock_vma_folio`, which then adds the folio to CPU 1's `mlock_fbatch` *without* any flags. Then, CPU 1 goes offline, triggering `page_alloc_cpu_dead(1)` on a surviving CPU (let's say CPU 0, though it could be any other).

`page_alloc_cpu_dead(1)` proceeds to call `lru_add_drain_cpu(1)` and then `mlock_drain_remote(1)`. `mlock_drain_remote(1)` drains CPU 1's `mlock_fbatch`. It calls `__munlock_folio`. Once more, `!folio_test_clear_lru(folio)` is encountered because the folio is still in CPU 0's `lru_add` batch. The execution jumps to `munlock:`, `PG_mlocked` is cleared, and `__zone_stat_mod_folio` is called with IRQs enabled.

And then, it clicked! This entire sequence is what I've been looking for. It's a perfect, albeit convoluted, path that leads to the expected outcome. I've double-checked that `mlock_folio` indeed adds to `mlock_fbatch` with `LRU_FOLIO` (via `mlock_lru(folio)`), and that `munlock_folio` adds without flags.

However, a nagging question remained: what if CPU 0's `lru_add` batch is drained *before* CPU 1 goes offline? This is where my focus shifted to preventing that scenario. The key, I realized, is to keep CPU 0 occupied. If CPU 0 is busy, spinning in a `while(1)` loop after faulting in the page, it won't schedule and thus won't execute anything that drains its `lru_add` batch (unless another CPU explicitly calls `lru_add_drain_all()`). My investigation into `mlock_vma_pages_range` and `munmap` revealed they don't trigger `lru_add_drain_all()`.

The final piece of the puzzle was understanding that `page_alloc_cpu_dead(1)` would run on a *surviving* CPU. If CPU 0 is spinning, this draining operation would likely happen on another CPU, say CPU 2. This keeps CPU 0's `lru_add` batch untouched. My concern about preemption while CPU 0 is spinning was allayed by the fact that the critical paths I'm exploring don't typically invoke `lru_add_drain_all()`, and user-space spinning is generally sufficient to avoid such premature drains in this context. I've even considered looking into whether CPU offline itself triggers `lru_add_drain_all()`, but for now, the core logic seems sound.


206/5 2026/08/27 19:36 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:lru_add_drain_all PathPrefix:kernel/cpu.c]

Results:
map[Output:]

207/5 2026/08/27 19:36 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 36925
							output: 30
							thoughts: 19
						

Thoughts:
**My Thought Process on `lru_add_drain_all`**

Alright, so my immediate instinct is to dive into the `mm/` directory and get a handle on this `lru_add_drain_all` function. I need to understand its role within the memory management subsystem, specifically how it interacts with the Least Recently Used (LRU) lists and what exactly "draining all" implies in this context. My goal is to grasp its operational mechanics – what triggers it, what data structures it manipulates, and what the end state is after it completes its execution. I'm expecting it to be a critical piece of code for managing memory pressure or flushing out pages that are no longer actively in use, and I want to be able to articulate precisely *how* it achieves that.


208/5 2026/08/27 19:36 tool grepper
0m Args:
map[Expression:lru_add_drain_all PathPrefix:mm/]

Results:
map[Output:mm/compaction.c=2562=compact_zone(struct compact_control *cc, struct capture_control *capc)
--
mm/compaction.c-2645-
mm/compaction.c:2646:	/* lru_add_drain_all could be expensive with involving other CPUs */
mm/compaction.c-2647-	lru_add_drain();
--
mm/compaction.c=2959=static int compact_nodes(void)
--
mm/compaction.c-2963-	/* Flush pending updates to the LRU lists */
mm/compaction.c:2964:	lru_add_drain_all();
mm/compaction.c-2965-
--
mm/compaction.c=3024=static ssize_t compact_store(struct device *dev,
--
mm/compaction.c-3031-		/* Flush pending updates to the LRU lists */
mm/compaction.c:3032:		lru_add_drain_all();
mm/compaction.c-3033-
--
mm/fadvise.c=31=int generic_fadvise(struct file *file, loff_t offset, loff_t len, int advice)
--
mm/fadvise.c-165-			if (nr_failed) {
mm/fadvise.c:166:				lru_add_drain_all();
mm/fadvise.c-167-				invalidate_mapping_pages(mapping, start_index,
--
mm/folio.c=822=static bool cpu_needs_drain(unsigned int cpu)
--
mm/folio.c-843- */
mm/folio.c:844:static inline void __lru_add_drain_all(bool force_all_cpus)
mm/folio.c-845-{
--
mm/folio.c-867-
mm/folio.c:868:	trace_mm_lru_add_drain_all_tp(force_all_cpus);
mm/folio.c-869-
--
mm/folio.c-892-	 * (C) Exit the draining operation if a newer generation, from another
mm/folio.c:893:	 * lru_add_drain_all(), was already scheduled for draining. Check (A).
mm/folio.c-894-	 */
--
mm/folio.c-912-	 * along, adds some pages to its per-cpu vectors, then calls
mm/folio.c:913:	 * lru_add_drain_all().
mm/folio.c-914-	 *
--
mm/folio.c-939-
mm/folio.c:940:void lru_add_drain_all(void)
mm/folio.c-941-{
mm/folio.c:942:	__lru_add_drain_all(false);
mm/folio.c-943-}
mm/folio.c-944-#else
mm/folio.c:945:void lru_add_drain_all(void)
mm/folio.c-946-{
--
mm/folio.c=961=void lru_cache_disable(void)
--
mm/folio.c-978-#ifdef CONFIG_SMP
mm/folio.c:979:	__lru_add_drain_all(true);
mm/folio.c-980-#else
--
mm/gup.c=2265=static unsigned long collect_longterm_unpinnable_folios(
--
mm/gup.c-2298-				folio_expected_ref_count(folio) + 1) {
mm/gup.c:2299:			lru_add_drain_all();
mm/gup.c-2300-			drained = 2;
--
mm/khugepaged.c=2977=static void khugepaged_do_scan(struct collapse_control *cc)
--
mm/khugepaged.c-2983-
mm/khugepaged.c:2984:	lru_add_drain_all();
mm/khugepaged.c-2985-
--
mm/khugepaged.c=3188=int madvise_collapse(struct vm_area_struct *vma, unsigned long start,
--
mm/khugepaged.c-3216-	mmgrab(mm);
mm/khugepaged.c:3217:	lru_add_drain_all();
mm/khugepaged.c-3218-
--
mm/ksm.c=2611=static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page)
--
mm/ksm.c-2638-		 */
mm/ksm.c:2639:		lru_add_drain_all();
mm/ksm.c-2640-
--
mm/memcontrol-v1.c=1835=static int mem_cgroup_force_empty(struct mem_cgroup *memcg)
--
mm/memcontrol-v1.c-1839-	/* we call try-to-free pages for make this cgroup empty */
mm/memcontrol-v1.c:1840:	lru_add_drain_all();
mm/memcontrol-v1.c-1841-
--
mm/memfd.c=156=static int memfd_wait_for_pins(struct address_space *mapping)
--
mm/memfd.c-171-		if (!scan)
mm/memfd.c:172:			lru_add_drain_all();
mm/memfd.c-173-		else if (schedule_timeout_killable((HZ << scan) / 200))
--
mm/memory-failure.c=286=static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)
--
mm/memory-failure.c-314- * Unknown page type encountered. Try to check whether it can turn PageLRU by
mm/memory-failure.c:315: * lru_add_drain_all.
mm/memory-failure.c-316- */
mm/memory-failure.c=317=void shake_folio(struct folio *folio)
--
mm/memory-failure.c-327-
mm/memory-failure.c:328:	lru_add_drain_all();
mm/memory-failure.c-329-}
--
mm/migrate_device.c=571=static unsigned long migrate_device_unmap(unsigned long *src_pfns,
--
mm/migrate_device.c-604-				/* Drain CPU's lru cache */
mm/migrate_device.c:605:				lru_add_drain_all();
mm/migrate_device.c-606-				allow_drain = false;
--
mm/vmscan.c=7886=int user_proactive_reclaim(char *buf,
--
mm/vmscan.c-7950-		if (!nr_retries)
mm/vmscan.c:7951:			lru_add_drain_all();
mm/vmscan.c-7952-
]

209/5 2026/08/27 19:36 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 38815
							output: 39
							thoughts: 1748
						

Thoughts:
**My Thought Process on the `lru_add_drain_all` Behavior and Reproducer Development**

My primary concern here is understanding the behavior of `lru_add_drain_all` and how it interacts with CPU offline events, particularly when a CPU's `lru_add` batch might not be drained in the expected manner. I need to create a reliable reproducer for a specific issue I suspect.

Initially, I noted that `lru_add_drain_all` isn't explicitly called during CPU offline. This is a crucial starting point. If CPU 0 is in a tight loop (spinning), its `lru_add` batch won't be drained by this mechanism.

I then considered the implications of CPU 0 spinning in user space. A timer interrupt could occur, but I recalled that timer interrupts *don't* drain the `lru_add` batch. So, a user-space spin seems plausible for the reproducer.

The key question became: what if CPU 0 is spinning in user space and gets preempted by a workqueue item that *does* trigger `lru_add_drain_all`? If another CPU calls `lru_add_drain_all()`, it schedules a work item on CPU 0. If CPU 0 is spinning in user space, it *will* be preempted by the workqueue thread, and that thread will execute `lru_add_drain_cpu(0)`, effectively draining CPU 0's `lru_add` batch. This is exactly what I want to *avoid* for my reproducer, as it would interfere with the race condition I'm trying to trigger.

To prevent this preemption and subsequent draining, I reasoned that spinning in kernel space would be the solution. Kernel-space spinning would prevent the workqueue thread from taking over. But how to spin in kernel space without sleeping? I need a syscall that blocks or spins but *doesn't sleep*.

However, I then had a realization: I don't actually need to spin *forever*. The critical window is the time between CPU 0 faulting a page (adding it to its `lru_add` batch) and CPU 1 being offlined. If this period is short, the likelihood of the `lru_add` batch being drained by an unexpected `lru_add_drain_all` call is low. Given that `lru_add_drain_all` isn't called frequently in normal operation, a simple user-space spin for a short duration *should* be sufficient for a reproducer.

This leads me to refine the reproducer. The core idea is to:
1.  Pin thread 0 to CPU 0.
2.  Pin thread 1 to CPU 1.
3.  Thread 0 faults a page into memory. This page will land in CPU 0's `lru_add` batch.
4.  Thread 1 then performs an `mlock` on this page. My understanding is that `mlock` on CPU 1 *shouldn't* drain CPU 0's batch, but it might interact with CPU 1's own batches.
5.  Thread 1 then `munmap`s the page. This is where I'm digging deeper. I need to be sure that `munmap`, after an `mlock`, doesn't inadvertently drain CPU 0's `lru_add` batch.

I've been double-checking the `munmap` path. My initial thought was that `mlock` sets `VM_LOCKED`, and then `munmap` would call `munlock_vma_folio`. I confirmed this by looking at `zap_present_folio_ptes`, which calls `folio_remove_rmap_ptes`, which in turn calls `__folio_remove_rmap`, and indeed, `munlock_vma_folio` is invoked. This confirms that the VMA's pages are processed during `munmap` when locked.

Furthermore, I've verified that `mlock` calls `mlock_vma_pages_range`, which *does* call `lru_add_drain()`. However, my understanding is that `lru_add_drain()` only drains the *local* CPU's batch (CPU 1 in this case), not CPU 0's. This is good – it means CPU 0's batch remains undrained, which is what I need for the race.

My final check is whether `munmap` itself could drain the `mlock_fbatch`. I'm tracing through `unmap_region` and `tlb_finish_mmu` to understand their behavior regarding these batches.

In summary, my thought process has been a cycle of:
*   Identifying the core mechanism (`lru_add_drain_all`) and its absence in specific scenarios (CPU offline).
*   Hypothesizing potential interactions (timer interrupts, workqueues, preemption).
*   Evaluating solutions (kernel vs. user-space spin).
*   Refining the reproducer strategy based on practical considerations (short spin duration).
*   Deep-diving into specific syscall implementations (`mlock`, `munmap`) and their interaction with the relevant data structures (`lru_add` batch, `mlock_fbatch`, VMAs) to confirm the expected behavior and ensure the reproducer targets the intended race condition.


210/5 2026/08/27 19:36 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mmu_gather.c Name:tlb_finish_mmu]

Results:
map[SourceCode: 508:	/**
 509:	 * tlb_finish_mmu - finish an mmu_gather structure
 510:	 * @tlb: the mmu_gather structure to finish
 511:	 *
 512:	 * Called at the end of the shootdown operation to free up any resources that
 513:	 * were required.
 514:	 */
 515:	void tlb_finish_mmu(struct mmu_gather *tlb)
 516:	{
 517:		/*
 518:		 * We expect an earlier huge_pmd_unshare_flush() call to sort this out,
 519:		 * due to complicated locking requirements with page table unsharing.
 520:		 */
 521:		VM_WARN_ON_ONCE(tlb->fully_unshared_tables);
 522:	
 523:		/*
 524:		 * If there are parallel threads are doing PTE changes on same range
 525:		 * under non-exclusive lock (e.g., mmap_lock read-side) but defer TLB
 526:		 * flush by batching, one thread may end up seeing inconsistent PTEs
 527:		 * and result in having stale TLB entries.  So flush TLB forcefully
 528:		 * if we detect parallel PTE batching threads.
 529:		 *
 530:		 * However, some syscalls, e.g. munmap(), may free page tables, this
 531:		 * needs force flush everything in the given range. Otherwise this
 532:		 * may result in having stale TLB entries for some architectures,
 533:		 * e.g. aarch64, that could specify flush what level TLB.
 534:		 */
 535:		if (mm_tlb_flush_nested(tlb->mm)) {
 536:			/*
 537:			 * The aarch64 yields better performance with fullmm by
 538:			 * avoiding multiple CPUs spamming TLBI messages at the
 539:			 * same time.
 540:			 *
 541:			 * On x86 non-fullmm doesn't yield significant difference
 542:			 * against fullmm.
 543:			 */
 544:			tlb->fullmm = 1;
 545:			__tlb_reset_range(tlb);
 546:			tlb->freed_tables = 1;
 547:		}
 548:	
 549:		tlb_flush_mmu(tlb);
 550:	
 551:	#ifndef CONFIG_MMU_GATHER_NO_GATHER
 552:		tlb_batch_list_free(tlb);
 553:	#endif
 554:		dec_tlb_flush_pending(tlb->mm);
 555:	}
 SourceFile:mm/mmu_gather.c]

211/5 2026/08/27 19:36 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 41372
							output: 32
							thoughts: 2362
						

Thoughts:
**My Thought Process on the Folio Locking and CPU Offline Scenario**

My initial focus was tracing the execution path from `tlb_flush_mmu`. I saw the calls to `tlb_flush_mmu_free`, `free_pages_and_pte_range`, and `tlb_batch_pages_flush` leading to `free_pages`. I specifically noted that `lru_add_drain` was *not* called at this stage.

Then, I shifted my attention to `munmap`. I questioned whether `munmap` directly called `mlock_drain_local`. The answer was no. This led me to consider the state of the folio within CPU 1's `mlock_fbatch`.

My next critical thought was about what happens if `munmap` actually *frees* the page. If `munmap` frees the page, `put_page` would be called. If the page's reference count dropped to zero, it would indeed be freed. However, I then realized a crucial detail: the page is still in CPU 0's `lru_add` batch! This batch itself holds a reference to the page. Therefore, the page's reference count would *not* drop to zero; it would remain at least one, held by the `lru_add` batch. This, I thought, was a perfect scenario – the page wouldn't be freed, making it safe to access later during `mlock_drain_remote`.

I then revisited CPU 1's `mlock_fbatch`. I reasoned that `munlock_folio` calls `folio_get(folio)` *before* adding it to `mlock_fbatch`. This means CPU 1's batch also holds a reference. So, the page's reference count would be at least two, guaranteeing it wouldn't be freed.

My next step was to consider the eventuality of `mlock_folio_batch` processing the folio. I followed the calls: `mlock_folio_batch` calls `__munlock_folio`. Inside `__munlock_folio`, there's a check: `!folio_test_clear_lru(folio)`. Since the folio was in CPU 0's `lru_add` batch, it wasn't actually on the LRU list, so `folio_test_clear_lru(folio)` would return false. This would cause a jump to the `munlock:` label. The code would then call `__zone_stat_mod_folio(folio, NR_MLOCK, -nr_pages)`. I recognized that this specific call, with preemption enabled, would trigger the warning I was investigating. After `__munlock_folio` returned, `mlock_folio_batch` would call `folios_put(fbatch)`, dropping the reference held by CPU 1's `mlock_fbatch`. This would bring the page's reference count back down to one, held solely by CPU 0's `lru_add` batch. Everything seemed perfectly consistent at this point.

At this juncture, I turned to the reproducer code to solidify my understanding. I was checking my assumptions about the `mlock` call on CPU 1. I asked myself, "Is it possible that `mlock` on CPU 1 does NOT drain its `mlock_fbatch`?" I traced the path: `mlock` calls `mlock_vma_pages_range`, which indeed calls `lru_add_drain()`. And `lru_add_drain()` calls `mlock_drain_local()`. So, yes, it *does* drain its `mlock_fbatch`. I then clarified a potential timing issue: what if `mlock_folio` is called *after* `lru_add_drain()`? I saw that `mlock_vma_pages_range` calls `lru_add_drain()` both *before* and *after* `walk_page_range_vma`. Since `mlock_folio` is called during `walk_page_range_vma`, and `lru_add_drain()` is called *after* it, my conclusion held: the `mlock_fbatch` *is* drained. This was good.

My next concern was about `munmap`. I queried, "Is there any chance that `munmap` drains the `mlock_fbatch`?" I confirmed that `munmap` itself does not call `lru_add_drain()`. However, I pondered what would happen if the `mlock_fbatch` became full. The `folio_batch_add` function returns false if the batch is full, leading `munlock_folio` to call `mlock_folio_batch`. But I realized that in this specific scenario, we are only adding *one* folio to the batch, so it wouldn't become full.

Finally, I considered the crucial scenario of CPU 1 being offlined. I asked, "What if CPU 1 is offlined, and the surviving CPU that runs `page_alloc_cpu_dead(1)` is CPU 0?" My initial thought was that if CPU 0 runs `page_alloc_cpu_dead(1)`, it would do so with preemption enabled. But then I corrected myself: if CPU 0 is running `page_alloc_cpu_dead(1)`, it means CPU 0 is *not* spinning in user space, which contradicts the reproducer's setup. This led me to the realization that it *must* be run by another CPU (e.g., CPU 2 or 3). However, I then considered the case of a system with only two CPUs. If CPU 1 is being offlined, the process is initiated by the main thread. Since CPU 1 is offline, the main thread must be on CPU 0. If the main thread is on CPU 0, then `thread0` (pinned to CPU 0) would be preempted, not spinning. I then questioned if this preemption mattered. My reasoning was that as long as `lru_add_drain_all()` wasn't called, CPU 0's `lru_add` batch wouldn't be drained. I then considered whether the CPU offline code itself calls `lru_add_drain_all()`, prompting me to look into `cpu_down`.


212/5 2026/08/27 19:37 tool codesearch-definition-source
0m Args:
map[ContextFile:kernel/cpu.c Name:cpu_down]

Results:
map[SourceCode:1486:	static int cpu_down(unsigned int cpu, enum cpuhp_state target)
1487:	{
1488:		int err;
1489:	
1490:		cpu_maps_update_begin();
1491:		err = cpu_down_maps_locked(cpu, target);
1492:		cpu_maps_update_done();
1493:		return err;
1494:	}
 SourceFile:kernel/cpu.c]

213/5 2026/08/27 19:37 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 43893
							output: 33
							thoughts: 16
						

Thoughts:
**My Thought Process**

Alright, so I'm looking at this code, and it seems pretty straightforward. When `cpu_down_maps_locked` gets called, my immediate thought is: "Okay, what happens next?" I'm tracing the execution flow, and the very next step, the direct consequence of `cpu_down_maps_locked` being invoked, is that it then calls `_cpu_down`. That's the immediate, low-level action that unfolds. It's not a complex branching logic at this point; it's a direct dependency.


214/5 2026/08/27 19:37 tool codesearch-definition-source
0m Args:
map[ContextFile:kernel/cpu.c Name:_cpu_down]

Results:
map[SourceCode:1402:	/* Requires cpu_add_remove_lock to be held */
1403:	static int __ref _cpu_down(unsigned int cpu, int tasks_frozen,
1404:				   enum cpuhp_state target)
1405:	{
1406:		struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu);
1407:		int prev_state, ret = 0;
1408:	
1409:		if (num_online_cpus() == 1)
1410:			return -EBUSY;
1411:	
1412:		if (!cpu_present(cpu))
1413:			return -EINVAL;
1414:	
1415:		cpus_write_lock();
1416:	
1417:		/*
1418:		 * Keep at least one housekeeping cpu onlined to avoid generating
1419:		 * an empty sched_domain span.
1420:		 */
1421:		if (cpumask_any_and(cpu_online_mask,
1422:				    housekeeping_cpumask(HK_TYPE_DOMAIN)) >= nr_cpu_ids) {
1423:			ret = -EBUSY;
1424:			goto out;
1425:		}
1426:	
1427:		cpuhp_tasks_frozen = tasks_frozen;
1428:	
1429:		prev_state = cpuhp_set_state(cpu, st, target);
1430:		/*
1431:		 * If the current CPU state is in the range of the AP hotplug thread,
1432:		 * then we need to kick the thread.
1433:		 */
1434:		if (st->state > CPUHP_TEARDOWN_CPU) {
1435:			st->target = max((int)target, CPUHP_TEARDOWN_CPU);
1436:			ret = cpuhp_kick_ap_work(cpu);
1437:			/*
1438:			 * The AP side has done the error rollback already. Just
1439:			 * return the error code..
1440:			 */
1441:			if (ret)
1442:				goto out;
1443:	
1444:			/*
1445:			 * We might have stopped still in the range of the AP hotplug
1446:			 * thread. Nothing to do anymore.
1447:			 */
1448:			if (st->state > CPUHP_TEARDOWN_CPU)
1449:				goto out;
1450:	
1451:			st->target = target;
1452:		}
1453:		/*
1454:		 * The AP brought itself down to CPUHP_TEARDOWN_CPU. So we need
1455:		 * to do the further cleanups.
1456:		 */
1457:		ret = cpuhp_down_callbacks(cpu, st, target);
1458:		if (ret && st->state < prev_state) {
1459:			if (st->state == CPUHP_TEARDOWN_CPU) {
1460:				cpuhp_reset_state(cpu, st, prev_state);
1461:				__cpuhp_kick_ap(st);
1462:			} else {
1463:				WARN(1, "DEAD callback error for CPU%d", cpu);
1464:			}
1465:		}
1466:	
1467:	out:
1468:		cpus_write_unlock();
1469:		arch_smt_update();
1470:		return ret;
1471:	}
 SourceFile:kernel/cpu.c]

215/5 2026/08/27 19:37 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 44949
							output: 32
							thoughts: 175
						

Thoughts:
**My Thought Process**

Ah, I've just realized something quite critical. The system, in its current configuration, isn't invoking `lru_add_drain_all()`. This is a significant point because it means that even if CPU 0 is responsible for the main thread's execution, its `lru_add` batch won't be automatically flushed.

Now, I'm pondering if there's a scenario where CPU 0 *might* call `lru_add_drain()`. My initial thought goes to interactions with sysfs – does writing to sysfs trigger this drainage? A quick check reveals: no, it doesn't.

This leads me back to the original observation: CPU 0's `lru_add` batch remains undrained. And frankly, this is precisely the behavior I was hoping for. The implication is that we don't actually need CPU 0 to be in a busy-waiting or spinning state. The requirement is far simpler: CPU 0 merely needs to perform the page fault operation and, crucially, *not* execute `lru_add_drain()`.

Then, another question arises: what happens if `thread0` (presumably the main thread on CPU 0) exits? Does the process of exiting involve calling `lru_add_drain()`? I'll need to dive into the `do_exit` function to verify this.


216/5 2026/08/27 19:37 tool codesearch-definition-source
0m Args:
map[ContextFile:kernel/exit.c Name:do_exit]

Results:
map[SourceCode: 928:	void __noreturn do_exit(long code)
 929:	{
 930:		struct task_struct *tsk = current;
 931:		struct kthread *kthread;
 932:		int group_dead;
 933:	
 934:		WARN_ON(irqs_disabled());
 935:		WARN_ON(tsk->plug);
 936:	
 937:		kthread = tsk_is_kthread(tsk);
 938:		if (unlikely(kthread))
 939:			kthread_do_exit(kthread, code);
 940:	
 941:		kcov_task_exit(tsk);
 942:		kmsan_task_exit(tsk);
 943:	
 944:		synchronize_group_exit(tsk, code);
 945:		ptrace_event(PTRACE_EVENT_EXIT, code);
 946:		user_events_exit(tsk);
 947:	
 948:		io_uring_files_cancel();
 949:		sched_mm_cid_exit(tsk);
 950:		exit_signals(tsk);  /* sets PF_EXITING */
 951:	
 952:		seccomp_filter_release(tsk);
 953:	
 954:		acct_update_integrals(tsk);
 955:		group_dead = atomic_dec_and_test(&tsk->signal->live);
 956:		if (group_dead) {
 957:			/*
 958:			 * If the last thread of global init has exited, panic
 959:			 * immediately to get a useable coredump.
 960:			 */
 961:			if (unlikely(is_global_init(tsk)))
 962:				panic("Attempted to kill init! exitcode=0x%08x\n",
 963:					tsk->signal->group_exit_code ?: (int)code);
 964:	
 965:	#ifdef CONFIG_POSIX_TIMERS
 966:			hrtimer_cancel(&tsk->signal->real_timer);
 967:			exit_itimers(tsk);
 968:	#endif
 969:			if (tsk->mm)
 970:				setmax_mm_hiwater_rss(&tsk->signal->maxrss, tsk->mm);
 971:		}
 972:		acct_collect(code, group_dead);
 973:		if (group_dead)
 974:			tty_audit_exit();
 975:		audit_free(tsk);
 976:	
 977:		tsk->exit_code = code;
 978:		taskstats_exit(tsk, group_dead);
 979:		trace_sched_process_exit(tsk, group_dead);
 980:	
 981:		/*
 982:		 * Since sampling can touch ->mm, make sure to stop everything before we
 983:		 * tear it down.
 984:		 *
 985:		 * Also flushes inherited counters to the parent - before the parent
 986:		 * gets woken up by child-exit notifications.
 987:		 */
 988:		perf_event_exit_task(tsk);
 989:		/*
 990:		 * PF_EXITING (above) ensures unwind_deferred_request() will no
 991:		 * longer add new unwinds. While exit_mm() (below) will destroy the
 992:		 * abaility to do unwinds. So flush any pending unwinds here.
 993:		 */
 994:		unwind_deferred_task_exit(tsk);
 995:	
 996:		exit_mm();
 997:	
 998:		if (group_dead)
 999:			acct_process();
1000:	
1001:		exit_sem(tsk);
1002:		exit_shm(tsk);
1003:		exit_files(tsk);
1004:		exit_fs(tsk);
1005:		if (group_dead)
1006:			disassociate_ctty(1);
1007:		exit_nsproxy_namespaces(tsk);
1008:		exit_task_work(tsk);
1009:		exit_thread(tsk);
1010:	
1011:		sched_autogroup_exit_task(tsk);
1012:		cgroup_task_exit(tsk);
1013:	
1014:		/*
1015:		 * FIXME: do that only when needed, using sched_exit tracepoint
1016:		 */
1017:		flush_ptrace_hw_breakpoint(tsk);
1018:	
1019:		exit_tasks_rcu_start();
1020:		exit_notify(tsk, group_dead);
1021:		proc_exit_connector(tsk);
1022:		mpol_put_task_policy(tsk);
1023:	#ifdef CONFIG_FUTEX
1024:		if (unlikely(current->futex.pi_state_cache))
1025:			kfree(current->futex.pi_state_cache);
1026:	#endif
1027:		/*
1028:		 * Make sure we are holding no locks:
1029:		 */
1030:		debug_check_no_locks_held();
1031:	
1032:		if (tsk->io_context)
1033:			exit_io_context(tsk);
1034:	
1035:		if (tsk->splice_pipe)
1036:			free_pipe_info(tsk->splice_pipe);
1037:	
1038:		if (tsk->task_frag.page)
1039:			put_page(tsk->task_frag.page);
1040:	
1041:		exit_task_stack_account(tsk);
1042:	
1043:		check_stack_usage();
1044:		preempt_disable();
1045:		if (tsk->nr_dirtied)
1046:			__this_cpu_add(dirty_throttle_leaks, tsk->nr_dirtied);
1047:		exit_rcu();
1048:		exit_tasks_rcu_finish();
1049:	
1050:		lockdep_free_task(tsk);
1051:		do_task_dead();
1052:	}
 SourceFile:kernel/exit.c]

217/5 2026/08/27 19:37 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 46929
							output: 34
							thoughts: 69
						

Thoughts:
**My Thought Process Unraveling Memory Management Exit**

Okay, I'm tracing the memory management cleanup path. My current focus is on the `exit_mm` function. I know it initiates the process of releasing memory associated with a process. My understanding is that `exit_mm` itself doesn't do the heavy lifting of page unmapping directly, but rather delegates that task. I'm tracing it, and I see that `exit_mm` calls `mmput`. Following the trail further, `mmput` then calls `__mmput`. It's within `__mmput` that the actual memory deallocation logic for the address space starts to kick in. I'm observing that `__mmput` subsequently calls `exit_mmap`.

Now, `exit_mmap` is where the core of the address space teardown happens. I see that it calls `unmap_vmas`. This function is responsible for iterating through the virtual memory areas (VMAs) and, critically, unmapping the associated pages. This is the step where the physical memory backing these pages will be released.

A key question that arises for me at this point, given my expertise in memory management, is about the interaction with the LRU (Least Recently Used) lists. Specifically, I'm wondering if `exit_mmap` directly triggers any operations to drain or process the LRU lists as part of its unmapping process. It seems plausible that as pages are unmapped and released, they might need to be properly accounted for or removed from active consideration by the page reclaim mechanism. Therefore, I'm making a mental note to specifically check the implementation of `exit_mmap` to see if it includes a call to `lru_add_drain()` or a similar function that would handle this LRU list management.


218/5 2026/08/27 19:37 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mmap.c Name:exit_mmap]

Results:
map[SourceCode:1287:	/* Release all mmaps. */
1288:	void exit_mmap(struct mm_struct *mm)
1289:	{
1290:		struct mmu_gather tlb;
1291:		struct vm_area_struct *vma;
1292:		unsigned long nr_accounted = 0;
1293:		VMA_ITERATOR(vmi, mm, 0);
1294:		struct unmap_desc unmap;
1295:	
1296:		/* mm's last user has gone, and its about to be pulled down */
1297:		mmu_notifier_release(mm);
1298:	
1299:		mmap_read_lock(mm);
1300:		arch_exit_mmap(mm);
1301:	
1302:		vma = vma_next(&vmi);
1303:		if (!vma) {
1304:			/* Can happen if dup_mmap() received an OOM */
1305:			mmap_read_unlock(mm);
1306:			mmap_write_lock(mm);
1307:			goto destroy;
1308:		}
1309:	
1310:		unmap_all_init(&unmap, &vmi, vma);
1311:		flush_cache_mm(mm);
1312:		tlb_gather_mmu_fullmm(&tlb, mm);
1313:		/* update_hiwater_rss(mm) here? but nobody should be looking */
1314:		/* Use ULONG_MAX here to ensure all VMAs in the mm are unmapped */
1315:		unmap_vmas(&tlb, &unmap);
1316:		mmap_read_unlock(mm);
1317:	
1318:		/*
1319:		 * Set MMF_OOM_SKIP to hide this task from the oom killer/reaper
1320:		 * because the memory has been already freed.
1321:		 */
1322:		mm_flags_set(MMF_OOM_SKIP, mm);
1323:		mmap_write_lock(mm);
1324:		unmap.mm_wr_locked = true;
1325:		mt_clear_in_rcu(&mm->mm_mt);
1326:		unmap_pgtable_init(&unmap, &vmi);
1327:		free_pgtables(&tlb, &unmap);
1328:		tlb_finish_mmu(&tlb);
1329:	
1330:		/*
1331:		 * Walk the list again, actually closing and freeing it, with preemption
1332:		 * enabled, without holding any MM locks besides the unreachable
1333:		 * mmap_write_lock.
1334:		 */
1335:		nr_accounted = tear_down_vmas(mm, &vmi, vma, ULONG_MAX);
1336:	
1337:	destroy:
1338:		__mt_destroy(&mm->mm_mt);
1339:		trace_exit_mmap(mm);
1340:		mmap_write_unlock(mm);
1341:		vm_unacct_memory(nr_accounted);
1342:	}
 SourceFile:mm/mmap.c]

219/5 2026/08/27 19:37 llm strategy-refiner
1m Model:
gemini-3.1-pro-preview

Tokens:
							input: 47929
							output: 35
							thoughts: 5237
						

Thoughts:
**The Core of My Current Thought Process: A Subtle Race Condition in Memory Management**

My current focus is on understanding and reproducing a specific kernel bug related to how pages are managed when they are in a per-CPU batch but not yet on the global LRU list, especially during specific lifecycle events like process exit or CPU hotplug. The problem seems to revolve around the interaction between per-CPU `lru_add` batches, `mlock` operations, and the state of a page when its references are being cleared.

Initially, I was investigating whether `exit_mmap` might call `lru_add_drain()`. My immediate thought was, "No, it doesn't seem to." This led me to a critical realization: if `lru_add_drain()` is *not* called during process exit, then a thread exiting might leave its `lru_add` batch undrained. This is an important detail because `lru_add` batches are per-CPU, not per-task. So, if `thread0` exits, its `lru_add` batch remains on CPU 0, which is actually beneficial for my reproducers. It means we don't need the thread to spin indefinitely to keep the batch from being drained. The page just needs to be faulted in, and then the thread can exit or continue spinning; the batch stays put.

However, a new concern emerged: what if another task runs on CPU 0 and *does* call `lru_add_drain()`? To prevent this from interfering with the state of the `lru_add` batch, it became clear that the original thread (let's call it `thread0`) *should* remain spinning on CPU 0. This ensures that the batch isn't prematurely drained by another task on that CPU.

This line of reasoning directly led me to start thinking about crafting a C reproducer.

My thought process then evolved as I considered the specifics of the reproducer and the interactions between threads and CPUs:

*   **Thread Pinning:** I realized that `thread0` needed to be pinned to CPU 0 to ensure its `lru_add` batch stays there. Similarly, another thread, `thread1`, would be pinned to CPU 1 for its own operations.
*   **The Role of `mlock` and `munmap`:** I hypothesized that a page, after being faulted in by `thread0` (and thus sitting in CPU 0's `lru_add` batch), would then be subject to `mlock` by `thread1` on CPU 1. The key insight here is that `__mlock_folio` would see that the page is not yet on the global LRU list (because it's still in CPU 0's batch) and thus wouldn't immediately add it to the LRU. It would, however, set the `PG_mlocked` flag and add the page to CPU 1's `mlock_fbatch`. Then, `munmap` would be called. I understood that `munmap` on a locked VMA would trigger `munlock_vma_folio`, which would add the page to CPU 1's `mlock_fbatch` without any special flags (like `LRU_FOLIO`). Crucially, `munmap` itself does not drain the `mlock_fbatch`.
*   **The CPU Offline Trigger:** The original hypothesis for triggering the bug involved offlining CPU 1. The idea was that the kernel's CPU offline process (`page_alloc_cpu_dead`) would eventually call `mlock_drain_remote` on a surviving CPU. This, in turn, would call `__munlock_folio`. My expectation was that `__munlock_folio` would see the page isn't on the LRU, skip the LRU lock, and then call `__zone_stat_mod_folio` with preemption enabled, leading to the warning.
*   **Refining `thread1`'s Behavior:** I initially considered having `thread1` exit after its operations. However, I questioned if `do_exit` might indirectly call `lru_add_drain()`. Since I couldn't find evidence of this, exiting seemed safe. But to be absolutely certain and avoid any potential race with `task_work` or kworkers, I decided it would be even safer for `thread1` to simply sleep after its core actions, ensuring it remains active but doesn't actively participate in draining batches.
*   **The `munlock` Revelation:** This was a significant turning point. While reviewing the interactions, I realized that `munlock` itself, after `mlock`, could be the direct trigger. My trace of `munlock`'s path showed that it would indeed add the page to CPU 1's `mlock_fbatch`, and then `lru_add_drain()` (called by `mlock_vma_pages_range` as part of `munlock`'s internal handling) would drain this batch. This draining would lead to `__munlock_folio` being called on CPU 1. Because the page is still in CPU 0's `lru_add` batch, `__munlock_folio` would correctly identify it's not on the LRU and proceed to clear `PG_mlocked`. The critical part is that it would then call `__zone_stat_mod_folio` with preemption enabled. This meant the bug could be triggered *without* needing to offline a CPU, simplifying the reproducer significantly. The warning would occur directly on CPU 1 as it processes the `munlock` operation.
*   **Ensuring Main Thread Safety:** To prevent the main thread from interfering with the critical operations on CPU 0 and CPU 1, I decided to pin the main thread to a different CPU (e.g., CPU 2 or higher). This minimizes the chance of the main thread preempting the crucial `thread0` or `thread1` at the wrong moment, especially since `thread0`'s spinning is intended to keep its `lru_add` batch intact.

This iterative process of hypothesizing, tracing kernel code paths in my mind, and refining the reproducer's logic has brought me to a point where I believe I have a robust understanding of the race condition and a clear path to constructing the C code to demonstrate it. The key is the specific ordering of operations: faulting into CPU 0's batch, then an `mlock` that adds to CPU 1's batch (but doesn't find it on LRU), followed by `munlock` which drains CPU 1's batch and attempts to clean up the page state, ultimately leading to the problematic `__zone_stat_mod_folio` call.


220/5 2026/08/27 19:38 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/swap.c Name:lru_add_drain]

Results:
map[SourceCode: 781:	void lru_add_drain(void)
 782:	{
 783:		local_lock(&cpu_fbatches.lock);
 784:		lru_add_drain_cpu(smp_processor_id());
 785:		local_unlock(&cpu_fbatches.lock);
 786:		mlock_drain_local();
 787:	}
 SourceFile:mm/folio.c]

221/5 2026/08/27 19:38 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 53315
							output: 36
							thoughts: 87
						

Thoughts:
**The Preemption Conundrum in `lru_add_drain`**

I'm trying to unravel a subtlety in the `lru_add_drain` function, specifically regarding preemption handling. My observation is that `lru_add_drain` acquires a `local_lock` on `cpu_fbatches.lock`. My understanding is that acquiring such a lock, especially in a PREEMPT_RT environment, is intended to disable preemption or at least prevent migration on the current CPU. However, what immediately follows is the release of this same lock, `local_unlock(&cpu_fbatches.lock)`. This sequence leads me to a crucial point: when `mlock_drain_local()` is subsequently called, preemption is, in fact, *enabled*. This is a significant detail, and I need to delve into the `mlock_drain_local()` function itself to fully grasp the implications of this state.


222/5 2026/08/27 19:38 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:mlock_drain_local]

Results:
map[SourceCode: 212:	void mlock_drain_local(void)
 213:	{
 214:		struct folio_batch *fbatch;
 215:	
 216:		local_lock(&mlock_fbatch.lock);
 217:		fbatch = this_cpu_ptr(&mlock_fbatch.fbatch);
 218:		if (folio_batch_count(fbatch))
 219:			mlock_folio_batch(fbatch);
 220:		local_unlock(&mlock_fbatch.lock);
 221:	}
 SourceFile:mm/mlock.c]

223/5 2026/08/27 19:38 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 53600
							output: 36
							thoughts: 133
						

Thoughts:
**The Revelation Regarding Folio Lock Preemption and CPU Offline**

My initial thought process was focused on a particular observation: why does a specific warning related to `__zone_stat_mod_folio` only manifest during the CPU offline process? I had been investigating this anomaly, and a crucial piece of the puzzle clicked into place.

It all started with a closer examination of the `mlock_drain_local` function. I realized that this function, in turn, calls `local_lock(&mlock_fbatch.lock)`. Now, my expertise tells me that `local_lock` has a critical side effect: it **disables preemption**. This was the key insight.

Therefore, when `mlock_folio_batch` is invoked *from* `mlock_drain_local`, preemption is indeed disabled. And if preemption is disabled, the mechanism that triggers the `__zone_stat_mod_folio` warning is effectively bypassed. This explained why I wasn't seeing the warning in that particular execution path.

But then, the question remained: why *only* during CPU offline? My next step was to revisit `mlock_drain_remote`. My recollection, and now a quick mental re-check, confirms that it is `mlock_drain_remote` that is invoked during CPU offline. This function operates differently regarding preemption. This contrast is the core of the explanation for the observed behavior. The fact that the warning appears *only* during CPU offline strongly suggests that the `mlock_drain_remote` path, which *is* executed during CPU offline, does *not* have preemption disabled in the same way `mlock_drain_local` does, thus allowing the `__zone_stat_mod_folio` warning to surface.


224/5 2026/08/27 19:38 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:mlock_drain_remote]

Results:
map[SourceCode: 223:	void mlock_drain_remote(int cpu)
 224:	{
 225:		struct folio_batch *fbatch;
 226:	
 227:		WARN_ON_ONCE(cpu_online(cpu));
 228:		fbatch = &per_cpu(mlock_fbatch.fbatch, cpu);
 229:		if (folio_batch_count(fbatch))
 230:			mlock_folio_batch(fbatch);
 231:	}
 SourceFile:mm/mlock.c]

225/5 2026/08/27 19:38 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 53915
							output: 16
							thoughts: 1254
						

Thoughts:
**The Root Cause Revealed: Preemption and the `mlock_drain_remote` Conundrum**

My analysis has hit a critical breakthrough. I've realized that `mlock_drain_remote` *doesn't* call `local_lock` as I initially might have suspected. Instead, it directly invokes `mlock_folio_batch(fbatch)`, and crucially, this happens when `page_alloc_cpu_dead` is called with preemption *enabled*. This means `mlock_drain_remote` is indeed calling `mlock_folio_batch` with preemption enabled, which explains precisely why the warning only manifests during CPU offline events.

This is a truly insightful finding. The bug stems from a subtle interplay: either `mlock_drain_remote` fails to disable preemption, or `__munlock_folio` incorrectly assumes preemption is disabled when the `lruvec` is NULL. The latter condition, `lruvec` being NULL, is exclusively true when called from `mlock_drain_local`.

Therefore, my initial hypothesis that a CPU offline event is necessary for reproduction holds firm. The reproducer I've crafted is, in fact, entirely correct and demonstrates this specific scenario perfectly.

My next step is to refine this reproducer to ensure its absolute robustness, making it as foolproof as possible. The code provided above represents the finalized version of this carefully constructed test case. I believe no further tooling is required at this juncture.


226/5 2026/08/27 19:39 tool get-toolkit
0m Args:
map[Name:race]

Results:
map[Toolkit:// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"

// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.

#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>

// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)

// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu)                                                \
	do {                                                           \
		cpu_set_t mask;                                        \
		CPU_ZERO(&mask);                                       \
		CPU_SET(cpu, &mask);                                   \
		if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
			perror("sched_setaffinity");                   \
		}                                                      \
	} while (0)

// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)

// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val)                                               \
	do {                                                             \
		while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
			;                                                \
	} while (0)

// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)

// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).

static inline double timer_elapsed_sec(struct timespec* start)
{
	struct timespec now;
	if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
		perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
		exit(1);
	}
	return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}

// Initialize a monotonic timer variable.
#define TIMER_START(t)                                          \
	struct timespec t;                                      \
	if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) {         \
		perror("clock_gettime(CLOCK_MONOTONIC) start"); \
		exit(1);                                        \
	}

// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))

// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
	int state;
} event_t;

static void event_init(event_t* ev)
{
	ev->state = 0;
}
static void event_reset(event_t* ev)
{
	ev->state = 0;
}

static void event_set(event_t* ev)
{
	if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
		fprintf(stderr, "event already set\n");
		exit(1);
	}
	__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
	syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}

static void event_wait(event_t* ev)
{
	while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
		syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}

// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
	int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
	if (uffd == -1)
		return -1;
	struct uffdio_api api = {.api = UFFD_API, .features = 0};
	if (ioctl(uffd, UFFDIO_API, &api) == -1) {
		close(uffd);
		return -1;
	}
	struct uffdio_register reg = {
	    .range = {.start = (uintptr_t)addr, .len = len},
	    .mode = UFFDIO_REGISTER_MODE_MISSING};
	if (ioctl(uffd, UFFDIO_REGISTER, &reg) == -1) {
		close(uffd);
		return -1;
	}
	return uffd;
}

// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
//    pause a thread accessing that memory until you handle the fault, creating a reliable
//    and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
//    immediately. This is essential for understanding the exact interleaving of events
//    when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
//    or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
//    Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
//        TIMER_START(start);
//        while (TIMER_NOT_EXPIRED(start, 10.0)) {
//            // Your race logic here
//        }
]

227/5 2026/08/27 19:39 llm strategy-refiner
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 56851
							output: 1401
							thoughts: 1171
						

Thoughts:
**My Thought Process for Crafting This Exploit Reproducer**

Right, let's get this done. I've been looking at the tools available in this `race_toolkit`. I see `PIN_TO_CPU`, `WAIT_ON`, `SIGNAL`, and `event_t`. These are precisely what I need for managing thread synchronization and execution flow. My initial plan is to leverage `PIN_TO_CPU` to ensure threads land on specific cores and then use `WAIT_ON`/`SIGNAL` to orchestrate their interactions.

I also noticed `TIMER_START` and `TIMER_NOT_EXPIRED`. While useful for timed loops, my current objective is a single, deterministic execution that triggers the bug. So, for this specific reproducer, I don't think I'll need the timer functionality. A single pass should be sufficient.

However, on second thought, while I'm aiming for a deterministic trigger, robustness is always a good principle. What if, by some small chance, the race condition doesn't manifest on the very first attempt due to minor timing fluctuations? I could add a loop to repeat the critical section a few times. But then again, I recall that the underlying bug I'm targeting is known to be deterministic. This means a single, carefully timed sequence of operations *should* be enough to expose it. Sticking to a single execution will make the reproducer cleaner and more focused on the core issue.

Okay, with that refined strategy, I'm ready to write the final reproducer code. The structure will involve:

1.  **Initialization:** Setting up the environment, including pinning the main thread to avoid interference.
2.  **Memory Allocation:** Mapping a page of memory that will be the target of the race.
3.  **Thread Creation:** Spawning two threads (`thread0` and `thread1`) with specific roles.
4.  **Synchronization Points:** Using `WAIT_ON` and `SIGNAL` to ensure the threads execute in the correct order and at the right moments.
5.  **Race Condition Trigger:** The core logic within the threads designed to expose the bug. This will involve manipulating the memory page and its associated states across different CPUs.
6.  **CPU Manipulation:** The critical step of offlining CPU 1 to trigger the final cascade that reveals the warning.
7.  **Cleanup:** Rejoining threads and restoring system state.

The code itself will look something like this: I'll use `volatile int step` as a simple synchronization flag, and `volatile char *addr` for the memory page.

`thread0` will be pinned to CPU 0. It will wait for the initial signal, then cause a "fault" in the page. The key here is that this fault adds the page to CPU 0's `lru_add` batch but doesn't immediately put it on the actual LRU list. Then, it signals completion and spins, waiting for another signal. This spinning is crucial to prevent CPU 0 from draining its `lru_add` batch prematurely.

`thread1` will be pinned to CPU 1. It will wait for its cue, then `mlock` the page. The `mlock` operation on CPU 1 will observe that the page isn't on the LRU list (because it's still in CPU 0's batch) and, importantly, will *not* do anything with it regarding the LRU. Subsequently, `thread1` will `munmap` the page. Since the Virtual Memory Area (VMA) is locked by `mlock`, this triggers `munlock_vma_folio`. This function adds the page to CPU 1's `mlock_fbatch` but crucially, without any flags, and `munmap` itself doesn't drain this batch.

The main thread will initiate the process by signaling `thread0` to start. After `thread1` has performed its `mlock` and `munmap`, the main thread will signal `thread0` again to move on, and then immediately offline CPU 1. This is the catalyst. Offlining CPU 1 will trigger `page_alloc_cpu_dead`, which in turn calls `mlock_drain_remote` on a surviving CPU. `mlock_drain_remote` will attempt to unlock the page. It will call `__munlock_folio`, see the page isn't on the LRU, bypass the LRU lock acquisition, and directly call `__zone_stat_mod_folio` with preemption enabled. *This* is where the warning will be triggered because `__zone_stat_mod_folio` expects preemption to be disabled when modifying zone statistics.

Finally, after the race is exposed, I'll signal both threads to finish, join them, and then restore CPU 1 to its online state.

This plan seems solid and covers all the necessary synchronization and operations to deterministically reproduce the bug. The code should reflect this precise sequence.


228/3 2026/08/27 19:39 action merge-strategy
0m Results:
map[CurrentReproStrategy:The bug is caused by `mlock_drain_remote()` processing a folio that is not yet on the LRU list (e.g., it is still in another CPU's `lru_add` batch). When this happens, `__munlock_folio()` skips taking the LRU lock (which would disable interrupts) and calls `__zone_stat_mod_folio()` with preemption enabled, triggering the warning.

To reproduce this:
1. **Thread 0 (CPU 0)** faults in a new page. The page is added to CPU 0's `lru_add` batch. Thread 0 then spins to prevent its batch from draining.
2. **Thread 1 (CPU 1)** calls `mlock()` on the page. `mlock()` adds the page to CPU 1's `mlock_fbatch` with `LRU_FOLIO` and drains it. `__mlock_folio()` sees the page is not on the LRU list (still in CPU 0's batch) and does nothing, leaving `PG_mlocked` set.
3. **Thread 1 (CPU 1)** calls `munmap()`. Since the VMA is locked, it calls `munlock_vma_folio()`, which adds the page to CPU 1's `mlock_fbatch` with NO flags. `munmap()` does not drain the batch.
4. **Main Thread** offlines CPU 1. A surviving CPU executes `mlock_drain_remote(1)`, processes the folio, sees it's still not on the LRU list, and calls `__zone_stat_mod_folio()` with preemption enabled.

Here is the concrete C reproducer using the race toolkit:

```c
#include "race_toolkit.h"
#include <sys/mman.h>

volatile int step = 0;
void *addr;

void *thread0(void *arg) {
    PIN_TO_CPU(0);
    
    WAIT_ON(&step, 1);
    
    // Fault in the page on CPU 0.
    // It gets added to CPU 0's lru_add batch, but not yet on the LRU list.
    *(volatile char *)addr = 1;
    
    SIGNAL(&step, 2);
    
    // Spin to prevent CPU 0 from draining its lru_add batch.
    WAIT_ON(&step, 5);
    
    return NULL;
}

void *thread1(void *arg) {
    PIN_TO_CPU(1);
    
    WAIT_ON(&step, 2);
    
    // mlock the page on CPU 1.
    // It adds the page to CPU 1's mlock_fbatch with LRU_FOLIO, then drains it.
    // __mlock_folio sees the page is not on LRU (still in CPU 0's batch) and does nothing.
    if (mlock(addr, 4096) < 0) {
        perror("mlock");
    }
    
    // munmap the page on CPU 1.
    // Since the VMA is locked, it calls munlock_vma_folio, which adds the page
    // to CPU 1's mlock_fbatch with NO flags. munmap does not drain the batch.
    munmap(addr, 4096);
    
    SIGNAL(&step, 3);
    
    // Sleep until the test finishes.
    WAIT_ON(&step, 5);
    
    return NULL;
}

int main() {
    SETUP_UNBUFFERED_IO();
    
    // Pin main thread to CPU 2+ to avoid interfering with CPU 0 and 1.
    // If CPU 2 is not available, it will just fail and run anywhere.
    cpu_set_t set;
    CPU_ZERO(&set);
    for (int i = 2; i < 8; i++) {
        CPU_SET(i, &set);
    }
    sched_setaffinity(0, sizeof(set), &set);
    
    // Ensure CPU 1 is online initially.
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "1\n", 2);
        close(fd);
    }
    
    addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    if (addr == MAP_FAILED) {
        perror("mmap");
        return 1;
    }
    
    pthread_t t0, t1;
    pthread_create(&t0, NULL, thread0, NULL);
    pthread_create(&t1, NULL, thread1, NULL);
    
    SIGNAL(&step, 1);
    
    WAIT_ON(&step, 3);
    
    // Offline CPU 1.
    // This triggers page_alloc_cpu_dead -> mlock_drain_remote on a surviving CPU.
    // mlock_drain_remote calls __munlock_folio, which sees the page is not on LRU,
    // skips taking the LRU lock, and calls __zone_stat_mod_folio with preemption enabled,
    // triggering the warning.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "0\n", 2);
        close(fd);
    }
    
    SIGNAL(&step, 5);
    pthread_join(t0, NULL);
    pthread_join(t1, NULL);
    
    // Restore CPU 1.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "1\n", 2);
        close(fd);
    }
    
    return 0;
}
```]

229/3 2026/08/27 19:39 agent repro-generator
4m Model:
deep-reasoning

Results:
map[IsProbe:false RawCandidateReproC:#include "race_toolkit.h"
#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

volatile int step = 0;
void *addr;

void *thread0(void *arg) {
    PIN_TO_CPU(0);
    
    WAIT_ON(&step, 1);
    
    // Fault in the page on CPU 0.
    // It gets added to CPU 0's lru_add batch, but not yet on the LRU list.
    *(volatile char *)addr = 1;
    printf("[+] thread0: faulted in page on CPU 0\n");
    
    SIGNAL(&step, 2);
    
    // Spin to prevent CPU 0 from draining its lru_add batch.
    WAIT_ON(&step, 5);
    
    return NULL;
}

void *thread1(void *arg) {
    PIN_TO_CPU(1);
    
    WAIT_ON(&step, 2);
    
    // mlock the page on CPU 1.
    // It adds the page to CPU 1's mlock_fbatch with LRU_FOLIO, then drains it.
    // __mlock_folio sees the page is not on LRU (still in CPU 0's batch) and does nothing.
    int res = mlock(addr, 4096);
    if (res < 0) {
        printf("[-] Failed to mlock: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] mlock successful.\n");
    
    // munmap the page on CPU 1.
    // Since the VMA is locked, it calls munlock_vma_folio, which adds the page
    // to CPU 1's mlock_fbatch with NO flags. munmap does not drain the batch.
    res = munmap(addr, 4096);
    if (res < 0) {
        printf("[-] Failed to munmap: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] munmap successful.\n");
    
    SIGNAL(&step, 3);
    
    // Sleep until the test finishes.
    WAIT_ON(&step, 5);
    
    return NULL;
}

int main() {
    SETUP_UNBUFFERED_IO();
    
    // Pin main thread to CPU 2+ to avoid interfering with CPU 0 and 1.
    // If CPU 2 is not available, it will just fail and run anywhere.
    cpu_set_t set;
    CPU_ZERO(&set);
    for (int i = 2; i < 8; i++) {
        CPU_SET(i, &set);
    }
    int res = sched_setaffinity(0, sizeof(set), &set);
    if (res < 0) {
        printf("[-] Failed to sched_setaffinity (ignoring): %s\n", strerror(errno));
    } else {
        printf("[+] sched_setaffinity successful.\n");
    }
    
    // Ensure CPU 1 is online initially.
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "1\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    if (addr == MAP_FAILED) {
        printf("[-] Failed to mmap: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] mmap successful.\n");
    
    pthread_t t0, t1;
    res = pthread_create(&t0, NULL, thread0, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_create t0: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_create t0 successful.\n");
    
    res = pthread_create(&t1, NULL, thread1, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_create t1: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_create t1 successful.\n");
    
    SIGNAL(&step, 1);
    
    WAIT_ON(&step, 3);
    
    // Offline CPU 1.
    // This triggers page_alloc_cpu_dead -> mlock_drain_remote on a surviving CPU.
    // mlock_drain_remote calls __munlock_folio, which sees the page is not on LRU,
    // skips taking the LRU lock, and calls __zone_stat_mod_folio with preemption enabled,
    // triggering the warning.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "0\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    // Wait a bit to ensure the asynchronous warning is triggered and printed.
    sleep(1);
    
    SIGNAL(&step, 5);
    
    res = pthread_join(t0, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_join t0: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_join t0 successful.\n");
    
    res = pthread_join(t1, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_join t1: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_join t1 successful.\n");
    
    // Restore CPU 1.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "1\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    printf("[+] Done\n");
    return 0;
}]

Instruction:
You are a security researcher with deep Linux kernel background.
Your goal is to generate a minimal, standalone C program for the strictly defensive
purpose of verifying a bugfix in an isolated environment.

To ensure that we can diagnose why a program might fail to run on the test environment,
you MUST include detailed logging and error checking in the generated C program:
1. Use 'printf(...)' for all progress messages and error logs.
2. Every system call (e.g., socket, bind, listen, connect, ioctl, send) must check for a failure return value.
3. If a call fails, it must print a specific error message including the function name
   and the error string (use strerror(errno)), and then exit with a non-zero status.
4. The program must print a message after every successful major step.
5. Generate code that follows this pattern for all operations:
    int res = do_something();
    if (res < 0) {
        printf("[-] Failed to do_something: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] do_something successful.\n");
6. The compilation and development environment (including compilers, build
   systems, makefiles, and kernel build/header directories) is NOT available
   on the target test VM guest. Do NOT check for, build, or reference any
   compilation tools, build files, or kernel development directories.
7. Do NOT execute shell commands or run external binaries (e.g. by using
   functions like 'system()', 'popen()', or the 'exec' family such as
   'execve()'). All environment checks, capability probings, and reproduction
   steps must be performed directly using standard Linux system calls (such
   as 'open', 'socket', 'ioctl', 'stat', etc.).
8. When reproducing asynchronous kernel timeouts or warnings, always
   include a sufficient delay (using sleep or similar) after deleting
   or unregistering the device to allow the kernel's asynchronous
   timeout to trigger before program exit.


=== PHASE 2: BUG REPRODUCTION (GENERATION) ===
You must now generate a full reproducer candidate attempting to trigger the target bug/crash.
Do NOT generate a probe program. Focus directly on triggering the bug/crash described in the description.
You can assume that all necessary kernel capabilities and privileges (e.g., access to /dev/vhci,
ability to load BPF programs, etc.) have already been verified and are available in the environment.

Do not spend too much time analyzing or trying to generate a perfect one-shot reproducer.
Instead, follow an iterative approach: generate a simple candidate, execute it, analyze the results,
and improve it. Keep your reasoning steps short and focused on the next logical experiment.

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:
Bug Description: WARNING in __mod_zone_page_state

smpboot: CPU 1 is now offline
------------[ cut here ]------------
IS_ENABLED(CONFIG_PREEMPT_COUNT) && __lockdep_enabled && (preempt_count() == 0 && this_cpu_read(hardirqs_enabled))
WARNING: mm/vmstat.c:361 at __mod_zone_page_state+0x96/0x190 mm/vmstat.c:361, CPU#0: syz.0.301/7156
Modules linked in:
CPU: 0 UID: 0 PID: 7156 Comm: syz.0.301 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__mod_zone_page_state+0x96/0x190 mm/vmstat.c:361
Code: d0 00 00 00 8b 05 7e 0b ed 0e 85 c0 74 1f 65 8b 05 e7 56 32 12 65 0b 05 30 10 32 12 75 0f 65 8b 05 33 52 32 12 85 c0 74 04 90 <0f> 0b 90 48 c7 c7 40 e3 ff 8b e8 9b 69 71 09 65 48 0f be 5d 00 48
RSP: 0000:ffffc900033ef8c0 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000000 RCX: 1ffffffff2289b6c
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88807ffd69b8
RBP: ffffffff948bfd88 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffffffffffffffff
R13: 0000000000000008 R14: ffff88807ffd6940 R15: ffffffff948bfd80
FS:  0000000000000000(0000) GS:ffff888096982000(0063) knlGS:00000000f5486b40
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000f5453ff4 CR3: 0000000053822000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 __zone_stat_mod_folio include/linux/vmstat.h:410 [inline]
 __munlock_folio mm/mlock.c:144 [inline]
 mlock_folio_batch+0xf97/0x36e0 mm/mlock.c:204
 mlock_drain_remote+0xe5/0x140 mm/mlock.c:230
 page_alloc_cpu_dead+0x16/0x130 mm/page_alloc.c:6468
 cpuhp_invoke_callback+0x3b4/0x9a0 kernel/cpu.c:194
 __cpuhp_invoke_callback_range+0x158/0x1d0 kernel/cpu.c:972
 cpuhp_invoke_callback_range kernel/cpu.c:996 [inline]
 cpuhp_down_callbacks kernel/cpu.c:1386 [inline]
 _cpu_down+0x523/0x1020 kernel/cpu.c:1457
 cpu_down_maps_locked kernel/cpu.c:1483 [inline]
 cpu_down kernel/cpu.c:1491 [inline]
 cpu_device_down+0x82/0xc0 kernel/cpu.c:1508
 device_offline drivers/base/core.c:4283 [inline]
 device_offline+0x2f4/0x400 drivers/base/core.c:4267
 online_store+0xd1/0x180 drivers/base/core.c:2883
 dev_attr_store+0x58/0x80 drivers/base/core.c:2509
 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x6af/0x1050 fs/read_write.c:687
 ksys_write+0x12a/0x250 fs/read_write.c:739
 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline]
 __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291
 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316
 entry_SYSENTER_compat_after_hwframe+0x84/0x8e
RIP: 0023:0xf7fc5fec
Code: Unable to access opcode bytes at 0xf7fc5fc2.
RSP: 002b:00000000f548650c EFLAGS: 00000292 ORIG_RAX: 0000000000000004
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000080000180
RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

Strategy: The bug is caused by `mlock_drain_remote()` processing a folio that is not yet on the LRU list (e.g., it is still in another CPU's `lru_add` batch). When this happens, `__munlock_folio()` skips taking the LRU lock (which would disable interrupts) and calls `__zone_stat_mod_folio()` with preemption enabled, triggering the warning.

To reproduce this:
1. **Thread 0 (CPU 0)** faults in a new page. The page is added to CPU 0's `lru_add` batch. Thread 0 then spins to prevent its batch from draining.
2. **Thread 1 (CPU 1)** calls `mlock()` on the page. `mlock()` adds the page to CPU 1's `mlock_fbatch` with `LRU_FOLIO` and drains it. `__mlock_folio()` sees the page is not on the LRU list (still in CPU 0's batch) and does nothing, leaving `PG_mlocked` set.
3. **Thread 1 (CPU 1)** calls `munmap()`. Since the VMA is locked, it calls `munlock_vma_folio()`, which adds the page to CPU 1's `mlock_fbatch` with NO flags. `munmap()` does not drain the batch.
4. **Main Thread** offlines CPU 1. A surviving CPU executes `mlock_drain_remote(1)`, processes the folio, sees it's still not on the LRU list, and calls `__zone_stat_mod_folio()` with preemption enabled.

Here is the concrete C reproducer using the race toolkit:

```c
#include "race_toolkit.h"
#include <sys/mman.h>

volatile int step = 0;
void *addr;

void *thread0(void *arg) {
    PIN_TO_CPU(0);
    
    WAIT_ON(&step, 1);
    
    // Fault in the page on CPU 0.
    // It gets added to CPU 0's lru_add batch, but not yet on the LRU list.
    *(volatile char *)addr = 1;
    
    SIGNAL(&step, 2);
    
    // Spin to prevent CPU 0 from draining its lru_add batch.
    WAIT_ON(&step, 5);
    
    return NULL;
}

void *thread1(void *arg) {
    PIN_TO_CPU(1);
    
    WAIT_ON(&step, 2);
    
    // mlock the page on CPU 1.
    // It adds the page to CPU 1's mlock_fbatch with LRU_FOLIO, then drains it.
    // __mlock_folio sees the page is not on LRU (still in CPU 0's batch) and does nothing.
    if (mlock(addr, 4096) < 0) {
        perror("mlock");
    }
    
    // munmap the page on CPU 1.
    // Since the VMA is locked, it calls munlock_vma_folio, which adds the page
    // to CPU 1's mlock_fbatch with NO flags. munmap does not drain the batch.
    munmap(addr, 4096);
    
    SIGNAL(&step, 3);
    
    // Sleep until the test finishes.
    WAIT_ON(&step, 5);
    
    return NULL;
}

int main() {
    SETUP_UNBUFFERED_IO();
    
    // Pin main thread to CPU 2+ to avoid interfering with CPU 0 and 1.
    // If CPU 2 is not available, it will just fail and run anywhere.
    cpu_set_t set;
    CPU_ZERO(&set);
    for (int i = 2; i < 8; i++) {
        CPU_SET(i, &set);
    }
    sched_setaffinity(0, sizeof(set), &set);
    
    // Ensure CPU 1 is online initially.
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "1\n", 2);
        close(fd);
    }
    
    addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    if (addr == MAP_FAILED) {
        perror("mmap");
        return 1;
    }
    
    pthread_t t0, t1;
    pthread_create(&t0, NULL, thread0, NULL);
    pthread_create(&t1, NULL, thread1, NULL);
    
    SIGNAL(&step, 1);
    
    WAIT_ON(&step, 3);
    
    // Offline CPU 1.
    // This triggers page_alloc_cpu_dead -> mlock_drain_remote on a surviving CPU.
    // mlock_drain_remote calls __munlock_folio, which sees the page is not on LRU,
    // skips taking the LRU lock, and calls __zone_stat_mod_folio with preemption enabled,
    // triggering the warning.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "0\n", 2);
        close(fd);
    }
    
    SIGNAL(&step, 5);
    pthread_join(t0, NULL);
    pthread_join(t1, NULL);
    
    // Restore CPU 1.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd >= 0) {
        write(fd, "1\n", 2);
        close(fd);
    }
    
    return 0;
}
```


Previous Reproducer Attempt:
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

int main() {
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_RDWR);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] Successfully opened /sys/devices/system/cpu/cpu1/online.\n");
    
    char buf[2];
    int res = read(fd, buf, 1);
    if (res < 0) {
        printf("[-] Failed to read from /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] Successfully read from /sys/devices/system/cpu/cpu1/online.\n");
    
    close(fd);
    return 0;
}




Execution Results & Debugging Feedback:
The capability probe successfully opened and read from `/sys/devices/system/cpu/cpu1/online`. The environment is ready. In the next iteration, you should proceed to write "0" to this file to trigger the CPU offline path. To reproduce the bug, you will likely need to set up some mlocked pages (using `mlock()` or `mlockall()`) on the CPU being offlined, so that `page_alloc_cpu_dead` calls `mlock_drain_remote` and hits the warning in `__mod_zone_page_state`.

230/4 2026/08/27 19:39 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 6783
							output: 16
							thoughts: 119
						

Thoughts:
**My Thought Process on Reproducing the `__mod_zone_page_state` Bug**

Right, so the immediate goal is to get a reliable C reproducer for this `WARNING in __mod_zone_page_state` that's being triggered by `mlock_drain_remote`. I've been looking at the bug description, and thankfully, they've laid out a pretty clear strategy. They've even provided a concrete C reproducer example, which is a massive head start.

My previous step, which was essentially a preliminary check, involved verifying if I could even access `/sys/devices/system/cpu/cpu1/online`. That check passed, which is good – it means the basic system interfaces are accessible and we're not immediately blocked by permissions or fundamental system configuration issues.

Now, the path forward seems straightforward. The provided C reproducer is exactly what I need, but it has a dependency: the `race` toolkit. So, the very next action is to go ahead and fetch that `race` toolkit. Once that's in hand, I should be able to plug in their reproducer and get this bug manifested.


231/4 2026/08/27 19:39 tool get-toolkit
0m Args:
map[Name:race]

Results:
map[Toolkit:// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"

// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.

#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>

// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)

// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu)                                                \
	do {                                                           \
		cpu_set_t mask;                                        \
		CPU_ZERO(&mask);                                       \
		CPU_SET(cpu, &mask);                                   \
		if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
			perror("sched_setaffinity");                   \
		}                                                      \
	} while (0)

// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)

// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val)                                               \
	do {                                                             \
		while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
			;                                                \
	} while (0)

// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)

// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).

static inline double timer_elapsed_sec(struct timespec* start)
{
	struct timespec now;
	if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
		perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
		exit(1);
	}
	return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}

// Initialize a monotonic timer variable.
#define TIMER_START(t)                                          \
	struct timespec t;                                      \
	if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) {         \
		perror("clock_gettime(CLOCK_MONOTONIC) start"); \
		exit(1);                                        \
	}

// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))

// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
	int state;
} event_t;

static void event_init(event_t* ev)
{
	ev->state = 0;
}
static void event_reset(event_t* ev)
{
	ev->state = 0;
}

static void event_set(event_t* ev)
{
	if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
		fprintf(stderr, "event already set\n");
		exit(1);
	}
	__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
	syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}

static void event_wait(event_t* ev)
{
	while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
		syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}

// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
	int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
	if (uffd == -1)
		return -1;
	struct uffdio_api api = {.api = UFFD_API, .features = 0};
	if (ioctl(uffd, UFFDIO_API, &api) == -1) {
		close(uffd);
		return -1;
	}
	struct uffdio_register reg = {
	    .range = {.start = (uintptr_t)addr, .len = len},
	    .mode = UFFDIO_REGISTER_MODE_MISSING};
	if (ioctl(uffd, UFFDIO_REGISTER, &reg) == -1) {
		close(uffd);
		return -1;
	}
	return uffd;
}

// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
//    pause a thread accessing that memory until you handle the fault, creating a reliable
//    and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
//    immediately. This is essential for understanding the exact interleaving of events
//    when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
//    or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
//    Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
//        TIMER_START(start);
//        while (TIMER_NOT_EXPIRED(start, 10.0)) {
//            // Your race logic here
//        }
]

232/4 2026/08/27 19:39 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 8584
							output: 36
							thoughts: 1596
						

Thoughts:
**My Thought Process on Adapting the C Reproducer**

Alright, so I've been given this C reproducer, and my initial assessment is that it's *very* close to what I need. The core logic for triggering the issue appears to be there. My immediate thought is, "Okay, let's take this foundation and build upon it."

Specifically, I need to integrate robust error checking and logging. This isn't just about making the reproducer work; it's about making it reliable and informative, so I can precisely understand what's happening when the race condition occurs. When dealing with low-level memory management and concurrency, every detail matters, and silent failures or ambiguous behavior are unacceptable.

Looking at the code, I see the use of `printf` for output, which is a good start. However, I want to ensure that all critical operations, especially those involving system calls like `mmap`, `mlock`, `munmap`, and I/O operations to `/sys/devices/system/cpu/cpu1/online`, are properly guarded. If any of these fail, I need to know *why*. This means checking the return values of these functions and, if they indicate an error, printing a descriptive message using `strerror(errno)`. This will be invaluable for debugging and understanding the execution flow.

Furthermore, the reproducer relies on a synchronization mechanism using a `volatile int step`. This is standard practice for coordinating threads in such scenarios. I'll need to ensure that the `WAIT_ON` and `SIGNAL` macros (presumably defined in `race_toolkit.h`) are correctly used to manage the timing of thread execution and the critical operations related to CPU offline/online events and memory management.

The pinning of threads to specific CPUs (`PIN_TO_CPU`) is also a critical part of this reproducer. It's designed to ensure that the race condition can manifest predictably by controlling which CPU handles which operation. I need to be mindful of this and ensure that the logic for offlining and restoring CPU 1 is correctly timed relative to the operations of `thread0` and `thread1`.

The core of the reproducer seems to hinge on the interaction between `mlock`, `munmap`, and the kernel's handling of CPU hotplug events. Specifically, the sequence where `thread1` performs `mlock` and `munmap` on the page, followed by the main thread offlining CPU 1, appears to be the trigger. The comments in the provided code are a great hint: "This triggers page_alloc_cpu_dead -> mlock_drain_remote on a surviving CPU." This is exactly the path I'm interested in exploring.

So, my plan is to:
1.  **Integrate comprehensive error handling:** Wrap all system calls and critical operations with checks for failure and log the specific error.
2.  **Enhance logging:** Add more `printf` statements at key points to trace the execution flow of each thread and the main thread, especially around the `mlock`, `munmap`, and CPU online/offline operations.
3.  **Verify synchronization:** Double-check that the `step` variable and `WAIT_ON`/`SIGNAL` calls are correctly orchestrating the threads to expose the race condition.
4.  **Focus on the critical path:** Ensure the code effectively orchestrates the `mlock`, `munmap`, and CPU offline sequence to hit the suspected kernel bug in `mlock_drain_remote`.

Essentially, I'm taking a functional seed and meticulously adding the instrumentation and robustness needed to fully understand and reproduce the intended race condition. It's about turning a demonstration into a reliable diagnostic tool.


233/4 2026/08/27 19:39 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:mlock_drain_remote]

Results:
map[SourceCode: 223:	void mlock_drain_remote(int cpu)
 224:	{
 225:		struct folio_batch *fbatch;
 226:	
 227:		WARN_ON_ONCE(cpu_online(cpu));
 228:		fbatch = &per_cpu(mlock_fbatch.fbatch, cpu);
 229:		if (folio_batch_count(fbatch))
 230:			mlock_folio_batch(fbatch);
 231:	}
 SourceFile:mm/mlock.c]

234/4 2026/08/27 19:39 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10362
							output: 37
							thoughts: 236
						

Thoughts:
**My Thought Process Regarding the `mlock_drain_remote` Bug**

Okay, so I'm trying to get a handle on this bug report concerning `mlock_drain_remote`. The core issue seems to be how `mlock_fbatch` is handled when a CPU goes offline, particularly when pages are involved in both `mlock` and `munmap` operations.

Here's how I'm breaking it down:

First, the bug description states that `mlock_drain_remote` is responsible for flushing out the `mlock_fbatch` on an *offlined* CPU. This makes sense; if a CPU is no longer active, its local batches of pages need to be processed by another CPU before that CPU's resources can be truly cleaned up.

Now, let's trace the sequence of events described:

1.  **Initial `mlock()`:** A thread on CPU 1 calls `mlock()` on a specific page. My understanding is that `mlock()` will add this page to CPU 1's `mlock_fbatch` with the `LRU_FOLIO` flag. Crucially, it then *drains* this batch. This draining process should, in theory, move the page onto the LRU list and mark it appropriately.
2.  **`__mlock_folio()`'s Role:** The description points out that `__mlock_folio()` (which is likely called during the drain) sees the page *isn't* on the LRU list yet. This is a bit confusing at first glance. Why wouldn't it be on the LRU if it was just drained? The text clarifies: it's "still in CPU 0's batch." This implies some kind of race condition or prior state where the page was initially associated with CPU 0 before CPU 1 `mlock()`'d it. The key takeaway is that `__mlock_folio()` does *nothing* in this specific scenario, *but* it leaves the `PG_mlocked` flag set on the page. This `PG_mlocked` flag is important; it signals that the page *should* be locked.
3.  **Subsequent `munmap()`:** Then, the same thread on CPU 1 calls `munmap()`. Because the Virtual Memory Area (VMA) associated with this page is locked (due to the previous `mlock`), `munmap()` calls `munlock_vma_folio()`.
4.  **`munlock_vma_folio()`'s Action:** This is where things get interesting. `munlock_vma_folio()` adds the page to CPU 1's `mlock_fbatch`, but this time *without* any flags (specifically, `NO flags`). The bug report explicitly states that `munmap()` *does not* drain this batch. So, the page is now in CPU 1's `mlock_fbatch`, but it's not marked for LRU processing during this particular operation.
5.  **CPU 1 Offlined:** The "Main Thread" then proceeds to offline CPU 1.
6.  **`mlock_drain_remote()` Triggered:** At this point, a *surviving* CPU (let's call it CPU X) executes `mlock_drain_remote(1)`. This function is meant to process pages from the offlined CPU 1's batches.
7.  **The Problematic Processing:** When `mlock_drain_remote()` processes the folio that was just added to CPU 1's batch by `munlock_vma_folio()`, it encounters the same situation as `__mlock_folio()` did earlier: the page is *still not on the LRU list*. Because of this, it calls `__zone_stat_mod_folio()` with preemption *enabled*.

This last step is where I suspect the bug lies. The fact that `__zone_stat_mod_folio()` is called with preemption enabled, while the page is still in a bad state (not on LRU, yet `PG_mlocked` might be set from the earlier operation), suggests that the page's statistics or its presence in the memory management subsystem isn't being handled correctly when it's being processed from a remote, offlined batch. The lack of LRU presence combined with the intent to modify zone stats, while allowing preemption, seems like a recipe for inconsistency or corruption.

So, my immediate next step is to dive into the implementation of `munlock_vma_folio` to see precisely *why* it adds the page with `NO flags` and what the expected behavior is when `munmap()` doesn't trigger a drain. I need to understand the logic there and how it interacts with the subsequent `mlock_drain_remote` call.


235/4 2026/08/27 19:40 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:munlock_vma_folio]

Results:
map[SourceCode: 997:	static inline void munlock_vma_folio(struct folio *folio,
 998:						struct vm_area_struct *vma)
 999:	{
1000:		/*
1001:		 * munlock if the function is called. Ideally, we should only
1002:		 * do munlock if any page of folio is unmapped from VMA and
1003:		 * cause folio not fully mapped to VMA.
1004:		 *
1005:		 * But it's not easy to confirm that's the situation. So we
1006:		 * always munlock the folio and page reclaim will correct it
1007:		 * if it's wrong.
1008:		 */
1009:		if (unlikely(vma->vm_flags & VM_LOCKED))
1010:			munlock_folio(folio);
1011:	}
 SourceFile:mm/internal.h]

236/4 2026/08/27 19:40 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10879
							output: 34
							thoughts: 10
						

Thoughts:
**My Thought Process**

Right, first things first, I need to investigate `munlock_folio`. That's where I'm going to start digging.


237/4 2026/08/27 19:40 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:munlock_folio]

Results:
map[SourceCode: 286:	/**
 287:	 * munlock_folio - munlock a folio
 288:	 * @folio: folio to be munlocked, either normal or a THP head.
 289:	 */
 290:	void munlock_folio(struct folio *folio)
 291:	{
 292:		struct folio_batch *fbatch;
 293:	
 294:		local_lock(&mlock_fbatch.lock);
 295:		fbatch = this_cpu_ptr(&mlock_fbatch.fbatch);
 296:		/*
 297:		 * folio_test_clear_mlocked(folio) must be left to __munlock_folio(),
 298:		 * which will check whether the folio is multiply mlocked.
 299:		 */
 300:		folio_get(folio);
 301:		if (!folio_batch_add(fbatch, folio) ||
 302:		    !folio_may_be_lru_cached(folio) || lru_cache_disabled())
 303:			mlock_folio_batch(fbatch);
 304:		local_unlock(&mlock_fbatch.lock);
 305:	}
 SourceFile:mm/mlock.c]

238/4 2026/08/27 19:40 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 11254
							output: 37
							thoughts: 1796
						

Thoughts:
**My Thoughts on Reproducing the Kernel Bug**

Alright, let's break down this reproducer and my thought process in understanding and confirming it.

First off, I'm looking at `munlock_folio` and how it interacts with `mlock_fbatch`. My initial understanding is that `munlock_folio` adds a folio to a CPU's `mlock_fbatch` but crucially, it *doesn't* drain that batch unless it's already full. This is a key detail for the race condition we're trying to expose.

Then, the scenario shifts to what happens when CPU 1 is offlined. The text points out that `mlock_drain_remote` is responsible for draining the folio from the affected CPU in this situation.

I've reviewed the provided reproducer code, and honestly, it looks pretty solid. It seems to correctly set up the conditions needed to trigger the bug. My immediate thought is that the core logic is sound. So, the next step, from my perspective, is to simply wrap this existing reproducer with the necessary error checking and logging to make it robust and easy to follow. I want to ensure that any failure points are clearly identified and the flow of execution is well-documented.

Regarding the specific code snippet itself:
*   I see that `thread0` is pinned to CPU 0. It faults in a page, which initially lands in CPU 0's `lru_add` batch but *not* yet on the actual LRU list. This is important because it means the page is "stuck" in a pre-LRU state on CPU 0.
*   `thread1`, pinned to CPU 1, then calls `mlock` on that same page. The description states that `mlock` adds the page to CPU 1's `mlock_fbatch` with `LRU_FOLIO` and then drains it. The crucial part here is that `__mlock_folio` (which `mlock` eventually calls) sees the page isn't on the LRU list yet (because it's still in CPU 0's batch), so it doesn't do anything significant with it regarding the LRU.
*   Next, `thread1` calls `munmap` on the page. Because the Virtual Memory Area (VMA) is locked, this path leads to `munlock_vma_folio`. This function adds the page to CPU 1's `mlock_fbatch`, but this time *without* any flags. Importantly, `munmap` itself doesn't trigger a drain of the `mlock_fbatch`.
*   The main thread then proceeds to offline CPU 1. This is where the magic (or rather, the bug) happens. The offlining process triggers `page_alloc_cpu_dead`, which in turn calls `mlock_drain_remote` on a surviving CPU. This `mlock_drain_remote` then calls `__munlock_folio`.
*   The critical race is here: `__munlock_folio` checks if the page is on the LRU. Since it isn't, it skips acquiring the LRU lock. It then proceeds to call `__zone_stat_mod_folio` with preemption *enabled*. This is what ultimately triggers the warning we're trying to reproduce – a race condition where zone statistics are being modified without proper locking.

I did have a moment of "wait a minute" regarding the `mlock` draining behavior. The bug description mentions: "Thread 1 (CPU 1) calls mlock() on the page. mlock() adds the page to CPU 1's mlock_fbatch with LRU_FOLIO and drains it." I need to be absolutely sure about this draining behavior in `mlock`. My understanding is that `munlock_folio` is the one that adds to the batch and *doesn't* drain, but `mlock` is a bit different. I'll need to double-check the specifics of `mlock_vma_folio` to confirm if it indeed drains the batch immediately. This is a subtle but critical detail for the race to manifest.

Finally, on the setup details:
*   I've noted that `mlock` typically requires root privileges, which is handled here as we're running as root.
*   The `mlock` limit shouldn't be an issue for a single 4096-byte page.
*   The reproducer relies on `race_toolkit.h`, which I will include directly as per the instructions.

So, the reproducer seems to set up the page contention correctly, and the offlining of CPU 1 is the catalyst. My focus is now on confirming the exact behavior of `mlock` versus `munlock` in relation to draining the `mlock_fbatch`.


239/4 2026/08/27 19:40 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:mlock_vma_folio]

Results:
map[SourceCode: 981:	static inline void mlock_vma_folio(struct folio *folio,
 982:					struct vm_area_struct *vma)
 983:	{
 984:		/*
 985:		 * The VM_SPECIAL check here serves two purposes.
 986:		 * 1) VM_IO check prevents migration from double-counting during mlock.
 987:		 * 2) Although mmap_region() and mlock_fixup() take care that VM_LOCKED
 988:		 *    is never left set on a VM_SPECIAL vma, there is an interval while
 989:		 *    file->f_op->mmap() is using vm_insert_page(s), when VM_LOCKED may
 990:		 *    still be set while VM_SPECIAL bits are added: so ignore it then.
 991:		 */
 992:		if (unlikely((vma->vm_flags & (VM_LOCKED|VM_SPECIAL)) == VM_LOCKED))
 993:			mlock_folio(folio);
 994:	}
 SourceFile:mm/internal.h]

240/4 2026/08/27 19:40 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 13375
							output: 34
							thoughts: 10
						

Thoughts:
**My Thought Process on `mlock_folio`**

Alright, the first thing that comes to my mind is a direct intention to investigate `mlock_folio`. This isn't just a casual glance; I want to get a solid understanding of its functionality, its purpose within the larger system, and how it's implemented. My immediate goal is to dive into the code, or perhaps a relevant design document if it exists, to see precisely what `mlock_folio` does. I'm assuming it's related to memory locking, likely for performance or security reasons, so I'll be looking for how it interfaces with the operating system's memory management primitives. I'll be paying close attention to any associated arguments or parameters it takes, the return values it provides, and any potential side effects or error conditions I need to be aware of. The name itself suggests a "folio" or a collection of memory pages being locked, so I'll be trying to confirm if that's indeed the case and what the scope of that locking is. Ultimately, I need to ascertain its role in our architecture and whether it's performing as expected, or if there are areas for optimization or potential issues to address.


241/4 2026/08/27 19:40 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:mlock_folio]

Results:
map[SourceCode: 238:	/**
 239:	 * mlock_folio - mlock a folio already on (or temporarily off) LRU
 240:	 * @folio: folio to be mlocked.
 241:	 */
 242:	void mlock_folio(struct folio *folio)
 243:	{
 244:		struct folio_batch *fbatch;
 245:	
 246:		local_lock(&mlock_fbatch.lock);
 247:		fbatch = this_cpu_ptr(&mlock_fbatch.fbatch);
 248:	
 249:		if (!folio_test_set_mlocked(folio)) {
 250:			int nr_pages = folio_nr_pages(folio);
 251:	
 252:			zone_stat_mod_folio(folio, NR_MLOCK, nr_pages);
 253:			__count_vm_events(UNEVICTABLE_PGMLOCKED, nr_pages);
 254:		}
 255:	
 256:		folio_get(folio);
 257:		if (!folio_batch_add(fbatch, mlock_lru(folio)) ||
 258:		    !folio_may_be_lru_cached(folio) || lru_cache_disabled())
 259:			mlock_folio_batch(fbatch);
 260:		local_unlock(&mlock_fbatch.lock);
 261:	}
 SourceFile:mm/mlock.c]

242/4 2026/08/27 19:40 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 13816
							output: 40
							thoughts: 198
						

Thoughts:
**My Thought Process Regarding `mlock_folio` and LRU Caching**

Okay, so I'm looking at `mlock_folio` here. My first thought is that it's intended to add a folio to an `mlock_fbatch`. The mechanism for doing so involves `mlock_lru(folio)`. Now, that `mlock_lru` function immediately flags something in my mind: it sets the lowest bit of the pointer. This is a common idiom to signify that the folio is now part of the LRU (Least Recently Used) list.

My immediate follow-up question is: does this operation *drain* the batch? In other words, if the batch is full or something else prevents further additions, is it processed immediately?

I can see the conditional logic that follows: `if (!folio_batch_add(fbatch, mlock_lru(folio)) || !folio_may_be_lru_cached(folio) || lru_cache_disabled()) mlock_folio_batch(fbatch);`. This is key. The `mlock_folio_batch(fbatch)` call, which presumably handles draining or processing the batch, is triggered *only* under specific conditions.

Let's break down those conditions:
1.  `!folio_batch_add(fbatch, mlock_lru(folio))` failing: This implies that `folio_batch_add` returned false, meaning the batch is full and the new folio couldn't be added. This is a clear trigger to drain.
2.  `!folio_may_be_lru_cached(folio)`: This is where I need to be precise. My understanding is that this function checks if a folio is *eligible* for LRU caching. If it returns false, it means this particular folio *cannot* be LRU cached for some reason. This would certainly necessitate processing the batch, as we can't just keep adding non-cacheable items indefinitely.
3.  `lru_cache_disabled()`: This is the most straightforward. If the LRU caching mechanism itself is disabled globally, then we absolutely must drain the batch immediately, as no further LRU operations are permitted.

So, the draining behavior is indeed conditional. It's not an automatic drain on every `mlock_lru` call, but rather a proactive measure when the batch is full, when the specific folio being added isn't suitable for LRU caching, or when LRU caching is globally off. The check for `folio_may_be_lru_cached` is crucial here – I need to confirm its exact semantics to ensure I'm not missing any subtle exclusion criteria for LRU caching.


243/4 2026/08/27 19:40 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:folio_may_be_lru_cached]

Results:
map[SourceCode:  49:	static inline bool folio_may_be_lru_cached(struct folio *folio)
  50:	{
  51:		/*
  52:		 * Holding PMD-sized folios in per-CPU LRU cache unbalances accounting.
  53:		 * Holding small numbers of low-order mTHP folios in per-CPU LRU cache
  54:		 * will be sensible, but nobody has implemented and tested that yet.
  55:		 */
  56:		return !folio_test_large(folio);
  57:	}
 SourceFile:mm/internal.h]

244/4 2026/08/27 19:40 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 14202
							output: 34
							thoughts: 101
						

Thoughts:
**My Thought Process Regarding `mlock()` and Folio Batching**

Okay, I've just encountered a return value of `!folio_test_large(folio)`. This is telling me something crucial: for a standard page, the batch is *not* being drained unless it's already full. This is a significant observation because it directly contradicts what I understand about the expected behavior, especially concerning the `mlock()` system call.

I'm circling back to the bug description I'm working with. It explicitly states: "mlock() adds the page to CPU 1's mlock_fbatch with LRU_FOLIO and drains it." This phrase, "and drains it," is the source of my current confusion. My initial interpretation was that the `mlock()` operation itself would trigger a drain of the batch. However, the return value I'm seeing suggests this isn't happening under normal circumstances.

So, the immediate question that arises in my mind is: *How* is this drain actually being accomplished if not directly by the `mlock()` call itself at the point of adding a folio? Is it possible that the draining mechanism is deferred? Perhaps the `mlock` syscall, as a whole, has a cleanup phase or a finalization step that performs the draining *after* the individual folio additions have occurred?

To resolve this, my next logical step is to dive into the implementation of `sys_mlock` to understand its complete execution flow and identify precisely where and when this purported batch draining takes place. I need to see the code to reconcile the stated behavior with the observed outcome.


245/4 2026/08/27 19:40 tool codesearch-definition-source
0m Error:
log-in to see details

Args:
map[ContextFile:mm/mlock.c Name:sys_mlock]

Results:
map[SourceCode: SourceFile:]

246/4 2026/08/27 19:40 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 14342
							output: 34
							thoughts: 10
						

Thoughts:
**My Thought Process on `do_mlock`**

Alright, so my immediate thought is to dive into the `do_mlock` function. I need to understand its purpose and how it's implemented. My expertise in this area tells me this is likely related to memory locking, which is a critical performance and security consideration.

My first step is to examine its definition. I'm looking for its signature, what arguments it takes, and what it returns. This will give me a fundamental understanding of its interface and how I might interact with it.

Then, I'll trace the execution flow. Where is `do_mlock` called from? What are the conditions that lead to its invocation? Understanding the context in which it operates is crucial for grasping its full impact.

I'll pay close attention to the actual operations within `do_mlock`. What system calls is it making? Is it using `mlock()`, `mlockall()`, or perhaps a custom implementation? The specifics of these operations will reveal its intended behavior regarding memory protection and availability.

Furthermore, I'm curious about the implications. What are the potential benefits of using `do_mlock`? I'm thinking about reduced page faulting, improved real-time performance, and preventing sensitive data from being swapped out. Conversely, what are the potential downsides? I'll consider memory fragmentation, increased resource consumption, and potential deadlocks if not managed carefully.

Finally, I'll be looking for any error handling or edge case considerations. How does `do_mlock` behave when memory is unavailable, or when permissions are insufficient? Robustness is paramount, and understanding its failure modes is as important as understanding its success path.


247/4 2026/08/27 19:40 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:do_mlock]

Results:
map[SourceCode: 619:	static __must_check int do_mlock(unsigned long start, size_t len,
 620:					 vma_flags_t *flags)
 621:	{
 622:		unsigned long locked;
 623:		unsigned long lock_limit;
 624:		int error = -ENOMEM;
 625:	
 626:		start = untagged_addr(start);
 627:	
 628:		if (!can_do_mlock())
 629:			return -EPERM;
 630:	
 631:		len = PAGE_ALIGN(len + (offset_in_page(start)));
 632:		start &= PAGE_MASK;
 633:	
 634:		lock_limit = rlimit(RLIMIT_MEMLOCK);
 635:		lock_limit >>= PAGE_SHIFT;
 636:		locked = len >> PAGE_SHIFT;
 637:	
 638:		if (mmap_write_lock_killable(current->mm))
 639:			return -EINTR;
 640:	
 641:		locked += current->mm->locked_vm;
 642:		if ((locked > lock_limit) && (!capable(CAP_IPC_LOCK))) {
 643:			/*
 644:			 * It is possible that the regions requested intersect with
 645:			 * previously mlocked areas, that part area in "mm->locked_vm"
 646:			 * should not be counted to new mlock increment count. So check
 647:			 * and adjust locked count if necessary.
 648:			 */
 649:			locked -= count_mm_mlocked_page_nr(current->mm,
 650:					start, len);
 651:		}
 652:	
 653:		/* check against resource limits */
 654:		if ((locked <= lock_limit) || capable(CAP_IPC_LOCK))
 655:			error = apply_vma_lock_flags(start, len, flags);
 656:	
 657:		mmap_write_unlock(current->mm);
 658:		if (error)
 659:			return error;
 660:	
 661:		error = __mm_populate(start, len, 0);
 662:		if (error)
 663:			return __mlock_posix_error_return(error);
 664:		return 0;
 665:	}
 SourceFile:mm/mlock.c]

248/4 2026/08/27 19:40 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 15067
							output: 34
							thoughts: 17
						

Thoughts:
**My Thought Process**

Okay, so I'm looking at this codebase, and I've just encountered something that made me pause: `__mm_populate`. My immediate reaction is to figure out what this is and why it's here. I need to understand its purpose, its implications, and how it fits into the larger picture of memory management in this system. Is it a standard function, something specific to this environment, or perhaps an internal helper? My next step, therefore, is to dive into the definition and usage of `__mm_populate` to get a clear understanding.


249/4 2026/08/27 19:40 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:__mm_populate]

Results:
map[SourceCode:1918:	/*
1919:	 * __mm_populate - populate and/or mlock pages within a range of address space.
1920:	 *
1921:	 * This is used to implement mlock() and the MAP_POPULATE / MAP_LOCKED mmap
1922:	 * flags. VMAs must be already marked with the desired vm_flags, and
1923:	 * mmap_lock must not be held.
1924:	 */
1925:	int __mm_populate(unsigned long start, unsigned long len, int ignore_errors)
1926:	{
1927:		struct mm_struct *mm = current->mm;
1928:		unsigned long end, nstart, nend;
1929:		struct vm_area_struct *vma = NULL;
1930:		int locked = 0;
1931:		long ret = 0;
1932:	
1933:		end = start + len;
1934:	
1935:		for (nstart = start; nstart < end; nstart = nend) {
1936:			/*
1937:			 * We want to fault in pages for [nstart; end) address range.
1938:			 * Find first corresponding VMA.
1939:			 */
1940:			if (!locked) {
1941:				locked = 1;
1942:				mmap_read_lock(mm);
1943:				vma = find_vma_intersection(mm, nstart, end);
1944:			} else if (nstart >= vma->vm_end)
1945:				vma = find_vma_intersection(mm, vma->vm_end, end);
1946:	
1947:			if (!vma)
1948:				break;
1949:			/*
1950:			 * Set [nstart; nend) to intersection of desired address
1951:			 * range with the first VMA. Also, skip undesirable VMA types.
1952:			 */
1953:			nend = min(end, vma->vm_end);
1954:			if (vma->vm_flags & (VM_IO | VM_PFNMAP))
1955:				continue;
1956:			if (nstart < vma->vm_start)
1957:				nstart = vma->vm_start;
1958:			/*
1959:			 * Now fault in a range of pages. populate_vma_page_range()
1960:			 * double checks the vma flags, so that it won't mlock pages
1961:			 * if the vma was already munlocked.
1962:			 */
1963:			ret = populate_vma_page_range(vma, nstart, nend, &locked);
1964:			if (ret < 0) {
1965:				if (ignore_errors) {
1966:					ret = 0;
1967:					continue;	/* continue at next VMA */
1968:				}
1969:				break;
1970:			}
1971:			nend = nstart + ret * PAGE_SIZE;
1972:			ret = 0;
1973:		}
1974:		if (locked)
1975:			mmap_read_unlock(mm);
1976:		return ret;	/* 0 or negative error code */
1977:	}
 SourceFile:mm/gup.c]

250/4 2026/08/27 19:40 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 16052
							output: 38
							thoughts: 32
						

Thoughts:
**My Thought Process on the Memory Management Flow**

Okay, so I'm tracing the execution flow within the kernel's memory management subsystem, specifically focusing on how memory regions are populated and handled. My current line of inquiry is around the `populate_vma_page_range` function. I've just realized that this function doesn't directly handle the page faults or the actual page population itself. Instead, it delegates that responsibility to `faultin_page_range`. This is a common pattern – a higher-level function setting up a broader operation, and a lower-level one executing the granular details.

What's particularly interesting to me here is the internal mechanism of `faultin_page_range`. I've just seen that *it*, in turn, calls `lru_add_drain()`. Now, this is a significant detail. The fact that `faultin_page_range` is invoking `lru_add_drain()` suggests that as pages are being brought into memory (or at least prepared for faulting), there's an immediate and active management of their position within the Least Recently Used (LRU) lists. This isn't just a passive "page fault, bring it in, deal with LRU later." It implies a more proactive approach, where pages are being explicitly added to the LRU structures as they become relevant during this `faultin_page_range` operation. This might be to ensure that newly populated pages are immediately considered for eviction if they become truly unused, or it could be part of a strategy to keep recently accessed or populated pages "warm" in memory. I need to dig into the specifics of `lru_add_drain()` to understand the exact implications of this immediate LRU management.


251/4 2026/08/27 19:40 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/gup.c Name:populate_vma_page_range]

Results:
map[SourceCode:1793:	/**
1794:	 * populate_vma_page_range() -  populate a range of pages in the vma.
1795:	 * @vma:   target vma
1796:	 * @start: start address
1797:	 * @end:   end address
1798:	 * @locked: whether the mmap_lock is still held
1799:	 *
1800:	 * This takes care of mlocking the pages too if VM_LOCKED is set.
1801:	 *
1802:	 * Return either number of pages pinned in the vma, or a negative error
1803:	 * code on error.
1804:	 *
1805:	 * vma->vm_mm->mmap_lock must be held.
1806:	 *
1807:	 * If @locked is NULL, it may be held for read or write and will
1808:	 * be unperturbed.
1809:	 *
1810:	 * If @locked is non-NULL, it must held for read only and may be
1811:	 * released.  If it's released, *@locked will be set to 0.
1812:	 */
1813:	long populate_vma_page_range(struct vm_area_struct *vma,
1814:			unsigned long start, unsigned long end, int *locked)
1815:	{
1816:		struct mm_struct *mm = vma->vm_mm;
1817:		unsigned long nr_pages = (end - start) / PAGE_SIZE;
1818:		int local_locked = 1;
1819:		int gup_flags;
1820:		long ret;
1821:	
1822:		VM_WARN_ON_ONCE(!PAGE_ALIGNED(start));
1823:		VM_WARN_ON_ONCE(!PAGE_ALIGNED(end));
1824:		VM_WARN_ON_ONCE_VMA(start < vma->vm_start, vma);
1825:		VM_WARN_ON_ONCE_VMA(end   > vma->vm_end, vma);
1826:		mmap_assert_locked(mm);
1827:	
1828:		/*
1829:		 * Rightly or wrongly, the VM_LOCKONFAULT case has never used
1830:		 * faultin_page() to break COW, so it has no work to do here.
1831:		 */
1832:		if (vma->vm_flags & VM_LOCKONFAULT)
1833:			return nr_pages;
1834:	
1835:		/* ... similarly, we've never faulted in PROT_NONE pages */
1836:		if (!vma_is_accessible(vma))
1837:			return -EFAULT;
1838:	
1839:		gup_flags = FOLL_TOUCH;
1840:		/*
1841:		 * We want to touch writable mappings with a write fault in order
1842:		 * to break COW, except for shared mappings because these don't COW
1843:		 * and we would not want to dirty them for nothing.
1844:		 *
1845:		 * Otherwise, do a read fault, and use FOLL_FORCE in case it's not
1846:		 * readable (ie write-only or executable).
1847:		 */
1848:		if ((vma->vm_flags & (VM_WRITE | VM_SHARED)) == VM_WRITE)
1849:			gup_flags |= FOLL_WRITE;
1850:		else
1851:			gup_flags |= FOLL_FORCE;
1852:	
1853:		if (locked)
1854:			gup_flags |= FOLL_UNLOCKABLE;
1855:	
1856:		/*
1857:		 * We made sure addr is within a VMA, so the following will
1858:		 * not result in a stack expansion that recurses back here.
1859:		 */
1860:		ret = __get_user_pages(mm, start, nr_pages, gup_flags,
1861:				       NULL, locked ? locked : &local_locked);
1862:		lru_add_drain();
1863:		return ret;
1864:	}
 SourceFile:mm/gup.c]

252/4 2026/08/27 19:40 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17290
							output: 50
							thoughts: 233
						

Thoughts:
**My Thought Process Unraveling the MLOCK and LRU Interactions**

Okay, so I've stumbled upon an interesting interaction here: `populate_vma_page_range` is calling `lru_add_drain()`. My initial thought is, what exactly does `lru_add_drain` do? It seems to be responsible for emptying out the local CPU's `lru_add` batch and, importantly, also the `mlock_fbatch`. This implies that an `mlock` operation on a specific CPU, say CPU 1, will trigger a drain of that CPU's `mlock_fbatch`.

However, the critical detail is that the page in question was faulted in on CPU 0. This means it's currently residing in CPU 0's `lru_add` batch, not CPU 1's. So, when CPU 1 performs its `mlock`, it will indeed call into `__get_user_pages` to locate the page. The next step, where things get a bit nuanced, is how `mlock_vma_folio` comes into play. I initially thought `__get_user_pages` might call it directly.

But upon closer inspection, I realize `__get_user_pages` doesn't directly invoke `mlock_vma_folio`. Instead, it delegates to `follow_page_mask`. It's within `follow_page_mask` that the `mlock_vma_folio` function is called, and this only happens if the `VM_LOCKED` flag is set. This is a crucial distinction and clarifies the execution path. To fully understand this dependency, my next step needs to be to investigate the callers of both `follow_page_mask` and `mlock_vma_folio`.


253/4 2026/08/27 19:40 tool codesearch-find-references
0m Args:
map[ContextFile:mm/mlock.c IncludeSnippetLines:0 Name:mlock_vma_folio SourceTreePrefix:]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__folio_add_anon_rmap SourceFile:mm/rmap.c SourceLine:1576] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__folio_add_file_rmap SourceFile:mm/rmap.c SourceLine:1715] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:folio_referenced_one SourceFile:mm/rmap.c SourceLine:948] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:try_to_unmap_one SourceFile:mm/rmap.c SourceLine:2263]] TruncatedOutput:false]

254/4 2026/08/27 19:40 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17699
							output: 37
							thoughts: 71
						

Thoughts:
**My Thought Process Regarding `mlock_vma_folio` and Page Mapping**

Okay, so I'm delving into the memory management code, specifically focusing on how pages are mapped, and a question popped into my head: where exactly is `mlock_vma_folio` being invoked from? My initial recollection or perhaps a hasty glance suggested it was being called directly from `__folio_add_anon_rmap` and `__folio_add_file_rmap`.

However, upon a slightly deeper inspection, I'm realizing that's not quite right. I need to correct that assumption. My current understanding, after a quick check, is that the origin of `mlock_vma_folio` is actually within `rmap.c`.

So, to get a clearer picture and verify this, my next logical step is to examine the code flow into `__folio_add_anon_rmap`. That's where I'll likely find the definitive calling path and understand the context in which `mlock_vma_folio` is relevant to anonymous memory mappings.


255/4 2026/08/27 19:40 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/rmap.c Name:__folio_add_anon_rmap]

Results:
map[SourceCode:1516:	static __always_inline void __folio_add_anon_rmap(struct folio *folio,
1517:			struct page *page, int nr_pages, struct vm_area_struct *vma,
1518:			unsigned long address, rmap_t flags, enum pgtable_level level)
1519:	{
1520:		int i;
1521:	
1522:		VM_WARN_ON_FOLIO(!folio_test_anon(folio), folio);
1523:	
1524:		__folio_add_rmap(folio, page, nr_pages, vma, level);
1525:	
1526:		if (likely(!folio_test_ksm(folio)))
1527:			__page_check_anon_rmap(folio, page, vma, address);
1528:	
1529:		if (flags & RMAP_EXCLUSIVE) {
1530:			switch (level) {
1531:			case PGTABLE_LEVEL_PTE:
1532:				for (i = 0; i < nr_pages; i++)
1533:					SetPageAnonExclusive(page + i);
1534:				break;
1535:			case PGTABLE_LEVEL_PMD:
1536:				SetPageAnonExclusive(page);
1537:				break;
1538:			case PGTABLE_LEVEL_PUD:
1539:				/*
1540:				 * Keep the compiler happy, we don't support anonymous
1541:				 * PUD mappings.
1542:				 */
1543:				WARN_ON_ONCE(1);
1544:				break;
1545:			default:
1546:				BUILD_BUG();
1547:			}
1548:		}
1549:	
1550:		VM_WARN_ON_FOLIO(!folio_test_large(folio) && PageAnonExclusive(page) &&
1551:				 atomic_read(&folio->_mapcount) > 0, folio);
1552:		for (i = 0; i < nr_pages; i++) {
1553:			struct page *cur_page = page + i;
1554:	
1555:			VM_WARN_ON_FOLIO(folio_test_large(folio) &&
1556:					 folio_entire_mapcount(folio) > 1 &&
1557:					 PageAnonExclusive(cur_page), folio);
1558:			if (IS_ENABLED(CONFIG_NO_PAGE_MAPCOUNT))
1559:				continue;
1560:	
1561:			/*
1562:			 * While PTE-mapping a THP we have a PMD and a PTE
1563:			 * mapping.
1564:			 */
1565:			VM_WARN_ON_FOLIO(atomic_read(&cur_page->_mapcount) > 0 &&
1566:					 PageAnonExclusive(cur_page), folio);
1567:		}
1568:	
1569:		/*
1570:		 * Only mlock it if the folio is fully mapped to the VMA.
1571:		 *
1572:		 * Partially mapped folios can be split on reclaim and part outside
1573:		 * of mlocked VMA can be evicted or freed.
1574:		 */
1575:		if (folio_nr_pages(folio) == nr_pages)
1576:			mlock_vma_folio(folio, vma);
1577:	}
 SourceFile:mm/rmap.c]

256/4 2026/08/27 19:40 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 18752
							output: 35
							thoughts: 161
						

Thoughts:
**My Thought Process Regarding `mlock` and Page Faults**

Okay, so I'm trying to get a handle on this `mlock` behavior, specifically how it interacts with page faults. My initial understanding was that `mlock_vma_folio` is invoked when a page gets mapped into a VMA, but *only if* that VMA is already locked.

However, the scenario I'm examining, my reproducer, presents a slightly different sequence. In my setup, the page is actually faulted in on CPU 0 *before* the `mlock` system call is even made. This is the crux of my confusion.

If the page is faulted in *before* `mlock`, that means it's already mapped into the VMA. Then, when `mlock` is subsequently called, in this case on CPU 1, it's operating on a VMA that already contains a mapped page.

My next question becomes: what path does `mlock` take in this situation? I know `mlock` will eventually call `populate_vma_page_range`, which in turn calls `__get_user_pages`. The critical point for me is: does `__get_user_pages` (or the functions it calls) then trigger `mlock_vma_folio`?

To resolve this, I need to dive deeper into the implementation. I'm planning to examine the `follow_page_mask` or `follow_page_pte` functions, as these seem like the logical places where the kernel would determine if a page is already present and mapped, and consequently, whether or not to apply `mlock_vma_folio` based on the VMA's lock status. This is where I expect to find the answer to whether `mlock_vma_folio` is indeed called in my pre-faulted scenario.


257/4 2026/08/27 19:41 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/gup.c Name:follow_page_pte]

Results:
map[SourceCode: 802:	static struct page *follow_page_pte(struct vm_area_struct *vma,
 803:			unsigned long address, pmd_t *pmd, unsigned int flags)
 804:	{
 805:		struct mm_struct *mm = vma->vm_mm;
 806:		struct folio *folio;
 807:		struct page *page;
 808:		spinlock_t *ptl;
 809:		pte_t *ptep, pte;
 810:		int ret;
 811:	
 812:		ptep = pte_offset_map_lock(mm, pmd, address, &ptl);
 813:		if (!ptep)
 814:			return no_page_table(vma, flags, address);
 815:		pte = ptep_get(ptep);
 816:		if (!pte_present(pte))
 817:			goto no_page;
 818:		if (pte_protnone(pte) && !gup_can_follow_protnone(vma, flags))
 819:			goto no_page;
 820:	
 821:		page = vm_normal_page(vma, address, pte);
 822:	
 823:		/*
 824:		 * We only care about anon pages in can_follow_write_pte().
 825:		 */
 826:		if ((flags & FOLL_WRITE) &&
 827:		    !can_follow_write_pte(pte, page, vma, flags)) {
 828:			page = NULL;
 829:			goto out;
 830:		}
 831:	
 832:		if (unlikely(!page)) {
 833:			if (flags & FOLL_DUMP) {
 834:				/* Avoid special (like zero) pages in core dumps */
 835:				page = ERR_PTR(-EFAULT);
 836:				goto out;
 837:			}
 838:	
 839:			if (is_zero_pfn(pte_pfn(pte))) {
 840:				page = pte_page(pte);
 841:			} else {
 842:				ret = follow_pfn_pte(vma, address, ptep, flags);
 843:				page = ERR_PTR(ret);
 844:				goto out;
 845:			}
 846:		}
 847:		folio = page_folio(page);
 848:	
 849:		if (!pte_write(pte) && gup_must_unshare(vma, flags, page)) {
 850:			page = ERR_PTR(-EMLINK);
 851:			goto out;
 852:		}
 853:	
 854:		VM_WARN_ON_ONCE_PAGE((flags & FOLL_PIN) && PageAnon(page) &&
 855:				     !PageAnonExclusive(page), page);
 856:	
 857:		/* try_grab_folio() does nothing unless FOLL_GET or FOLL_PIN is set. */
 858:		ret = try_grab_folio(folio, 1, flags);
 859:		if (unlikely(ret)) {
 860:			page = ERR_PTR(ret);
 861:			goto out;
 862:		}
 863:	
 864:		/*
 865:		 * We need to make the page accessible if and only if we are going
 866:		 * to access its content (the FOLL_PIN case).  Please see
 867:		 * Documentation/core-api/pin_user_pages.rst for details.
 868:		 */
 869:		if (flags & FOLL_PIN) {
 870:			ret = arch_make_folio_accessible(folio);
 871:			if (ret) {
 872:				unpin_user_page(page);
 873:				page = ERR_PTR(ret);
 874:				goto out;
 875:			}
 876:		}
 877:		if (flags & FOLL_TOUCH) {
 878:			if ((flags & FOLL_WRITE) &&
 879:			    !pte_dirty(pte) && !folio_test_dirty(folio))
 880:				folio_mark_dirty(folio);
 881:			/*
 882:			 * pte_mkyoung() would be more correct here, but atomic care
 883:			 * is needed to avoid losing the dirty bit: it is easier to use
 884:			 * folio_mark_accessed().
 885:			 */
 886:			folio_mark_accessed(folio);
 887:		}
 888:	out:
 889:		pte_unmap_unlock(ptep, ptl);
 890:		return page;
 891:	no_page:
 892:		pte_unmap_unlock(ptep, ptl);
 893:		if (!pte_none(pte))
 894:			return NULL;
 895:		return no_page_table(vma, flags, address);
 896:	}
 SourceFile:mm/gup.c]

258/4 2026/08/27 19:41 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 20375
							output: 35
							thoughts: 48
						

Thoughts:
**My Thought Process Regarding `mlock` and Page Locking**

Alright, so I've just been looking at the `mlock` system call's implementation, and I've hit a snag in my understanding. My initial assumption was that `follow_page_pte`, which is definitely involved in handling page table entries during memory operations like `mlock`, would directly call `mlock_vma_folio` to mark the page as mlocked. This is because `mlock_vma_folio` seems like the logical place where the actual mlocking state is set or managed for a given folio (which represents a page or a larger chunk of memory).

However, a closer inspection has revealed that `follow_page_pte` **does not** directly invoke `mlock_vma_folio`. This is a critical point. If `follow_page_pte` isn't doing the mlocking, then I need to figure out how `mlock` *does* achieve this marking. It's a fundamental part of the process, so there must be a mechanism in place. My next logical step, therefore, is to dive into `mlock_fixup`. I suspect that `mlock_fixup` is the intermediary function responsible for orchestrating the mlocking process, perhaps by calling the necessary folio-level locking functions or otherwise updating the page's metadata to reflect its mlocked status, even if `follow_page_pte` itself doesn't perform that final step. I need to trace the execution flow from `mlock` to `mlock_fixup` to understand the complete picture.


259/4 2026/08/27 19:41 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:mlock_fixup]

Results:
map[SourceCode: 458:	/*
 459:	 * mlock_fixup  - handle mlock[all]/munlock[all] requests.
 460:	 *
 461:	 * Filters out "special" vmas -- VMA_LOCKED_BIT never gets set for these, and
 462:	 * munlock is a no-op.  However, for some special vmas, we go ahead and
 463:	 * populate the ptes.
 464:	 *
 465:	 * For vmas that pass the filters, merge/split as appropriate.
 466:	 */
 467:	static int mlock_fixup(struct vma_iterator *vmi, struct vm_area_struct *vma,
 468:		       struct vm_area_struct **prev, unsigned long start,
 469:		       unsigned long end, vma_flags_t *new_vma_flags)
 470:	{
 471:		const vma_flags_t old_vma_flags = vma->flags;
 472:		struct mm_struct *mm = vma->vm_mm;
 473:		int nr_pages;
 474:		int ret = 0;
 475:	
 476:		if (vma_flags_same_pair(&old_vma_flags, new_vma_flags) ||
 477:		    vma_is_secretmem(vma) || !vma_supports_mlock(vma)) {
 478:			/*
 479:			 * Don't set VMA_LOCKED_BIT or VMA_LOCKONFAULT_BIT and don't
 480:			 * count.  For secretmem, don't allow the memory to be unlocked.
 481:			 */
 482:			goto out;
 483:		}
 484:	
 485:		vma = vma_modify_flags(vmi, *prev, vma, start, end, new_vma_flags);
 486:		if (IS_ERR(vma)) {
 487:			ret = PTR_ERR(vma);
 488:			goto out;
 489:		}
 490:	
 491:		/*
 492:		 * Keep track of amount of locked VM.
 493:		 */
 494:		nr_pages = (end - start) >> PAGE_SHIFT;
 495:		if (!vma_flags_test(new_vma_flags, VMA_LOCKED_BIT))
 496:			nr_pages = -nr_pages;
 497:		else if (vma_flags_test(&old_vma_flags, VMA_LOCKED_BIT))
 498:			nr_pages = 0;
 499:		mm->locked_vm += nr_pages;
 500:	
 501:		/*
 502:		 * vm_flags is protected by the mmap_lock held in write mode.
 503:		 * It's okay if try_to_unmap_one unmaps a page just after we
 504:		 * set VMA_LOCKED_BIT, populate_vma_page_range will bring it back.
 505:		 */
 506:		if (vma_flags_test(new_vma_flags, VMA_LOCKED_BIT) &&
 507:		    vma_flags_test(&old_vma_flags, VMA_LOCKED_BIT)) {
 508:			/* No work to do, and mlocking twice would be wrong */
 509:			vma_start_write(vma);
 510:			vma->flags = *new_vma_flags;
 511:		} else {
 512:			mlock_vma_pages_range(vma, start, end, new_vma_flags);
 513:		}
 514:	out:
 515:		*prev = vma;
 516:		return ret;
 517:	}
 SourceFile:mm/mlock.c]

260/4 2026/08/27 19:41 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 21526
							output: 39
							thoughts: 21
						

Thoughts:
**My Thought Process Regarding `mlock_fixup` and `mlock_vma_pages_range`**

Okay, so I'm looking at the kernel code, specifically focusing on memory locking mechanisms. My immediate observation is that the `mlock_fixup` function, which I understand is designed to handle the necessary setup and validation for memory locking operations within a virtual memory area (VMA), doesn't perform the actual page-level locking itself. Instead, it delegates that core responsibility.

What strikes me as the logical next step in this flow is that `mlock_fixup` is *calling* `mlock_vma_pages_range`. This makes perfect sense from a design perspective. `mlock_fixup` likely handles the higher-level VMA-specific checks – things like ensuring the memory region is valid for locking, checking permissions, perhaps calculating the size of the region to be locked, and ensuring it doesn't exceed any system-imposed limits. Once those preconditions are met, the actual, granular task of iterating through the pages within that VMA range and applying the `mlock` system call's semantics falls to `mlock_vma_pages_range`. This separation of concerns is a common and effective pattern in kernel development. I expect `mlock_vma_pages_range` to then interact with the page cache and page tables to mark those specific pages as locked in memory.


261/4 2026/08/27 19:41 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:mlock_vma_pages_range]

Results:
map[SourceCode: 412:	/*
 413:	 * mlock_vma_pages_range() - mlock any pages already in the range,
 414:	 *                           or munlock all pages in the range.
 415:	 * @vma - vma containing range to be mlock()ed or munlock()ed
 416:	 * @start - start address in @vma of the range
 417:	 * @end - end of range in @vma
 418:	 * @new_vma_flags - the new set of flags for @vma.
 419:	 *
 420:	 * Called for mlock(), mlock2() and mlockall(), to set @vma VMA_LOCKED_BIT;
 421:	 * called for munlock() and munlockall(), to clear VMA_LOCKED_BIT from @vma.
 422:	 */
 423:	static void mlock_vma_pages_range(struct vm_area_struct *vma,
 424:		unsigned long start, unsigned long end,
 425:		vma_flags_t *new_vma_flags)
 426:	{
 427:		static const struct mm_walk_ops mlock_walk_ops = {
 428:			.pmd_entry = mlock_pte_range,
 429:			.walk_lock = PGWALK_WRLOCK_VERIFY,
 430:		};
 431:	
 432:		/*
 433:		 * There is a slight chance that concurrent page migration,
 434:		 * or page reclaim finding a page of this now-VMA_LOCKED_BIT vma,
 435:		 * will call mlock_vma_folio() and raise page's mlock_count:
 436:		 * double counting, leaving the page unevictable indefinitely.
 437:		 * Communicate this danger to mlock_vma_folio() with VMA_IO_BIT,
 438:		 * which is a VMA_SPECIAL_FLAGS flag not allowed on VMA_LOCKED_BIT vmas.
 439:		 * mmap_lock is held in write mode here, so this weird
 440:		 * combination should not be visible to other mmap_lock users;
 441:		 * but WRITE_ONCE so rmap walkers must see VMA_IO_BIT if VMA_LOCKED_BIT.
 442:		 */
 443:		if (vma_flags_test(new_vma_flags, VMA_LOCKED_BIT))
 444:			vma_flags_set(new_vma_flags, VMA_IO_BIT);
 445:		vma_start_write(vma);
 446:		vma_flags_reset_once(vma, new_vma_flags);
 447:	
 448:		lru_add_drain();
 449:		walk_page_range_vma(vma, start, end, &mlock_walk_ops, NULL);
 450:		lru_add_drain();
 451:	
 452:		if (vma_flags_test(new_vma_flags, VMA_IO_BIT)) {
 453:			vma_flags_clear(new_vma_flags, VMA_IO_BIT);
 454:			vma_flags_reset_once(vma, new_vma_flags);
 455:		}
 456:	}
 SourceFile:mm/mlock.c]

262/4 2026/08/27 19:41 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 22501
							output: 36
							thoughts: 260
						

Thoughts:
**My Thought Process Unraveling the `mlock` and LRU Interaction**

Okay, so I'm tracing the execution flow of `mlock_vma_pages_range`. The first thing that strikes me is that it immediately calls `lru_add_drain()`. This is interesting, as it implies an immediate need to process pending LRU additions. Following that, I see a call to `walk_page_range_vma`, which then leads into `mlock_pte_range`. And then, lo and behold, `lru_add_drain()` is called *again*. This repetition makes me pause and consider the implications.

My immediate hypothesis is that these `lru_add_drain()` calls are specifically designed to clear out local CPU's `lru_add` batches and, importantly, `mlock_fbatch` (which I infer is a specialized batch for pages being locked).

Now, I'm thinking about a specific scenario: what if the page I'm trying to lock is currently in CPU 0's `lru_add` batch, but the `mlock` operation itself is being executed on CPU 1? This is where things get tricky. My understanding is that CPU 1's `lru_add_drain()` *won't* actually touch or drain CPU 0's `lru_add` batch. They are per-CPU structures, after all.

So, what happens next? The `mlock_pte_range` function is called, and within that, `mlock_folio` is invoked. This is where the page, which was in CPU 0's batch, is now being added to CPU 1's `mlock_fbatch`. This makes sense – the page is being processed and batched for locking on the *current* CPU (CPU 1).

Then, that second `lru_add_drain()` call that I noticed earlier, back in `mlock_vma_pages_range`, finally comes into play. This call is on CPU 1, and because the page is now in CPU 1's `mlock_fbatch`, this drain operation *will* process it. When CPU 1's `mlock_fbatch` is drained, the code path leads to `mlock_folio_batch`. This is the point where I want to dive deeper. I need to understand precisely what happens within `mlock_folio_batch` to confirm how this per-CPU batching and draining mechanism correctly handles pages that might originate from a different CPU's pending additions.


263/4 2026/08/27 19:41 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:mlock_folio_batch]

Results:
map[SourceCode: 179:	/*
 180:	 * mlock_folio_batch() is derived from folio_batch_move_lru(): perhaps that can
 181:	 * make use of such folio pointer flags in future, but for now just keep it for
 182:	 * mlock.  We could use three separate folio batches instead, but one feels
 183:	 * better (munlocking a full folio batch does not need to drain mlocking folio
 184:	 * batches first).
 185:	 */
 186:	static void mlock_folio_batch(struct folio_batch *fbatch)
 187:	{
 188:		struct lruvec *lruvec = NULL;
 189:		unsigned long mlock;
 190:		struct folio *folio;
 191:		int i;
 192:	
 193:		for (i = 0; i < folio_batch_count(fbatch); i++) {
 194:			folio = fbatch->folios[i];
 195:			mlock = (unsigned long)folio & (LRU_FOLIO | NEW_FOLIO);
 196:			folio = (struct folio *)((unsigned long)folio - mlock);
 197:			fbatch->folios[i] = folio;
 198:	
 199:			if (mlock & LRU_FOLIO)
 200:				lruvec = __mlock_folio(folio, lruvec);
 201:			else if (mlock & NEW_FOLIO)
 202:				lruvec = __mlock_new_folio(folio, lruvec);
 203:			else
 204:				lruvec = __munlock_folio(folio, lruvec);
 205:		}
 206:	
 207:		if (lruvec)
 208:			lruvec_unlock_irq(lruvec);
 209:		folios_put(fbatch);
 210:	}
 SourceFile:mm/mlock.c]

264/4 2026/08/27 19:41 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 23330
							output: 35
							thoughts: 9
						

Thoughts:
**My Internal Monologue During the Execution Flow**

Ah, so the execution flow has reached a point where it's invoking `__mlock_folio`. This tells me we're entering a critical phase related to memory management, specifically concerning the locking of memory pages – or in this case, "folios," which I understand as a more modern and potentially optimized abstraction for managing groups of pages.

My immediate thought is about the implications of this `mlock` operation. It signifies a desire to pin this particular portion of memory in RAM, preventing it from being swapped out to disk. This is typically done for performance reasons, especially for data or code that needs to be accessed with minimal latency and where the overhead of page faults would be detrimental.

I'm considering the context in which this `__mlock_folio` call is being made. Is this part of a real-time system? A high-performance database? A cryptographic operation? The specific application logic that led us here is crucial. What data is so vital that it *must* reside in physical memory at all times? What are the potential performance gains being sought, and are they truly worth the resources consumed by locking memory?

I'm also thinking about the permissions and resource limits. `mlock` is a privileged operation and is subject to user limits (like `RLIMIT_MEMLOCK`). I need to ensure that the process has the necessary privileges and that we're not exceeding the allocated memory lock limits. If we are, this call will likely fail, and I'll need to consider how that failure is handled and what fallback mechanisms are in place.

Furthermore, I'm contemplating the interaction with other memory management mechanisms. Is this folio already locked by another mechanism? Is there a potential for deadlocks if multiple parts of the system are trying to lock overlapping memory regions? While `mlock` itself is a direct system call, its integration within a larger system can introduce complexities.

Finally, I'm mentally tracking the reference counting and eventual unlocking. `mlock` is not a permanent state. There will be a corresponding mechanism, likely `munlock` or a related function, to release the lock when it's no longer needed. I need to ensure that this unlock operation is correctly implemented and that we don't have memory leaks or orphaned locks. This call to `__mlock_folio` is just one piece of a larger memory lifecycle management puzzle.


265/4 2026/08/27 19:41 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:__mlock_folio]

Results:
map[SourceCode:  61:	static struct lruvec *__mlock_folio(struct folio *folio, struct lruvec *lruvec)
  62:	{
  63:		/* There is nothing more we can do while it's off LRU */
  64:		if (!folio_test_clear_lru(folio))
  65:			return lruvec;
  66:	
  67:		lruvec = folio_lruvec_relock_irq(folio, lruvec);
  68:	
  69:		if (unlikely(folio_evictable(folio))) {
  70:			/*
  71:			 * This is a little surprising, but quite possible: PG_mlocked
  72:			 * must have got cleared already by another CPU.  Could this
  73:			 * folio be unevictable?  I'm not sure, but move it now if so.
  74:			 */
  75:			if (folio_test_unevictable(folio)) {
  76:				lruvec_del_folio(lruvec, folio);
  77:				folio_clear_unevictable(folio);
  78:				lruvec_add_folio(lruvec, folio);
  79:	
  80:				__count_vm_events(UNEVICTABLE_PGRESCUED,
  81:						  folio_nr_pages(folio));
  82:			}
  83:			goto out;
  84:		}
  85:	
  86:		if (folio_test_unevictable(folio)) {
  87:			if (folio_test_mlocked(folio))
  88:				folio->mlock_count++;
  89:			goto out;
  90:		}
  91:	
  92:		lruvec_del_folio(lruvec, folio);
  93:		folio_clear_active(folio);
  94:		folio_set_unevictable(folio);
  95:		folio->mlock_count = !!folio_test_mlocked(folio);
  96:		lruvec_add_folio(lruvec, folio);
  97:		__count_vm_events(UNEVICTABLE_PGCULLED, folio_nr_pages(folio));
  98:	out:
  99:		folio_set_lru(folio);
 100:		return lruvec;
 101:	}
 SourceFile:mm/mlock.c]

266/4 2026/08/27 19:41 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 24001
							output: 35
							thoughts: 302
						

Thoughts:
**My Thought Process Regarding `mlock` and `munmap` Interactions**

Okay, so I'm tracing this execution flow, and it's becoming clear how a specific scenario plays out, and frankly, it's a bit of a head-scratcher. I'm looking at `__mlock_folio` and the first thing it checks is `!folio_test_clear_lru(folio)`. Now, in this particular situation, the page I'm dealing with is still residing in CPU 0's `lru_add` batch. This means it hasn't actually *hit* the LRU list yet. Consequently, `folio_test_clear_lru(folio)` correctly evaluates to false, and `__mlock_folio` just bails out immediately, performing no action whatsoever.

However, the confounding part is that `mlock_folio` – the function that *initially* put this page into the batch – had *already* set the `PG_mlocked` flag using `folio_test_set_mlocked`. So, I've got this page with `PG_mlocked` set, but it's *not* yet on the unevictable LRU list, and crucially, the `mlock_count` hasn't been incremented. This seems like a potential mismatch.

Then, the plot thickens. `munmap` is invoked, but this time it's operating on CPU 1. Inside `munmap`, we get to `munlock_vma_folio`, which subsequently calls `munlock_folio`. Now, `munlock_folio` is going to add *this same page* to CPU 1's `mlock_fbatch`. The key here is that it's added with *no flags*, which signals that `__munlock_folio` will be called later. But here's the critical oversight: `munmap` *doesn't actually drain the batch* at this point.

The scenario culminates when CPU 1 is taken offline. At some point, `mlock_drain_remote` is invoked on a remaining CPU (let's say CPU 2). This function then proceeds to drain CPU 1's `mlock_fbatch`. And when it does, it finally calls `__munlock_folio`. This sequence of events, where the page gets an `mlock` flag set without being properly on the LRU, and then is subject to an incomplete `munmap` before a remote drain, is what I'm currently dissecting.


267/4 2026/08/27 19:41 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mlock.c Name:__munlock_folio]

Results:
map[SourceCode: 122:	static struct lruvec *__munlock_folio(struct folio *folio, struct lruvec *lruvec)
 123:	{
 124:		int nr_pages = folio_nr_pages(folio);
 125:		bool isolated = false;
 126:	
 127:		if (!folio_test_clear_lru(folio))
 128:			goto munlock;
 129:	
 130:		isolated = true;
 131:		lruvec = folio_lruvec_relock_irq(folio, lruvec);
 132:	
 133:		if (folio_test_unevictable(folio)) {
 134:			/* Then mlock_count is maintained, but might undercount */
 135:			if (folio->mlock_count)
 136:				folio->mlock_count--;
 137:			if (folio->mlock_count)
 138:				goto out;
 139:		}
 140:		/* else assume that was the last mlock: reclaim will fix it if not */
 141:	
 142:	munlock:
 143:		if (folio_test_clear_mlocked(folio)) {
 144:			__zone_stat_mod_folio(folio, NR_MLOCK, -nr_pages);
 145:			if (isolated || !folio_test_unevictable(folio))
 146:				__count_vm_events(UNEVICTABLE_PGMUNLOCKED, nr_pages);
 147:			else
 148:				__count_vm_events(UNEVICTABLE_PGSTRANDED, nr_pages);
 149:		}
 150:	
 151:		/* folio_evictable() has to be checked *after* clearing Mlocked */
 152:		if (isolated && folio_test_unevictable(folio) && folio_evictable(folio)) {
 153:			lruvec_del_folio(lruvec, folio);
 154:			folio_clear_unevictable(folio);
 155:			lruvec_add_folio(lruvec, folio);
 156:			__count_vm_events(UNEVICTABLE_PGRESCUED, nr_pages);
 157:		}
 158:	out:
 159:		if (isolated)
 160:			folio_set_lru(folio);
 161:		return lruvec;
 162:	}
 SourceFile:mm/mlock.c]

268/4 2026/08/27 19:41 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 25015
							output: 49
							thoughts: 2992
						

Thoughts:
**The Root of the Race Condition: An Unlocked Stat Modification**

I've been digging into this fascinating race condition, and it all boils down to how the system handles page unmapping, particularly when dealing with locked memory. The core issue arises within the `__munlock_folio` function.

Here's my thought process as I've pieced it together:

My initial observation was that `__munlock_folio` first checks `!folio_test_clear_lru(folio)`. Now, the critical insight here is that at the point where this check happens, the page is *still* sitting in CPU 0's `lru_add` batch. Because it's in this temporary holding area and hasn't been fully integrated into the LRU list yet, `folio_test_clear_lru(folio)` evaluates to `false`. This is exactly what the code is counting on; it causes the execution to jump directly to the `munlock:` label.

The crucial consequence of this jump is that the LRU vector (`lruvec`) is *not* locked. This is significant because locking the `lruvec` is what typically disables interrupts. Without that lock, interrupts remain enabled.

Next, the code proceeds to call `folio_test_clear_mlocked(folio)`. In this scenario, the `PG_mlocked` flag *was* set earlier by `mlock_folio`, so this check returns `true`.

This leads us to the problematic call: `__zone_stat_mod_folio(folio, NR_MLOCK, -nr_pages)`. My immediate concern here is that `__zone_stat_mod_folio` *expects* interrupts (or at least preemption) to be disabled when it's called. However, as we've established, the `lruvec` was not locked, meaning interrupts are *not* disabled.

This is where the race condition is fully exposed. The reproducer code, particularly the sequence where CPU 1 is offlined, triggers `mlock_drain_remote`. This function is called from `page_alloc_cpu_dead`, which is ultimately invoked by `cpuhp_invoke_callback`. Critically, this callback is executed with preemption *enabled*. Therefore, `__zone_stat_mod_folio` is indeed called with preemption active, and this is precisely what triggers the kernel warning I'm seeing.

It's a beautifully crafted race condition, and the provided reproducer is, in my opinion, perfectly designed to exploit this specific timing window. I've spent a good amount of time re-examining the reproducer to understand how it orchestrates this exact sequence of events.

Let's quickly review the reproducer's logic again to confirm this understanding:

*   **Thread 0**: Faults in the page on CPU 0. This places the page into CPU 0's `lru_add` batch, but importantly, it's *not yet* on the actual LRU list. Thread 0 then spins to prevent this batch from being drained prematurely.
*   **Thread 1**: Performs `mlock` and `munmap` on the page on CPU 1. The `mlock` operation attempts to add the page to CPU 1's `mlock_fbatch`. Because the page isn't on the LRU list (it's still in CPU 0's batch), `__mlock_folio` (called internally) effectively does nothing to the LRU state. Then, `munmap` is called. This is key: `munmap` calls `munlock_vma_folio`, which adds the page to CPU 1's `mlock_fbatch` but *without* any flags indicating it's on the LRU. Crucially, `munmap` itself doesn't force a drain of this batch.
*   **Main Thread**: This is the trigger. By offlining CPU 1, it forces `mlock_drain_remote` to execute on a surviving CPU. This function, in turn, calls `__munlock_folio` for the page that was in CPU 1's `mlock_fbatch`.

And at this exact moment, we have the perfect storm:
1.  The page is in CPU 0's `lru_add` batch, not on the LRU.
2.  `__munlock_folio` is called.
3.  `folio_test_clear_lru(folio)` returns false, skipping the LRU lock.
4.  `PG_mlocked` is set, so `folio_test_clear_mlocked(folio)` returns true.
5.  `__zone_stat_mod_folio` is called with preemption enabled because the `lruvec` wasn't locked.

This sequence, meticulously orchestrated by the reproducer, leads directly to the observed warning. It's a testament to how subtle timing dependencies can create significant issues.


269/4 2026/08/27 19:41 tool codesearch-find-references
0m Args:
map[ContextFile:mm/mmap.c IncludeSnippetLines:0 Name:lru_add_drain SourceTreePrefix:]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__collapse_huge_page_swapin SourceFile:mm/khugepaged.c SourceLine:1230] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__folio_batch_release SourceFile:mm/folio.c SourceLine:1112] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__lru_add_drain_all SourceFile:mm/folio.c SourceLine:887] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:collapse_file SourceFile:mm/khugepaged.c SourceLine:2329] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:collapse_file SourceFile:mm/khugepaged.c SourceLine:2344] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:collect_longterm_unpinnable_folios SourceFile:mm/gup.c SourceLine:2293] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:compact_zone SourceFile:mm/compaction.c SourceLine:2647] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:faultin_page_range SourceFile:mm/gup.c SourceLine:1914] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:generic_fadvise SourceFile:mm/fadvise.c SourceLine:155] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:lru_gen_shrink_lruvec SourceFile:mm/vmscan.c SourceLine:5143] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:lru_gen_shrink_node SourceFile:mm/vmscan.c SourceLine:5172] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:madvise_cold SourceFile:mm/madvise.c SourceLine:603] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:madvise_free_single_vma SourceFile:mm/madvise.c SourceLine:819] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:madvise_pageout SourceFile:mm/madvise.c SourceLine:644] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:madvise_willneed SourceFile:mm/madvise.c SourceLine:293] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:madvise_willneed SourceFile:mm/madvise.c SourceLine:299] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:memfd_tag_pins SourceFile:mm/memfd.c SourceLine:43] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:migrate_device_unmap SourceFile:mm/migrate_device.c SourceLine:581] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:migrate_folio_move SourceFile:mm/migrate.c SourceLine:1417] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:mlock_vma_pages_range SourceFile:mm/mlock.c SourceLine:448] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:mlock_vma_pages_range SourceFile:mm/mlock.c SourceLine:450] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:populate_vma_page_range SourceFile:mm/gup.c SourceLine:1862] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:shrink_active_list SourceFile:mm/vmscan.c SourceLine:2077] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:shrink_inactive_list SourceFile:mm/vmscan.c SourceLine:2006] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:wp_can_reuse_anon_folio SourceFile:mm/memory.c SourceLine:4275]] TruncatedOutput:false]

270/4 2026/08/27 19:41 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 28869
							output: 37
							thoughts: 2472
						

Thoughts:
**My Thought Process on the `mlock`/`munmap` Race Condition**

I've been deep in the weeds trying to understand this particular kernel bug, and I think I've finally pieced together the intricate sequence of events that leads to the observed race condition and the subsequent warning about `__zone_stat_mod_folio` being called with preemption enabled.

It all started with a statement in the bug description: "mlock() adds the page to CPU 1's mlock_fbatch with LRU_FOLIO and drains it." My initial reaction was a moment of confusion. "Drains it? That doesn't sound right if it's supposed to cause a problem later." But I remembered that system calls often involve complex internal workings, and `mlock` is no exception.

I dug into the `mlock` path, specifically `mlock_vma_pages_range`. That's where I found it: `mlock_vma_pages_range` *does* call `lru_add_drain()`. And `lru_add_drain` is precisely the mechanism that drains the *local* CPU's `lru_add` batch and, importantly, the `mlock_fbatch`. So, when `mlock` operates on CPU 1, it indeed drains CPU 1's `mlock_fbatch`. This means any `LRU_FOLIO` entry added by `mlock_folio` (which happens during the `mlock` operation itself) is promptly handled and drained. This initial understanding cleared up that part of the puzzle.

Then came `munmap`. My current understanding is that `munmap` calls `munlock_vma_folio`, which in turn calls `munlock_folio`. This `munlock_folio` operation adds the page to CPU 1's `mlock_fbatch`, but this time, it's added with *no flags*. The critical observation here is that `munmap` *does not* subsequently call `lru_add_drain()` in its path. So, the page is left sitting in CPU 1's `mlock_fbatch`, but without the `LRU_FOLIO` flag.

The scenario escalates when CPU 1 is taken offline. This event triggers `mlock_drain_remote(1)`. This function is responsible for draining the `mlock_fbatch` of a remote CPU (in this case, CPU 1, on behalf of CPU 0 or another CPU). It processes the entry in CPU 1's `mlock_fbatch` that has no flags, correctly interpreting it as needing an unlock operation, and calls `__munlock_folio`.

Here's where the race condition truly manifests: at this point, because the page was initially faulted in on CPU 0 and its `lru_add` batch wasn't drained by `munmap`, the page is still effectively stuck in CPU 0's `lru_add` batch and hasn't been properly added to the LRU list. Consequently, when `__munlock_folio` executes, it sees that the page is *not* on the LRU list. This leads it to skip the crucial step of acquiring the LRU lock. Without that lock, it then proceeds to call `__zone_stat_mod_folio` with preemption enabled. And that, precisely, is the condition that triggers the warning we're seeing. It's a perfect match to the bug description's symptoms.

With this understanding solidified, I've been refining the reproducer code. I'm carefully considering potential pitfalls, such as `mlock` failing due to `RLIMIT_MEMLOCK` limits. However, given that we're dealing with a single 4KB page and typical limits, this seems unlikely to be the cause. I've also double-checked the permissions and mapping flags, ensuring they are appropriate for `mlock`. The sequence of `mlock` calling `lru_add_drain()` twice, once before and once after processing page ranges, and the `munmap` path *not* doing so, is key. The `mlock_fbatch` being full isn't a concern here either, as we're only dealing with a single page addition at a time before it's drained.

The core of the issue lies in the interleaving of operations between `mlock`, `munmap`, and CPU hotplug, specifically around how page batches and LRU management are handled across different CPUs and during asynchronous events like CPU offline. The lack of a drain in the `munmap` path, combined with the later draining of the `mlock_fbatch` during CPU offline, creates this window for the race.


271/4 2026/08/27 19:42 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/mmap.c Name:do_vmi_munmap]

Results:
map[SourceCode:1659:	/*
1660:	 * do_vmi_munmap() - munmap a given range.
1661:	 * @vmi: The vma iterator
1662:	 * @mm: The mm_struct
1663:	 * @start: The start address to munmap
1664:	 * @len: The length of the range to munmap
1665:	 * @uf: The userfaultfd list_head
1666:	 * @unlock: set to true if the user wants to drop the mmap_lock on success
1667:	 *
1668:	 * This function takes a @mas that is either pointing to the previous VMA or set
1669:	 * to MA_START and sets it up to remove the mapping(s).  The @len will be
1670:	 * aligned.
1671:	 *
1672:	 * Return: 0 on success and drops the lock if so directed, error and leaves the
1673:	 * lock held otherwise.
1674:	 */
1675:	int do_vmi_munmap(struct vma_iterator *vmi, struct mm_struct *mm,
1676:			  unsigned long start, size_t len, struct list_head *uf,
1677:			  bool unlock)
1678:	{
1679:		unsigned long end;
1680:		struct vm_area_struct *vma;
1681:	
1682:		if ((offset_in_page(start)) || start > TASK_SIZE || len > TASK_SIZE-start)
1683:			return -EINVAL;
1684:	
1685:		end = start + PAGE_ALIGN(len);
1686:		if (end == start)
1687:			return -EINVAL;
1688:	
1689:		/* Find the first overlapping VMA */
1690:		vma = vma_find(vmi, end);
1691:		if (!vma) {
1692:			if (unlock)
1693:				mmap_write_unlock(mm);
1694:			return 0;
1695:		}
1696:	
1697:		return do_vmi_align_munmap(vmi, vma, mm, start, end, uf, unlock);
1698:	}
 SourceFile:mm/vma.c]

272/4 2026/08/27 19:42 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 32009
							output: 39
							thoughts: 15
						

Thoughts:
**My Thought Process**

Right, so the immediate thought is to delve into the `do_vmi_align_munmap` function. I need to understand precisely what it's doing, especially in the context of memory management. My expertise tells me that munmap operations, particularly those that are "aligned," can have subtle but significant performance implications or potential pitfalls. Therefore, my priority is to trace the execution path of `do_vmi_align_munmap`. I'll be looking for how it handles the alignment aspect: is it simply a matter of rounding down/up addresses or page boundaries, or is there more sophisticated logic involved? I’ll also pay close attention to how it interacts with the underlying memory management structures and any potential side effects on memory mapping, caching, or TLB invalidation. Understanding the specifics of this function is crucial to assessing its correctness, efficiency, and its role within the broader system's memory virtualization or management framework.


273/4 2026/08/27 19:42 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/vma.c Name:do_vmi_align_munmap]

Results:
map[SourceCode:1614:	/*
1615:	 * do_vmi_align_munmap() - munmap the aligned region from @start to @end.
1616:	 * @vmi: The vma iterator
1617:	 * @vma: The starting vm_area_struct
1618:	 * @mm: The mm_struct
1619:	 * @start: The aligned start address to munmap.
1620:	 * @end: The aligned end address to munmap.
1621:	 * @uf: The userfaultfd list_head
1622:	 * @unlock: Set to true to drop the mmap_lock.  unlocking only happens on
1623:	 * success.
1624:	 *
1625:	 * Return: 0 on success and drops the lock if so directed, error and leaves the
1626:	 * lock held otherwise.
1627:	 */
1628:	int do_vmi_align_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma,
1629:			struct mm_struct *mm, unsigned long start, unsigned long end,
1630:			struct list_head *uf, bool unlock)
1631:	{
1632:		struct maple_tree mt_detach;
1633:		MA_STATE(mas_detach, &mt_detach, 0, 0);
1634:		mt_init_flags(&mt_detach, vmi->mas.tree->ma_flags & MT_FLAGS_LOCK_MASK);
1635:		mt_on_stack(mt_detach);
1636:		struct vma_munmap_struct vms;
1637:		int error;
1638:	
1639:		init_vma_munmap(&vms, vmi, vma, start, end, uf, unlock);
1640:		error = vms_gather_munmap_vmas(&vms, &mas_detach);
1641:		if (error)
1642:			goto gather_failed;
1643:	
1644:		error = vma_iter_clear_gfp(vmi, start, end, GFP_KERNEL);
1645:		if (error)
1646:			goto clear_tree_failed;
1647:	
1648:		/* Point of no return */
1649:		vms_complete_munmap_vmas(&vms, &mas_detach);
1650:		return 0;
1651:	
1652:	clear_tree_failed:
1653:		reattach_vmas(&mas_detach);
1654:	gather_failed:
1655:		validate_mm(mm);
1656:		return error;
1657:	}
 SourceFile:mm/vma.c]

274/4 2026/08/27 19:42 llm repro-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 32803
							output: 40
							thoughts: 16
						

Thoughts:
**My Thought Process Regarding `vms_complete_munmap_vmas`**

Alright, the immediate step in my mind is to dive into the `vms_complete_munmap_vmas` function. I need to understand its exact purpose and how it fits into the broader memory management picture. My focus here will be on tracing its execution flow and identifying any critical operations it performs. I'm particularly interested in how it handles the deallocation of virtual memory areas (VMAs), the specifics of unmapping memory, and any potential side effects or dependencies it has. I'll be scrutinizing its arguments, return values, and any internal state it modifies. The goal is to gain a comprehensive grasp of its role in resource cleanup and ensuring memory integrity.


275/4 2026/08/27 19:42 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/vma.c Name:vms_complete_munmap_vmas]

Results:
map[SourceCode:1366:	/*
1367:	 * vms_complete_munmap_vmas() - Finish the munmap() operation
1368:	 * @vms: The vma munmap struct
1369:	 * @mas_detach: The maple state of the detached vmas
1370:	 *
1371:	 * This updates the mm_struct, unmaps the region, frees the resources
1372:	 * used for the munmap() and may downgrade the lock - if requested.  Everything
1373:	 * needed to be done once the vma maple tree is updated.
1374:	 */
1375:	static void vms_complete_munmap_vmas(struct vma_munmap_struct *vms,
1376:			struct ma_state *mas_detach)
1377:	{
1378:		struct vm_area_struct *vma;
1379:		struct mm_struct *mm;
1380:	
1381:		mm = current->mm;
1382:		mm->map_count -= vms->vma_count;
1383:		mm->locked_vm -= vms->locked_vm;
1384:		if (vms->unlock)
1385:			mmap_write_downgrade(mm);
1386:	
1387:		if (!vms->nr_pages)
1388:			return;
1389:	
1390:		vms_clear_ptes(vms, mas_detach, !vms->unlock);
1391:		/* Update high watermark before we lower total_vm */
1392:		update_hiwater_vm(mm);
1393:		/* Stat accounting */
1394:		WRITE_ONCE(mm->total_vm, READ_ONCE(mm->total_vm) - vms->nr_pages);
1395:		/* Paranoid bookkeeping */
1396:		VM_WARN_ON(vms->exec_vm > mm->exec_vm);
1397:		VM_WARN_ON(vms->stack_vm > mm->stack_vm);
1398:		VM_WARN_ON(vms->data_vm > mm->data_vm);
1399:		mm->exec_vm -= vms->exec_vm;
1400:		mm->stack_vm -= vms->stack_vm;
1401:		mm->data_vm -= vms->data_vm;
1402:	
1403:		/* Remove and clean up vmas */
1404:		mas_set(mas_detach, 0);
1405:		mas_for_each(mas_detach, vma, ULONG_MAX)
1406:			remove_vma(vma);
1407:	
1408:		vm_unacct_memory(vms->nr_accounted);
1409:		validate_mm(mm);
1410:		if (vms->unlock)
1411:			mmap_read_unlock(mm);
1412:	
1413:		__mt_destroy(mas_detach->tree);
1414:	}
 SourceFile:mm/vma.c]

276/4 2026/08/27 19:42 llm repro-generator
1m Model:
gemini-3.1-pro-preview

Tokens:
							input: 33691
							output: 2136
							thoughts: 5152
						

Thoughts:
**My Thoughts on Reproducing the Kernel Bug**

Okay, let's break down how I'm approaching this. I've been looking at the interaction between `vms_clear_ptes` and `unmap_region`, and it seems neither of those paths directly calls `lru_add_drain()`. This confirms my suspicion that the initial reproducer is indeed valid.

Now, my focus is on refining this reproducer to be absolutely precise and robust, adhering to strict logging and error-checking conventions. Here's the thought process behind the specific requirements:

1.  **`printf(...)` for all messages:** This is straightforward. Every single output, whether it's a progress indicator or an error log, needs to go through `printf`. This ensures consistent formatting and makes it easy to capture and analyze the output.

2.  **Every system call must check for failures:** This is critical for a reliable reproducer. I need to treat every system call as a potential point of failure. If a call doesn't return the expected success value, I must assume it failed.

3.  **Specific error messages and exit on failure:** When a system call *does* fail, I can't just move on. I need to provide a clear, actionable error message. This message must include:
    *   A prefix indicating it's an error (e.g., `[-]`).
    *   The name of the function that was called.
    *   The specific error reason, obtained using `strerror(errno)`.
    *   Crucially, the program must terminate immediately with a non-zero exit code. This signals that the reproducer couldn't even set up the scenario correctly and prevents further, potentially misleading, execution.

4.  **Success messages after major steps:** For every step that *does* succeed, I need a confirmation message. This helps me follow the execution flow and verify that each part of the setup is working as intended. A prefix like `[+]` will be used for these.

5.  **Standardized operation pattern:** To ensure consistency and catch potential errors everywhere, I'm adopting a uniform pattern for executing any operation that can fail:
    ```c
    int res = do_something();
    if (res < 0) {
        printf("[-] Failed to do_something: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] do_something successful.\n");
    ```
    This pattern directly addresses points 2, 3, and 4.

With these guidelines in mind, I've constructed the final reproducer code, meticulously checking each system call and adding the required `printf` statements. I've also made sure to include `<errno.h>` and `<string.h>` for error handling and `strerror`.

**Further Refinements and Considerations:**

*   **`race_toolkit.h`:** I'm following the instruction to simply `#include "race_toolkit.h"` rather than copying its contents, as specified.
*   **`pthread_create` and `pthread_join` error handling:** I've confirmed that these functions return error codes directly, not via `errno`. Therefore, `strerror(res)` is the correct way to get the error string.
*   **`sched_setaffinity` behavior:** I'm aware that `sched_setaffinity` might fail if the system has fewer than 8 CPUs, or specifically, if CPUs 2-7 are not available. The intention is to pin the main thread to a CPU *other than* 0 or 1 to avoid interference. If this fails, the main thread will run on whatever CPU it defaults to, and I've assessed that this is unlikely to break the core race condition being triggered. The critical part is offlining CPU 1, and the kernel handles migrating the process away from CPU 1 before it's offlined, regardless of where the main thread was initially pinned.
*   **CPU 1 offlining logic:** The sequence of offlining CPU 1 is designed to trigger the specific kernel path that leads to the bug: `page_alloc_cpu_dead` calling `mlock_drain_remote`. This, in turn, should call `__munlock_folio`, which, by design of the race, will bypass the LRU lock and then call `__zone_stat_mod_folio` with preemption enabled, thus triggering the warning.
*   **`sleep(1)`:** This short sleep after offlining CPU 1 is a pragmatic choice to give the kernel's asynchronous operations (like the warning being generated) a chance to complete and be printed before the test exits.

This detailed, step-by-step approach, combined with rigorous error checking and specific logging, ensures that the reproducer accurately targets and demonstrates the identified kernel issue.


277/4 2026/08/27 19:43 tool set-results
0m Args:
map[IsProbe:false RawCandidateReproC:#include "race_toolkit.h"
#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

volatile int step = 0;
void *addr;

void *thread0(void *arg) {
    PIN_TO_CPU(0);
    
    WAIT_ON(&step, 1);
    
    // Fault in the page on CPU 0.
    // It gets added to CPU 0's lru_add batch, but not yet on the LRU list.
    *(volatile char *)addr = 1;
    printf("[+] thread0: faulted in page on CPU 0\n");
    
    SIGNAL(&step, 2);
    
    // Spin to prevent CPU 0 from draining its lru_add batch.
    WAIT_ON(&step, 5);
    
    return NULL;
}

void *thread1(void *arg) {
    PIN_TO_CPU(1);
    
    WAIT_ON(&step, 2);
    
    // mlock the page on CPU 1.
    // It adds the page to CPU 1's mlock_fbatch with LRU_FOLIO, then drains it.
    // __mlock_folio sees the page is not on LRU (still in CPU 0's batch) and does nothing.
    int res = mlock(addr, 4096);
    if (res < 0) {
        printf("[-] Failed to mlock: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] mlock successful.\n");
    
    // munmap the page on CPU 1.
    // Since the VMA is locked, it calls munlock_vma_folio, which adds the page
    // to CPU 1's mlock_fbatch with NO flags. munmap does not drain the batch.
    res = munmap(addr, 4096);
    if (res < 0) {
        printf("[-] Failed to munmap: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] munmap successful.\n");
    
    SIGNAL(&step, 3);
    
    // Sleep until the test finishes.
    WAIT_ON(&step, 5);
    
    return NULL;
}

int main() {
    SETUP_UNBUFFERED_IO();
    
    // Pin main thread to CPU 2+ to avoid interfering with CPU 0 and 1.
    // If CPU 2 is not available, it will just fail and run anywhere.
    cpu_set_t set;
    CPU_ZERO(&set);
    for (int i = 2; i < 8; i++) {
        CPU_SET(i, &set);
    }
    int res = sched_setaffinity(0, sizeof(set), &set);
    if (res < 0) {
        printf("[-] Failed to sched_setaffinity (ignoring): %s\n", strerror(errno));
    } else {
        printf("[+] sched_setaffinity successful.\n");
    }
    
    // Ensure CPU 1 is online initially.
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "1\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    if (addr == MAP_FAILED) {
        printf("[-] Failed to mmap: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] mmap successful.\n");
    
    pthread_t t0, t1;
    res = pthread_create(&t0, NULL, thread0, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_create t0: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_create t0 successful.\n");
    
    res = pthread_create(&t1, NULL, thread1, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_create t1: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_create t1 successful.\n");
    
    SIGNAL(&step, 1);
    
    WAIT_ON(&step, 3);
    
    // Offline CPU 1.
    // This triggers page_alloc_cpu_dead -> mlock_drain_remote on a surviving CPU.
    // mlock_drain_remote calls __munlock_folio, which sees the page is not on LRU,
    // skips taking the LRU lock, and calls __zone_stat_mod_folio with preemption enabled,
    // triggering the warning.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "0\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    // Wait a bit to ensure the asynchronous warning is triggered and printed.
    sleep(1);
    
    SIGNAL(&step, 5);
    
    res = pthread_join(t0, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_join t0: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_join t0 successful.\n");
    
    res = pthread_join(t1, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_join t1: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_join t1 successful.\n");
    
    // Restore CPU 1.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "1\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    printf("[+] Done\n");
    return 0;
}]

Results:
map[IsProbe:false RawCandidateReproC:#include "race_toolkit.h"
#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

volatile int step = 0;
void *addr;

void *thread0(void *arg) {
    PIN_TO_CPU(0);
    
    WAIT_ON(&step, 1);
    
    // Fault in the page on CPU 0.
    // It gets added to CPU 0's lru_add batch, but not yet on the LRU list.
    *(volatile char *)addr = 1;
    printf("[+] thread0: faulted in page on CPU 0\n");
    
    SIGNAL(&step, 2);
    
    // Spin to prevent CPU 0 from draining its lru_add batch.
    WAIT_ON(&step, 5);
    
    return NULL;
}

void *thread1(void *arg) {
    PIN_TO_CPU(1);
    
    WAIT_ON(&step, 2);
    
    // mlock the page on CPU 1.
    // It adds the page to CPU 1's mlock_fbatch with LRU_FOLIO, then drains it.
    // __mlock_folio sees the page is not on LRU (still in CPU 0's batch) and does nothing.
    int res = mlock(addr, 4096);
    if (res < 0) {
        printf("[-] Failed to mlock: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] mlock successful.\n");
    
    // munmap the page on CPU 1.
    // Since the VMA is locked, it calls munlock_vma_folio, which adds the page
    // to CPU 1's mlock_fbatch with NO flags. munmap does not drain the batch.
    res = munmap(addr, 4096);
    if (res < 0) {
        printf("[-] Failed to munmap: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] munmap successful.\n");
    
    SIGNAL(&step, 3);
    
    // Sleep until the test finishes.
    WAIT_ON(&step, 5);
    
    return NULL;
}

int main() {
    SETUP_UNBUFFERED_IO();
    
    // Pin main thread to CPU 2+ to avoid interfering with CPU 0 and 1.
    // If CPU 2 is not available, it will just fail and run anywhere.
    cpu_set_t set;
    CPU_ZERO(&set);
    for (int i = 2; i < 8; i++) {
        CPU_SET(i, &set);
    }
    int res = sched_setaffinity(0, sizeof(set), &set);
    if (res < 0) {
        printf("[-] Failed to sched_setaffinity (ignoring): %s\n", strerror(errno));
    } else {
        printf("[+] sched_setaffinity successful.\n");
    }
    
    // Ensure CPU 1 is online initially.
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "1\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    if (addr == MAP_FAILED) {
        printf("[-] Failed to mmap: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] mmap successful.\n");
    
    pthread_t t0, t1;
    res = pthread_create(&t0, NULL, thread0, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_create t0: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_create t0 successful.\n");
    
    res = pthread_create(&t1, NULL, thread1, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_create t1: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_create t1 successful.\n");
    
    SIGNAL(&step, 1);
    
    WAIT_ON(&step, 3);
    
    // Offline CPU 1.
    // This triggers page_alloc_cpu_dead -> mlock_drain_remote on a surviving CPU.
    // mlock_drain_remote calls __munlock_folio, which sees the page is not on LRU,
    // skips taking the LRU lock, and calls __zone_stat_mod_folio with preemption enabled,
    // triggering the warning.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "0\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    // Wait a bit to ensure the asynchronous warning is triggered and printed.
    sleep(1);
    
    SIGNAL(&step, 5);
    
    res = pthread_join(t0, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_join t0: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_join t0 successful.\n");
    
    res = pthread_join(t1, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_join t1: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_join t1 successful.\n");
    
    // Restore CPU 1.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "1\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    printf("[+] Done\n");
    return 0;
}]

278/3 2026/08/27 19:43 loop
0m
279/4 2026/08/27 19:43 iteration 0
0m
280/5 2026/08/27 19:43 action merge-repro-c
0m Results:
map[CurrentCandidateReproC:#include "race_toolkit.h"
#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

volatile int step = 0;
void *addr;

void *thread0(void *arg) {
    PIN_TO_CPU(0);
    
    WAIT_ON(&step, 1);
    
    // Fault in the page on CPU 0.
    // It gets added to CPU 0's lru_add batch, but not yet on the LRU list.
    *(volatile char *)addr = 1;
    printf("[+] thread0: faulted in page on CPU 0\n");
    
    SIGNAL(&step, 2);
    
    // Spin to prevent CPU 0 from draining its lru_add batch.
    WAIT_ON(&step, 5);
    
    return NULL;
}

void *thread1(void *arg) {
    PIN_TO_CPU(1);
    
    WAIT_ON(&step, 2);
    
    // mlock the page on CPU 1.
    // It adds the page to CPU 1's mlock_fbatch with LRU_FOLIO, then drains it.
    // __mlock_folio sees the page is not on LRU (still in CPU 0's batch) and does nothing.
    int res = mlock(addr, 4096);
    if (res < 0) {
        printf("[-] Failed to mlock: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] mlock successful.\n");
    
    // munmap the page on CPU 1.
    // Since the VMA is locked, it calls munlock_vma_folio, which adds the page
    // to CPU 1's mlock_fbatch with NO flags. munmap does not drain the batch.
    res = munmap(addr, 4096);
    if (res < 0) {
        printf("[-] Failed to munmap: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] munmap successful.\n");
    
    SIGNAL(&step, 3);
    
    // Sleep until the test finishes.
    WAIT_ON(&step, 5);
    
    return NULL;
}

int main() {
    SETUP_UNBUFFERED_IO();
    
    // Pin main thread to CPU 2+ to avoid interfering with CPU 0 and 1.
    // If CPU 2 is not available, it will just fail and run anywhere.
    cpu_set_t set;
    CPU_ZERO(&set);
    for (int i = 2; i < 8; i++) {
        CPU_SET(i, &set);
    }
    int res = sched_setaffinity(0, sizeof(set), &set);
    if (res < 0) {
        printf("[-] Failed to sched_setaffinity (ignoring): %s\n", strerror(errno));
    } else {
        printf("[+] sched_setaffinity successful.\n");
    }
    
    // Ensure CPU 1 is online initially.
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "1\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    if (addr == MAP_FAILED) {
        printf("[-] Failed to mmap: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] mmap successful.\n");
    
    pthread_t t0, t1;
    res = pthread_create(&t0, NULL, thread0, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_create t0: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_create t0 successful.\n");
    
    res = pthread_create(&t1, NULL, thread1, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_create t1: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_create t1 successful.\n");
    
    SIGNAL(&step, 1);
    
    WAIT_ON(&step, 3);
    
    // Offline CPU 1.
    // This triggers page_alloc_cpu_dead -> mlock_drain_remote on a surviving CPU.
    // mlock_drain_remote calls __munlock_folio, which sees the page is not on LRU,
    // skips taking the LRU lock, and calls __zone_stat_mod_folio with preemption enabled,
    // triggering the warning.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "0\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    // Wait a bit to ensure the asynchronous warning is triggered and printed.
    sleep(1);
    
    SIGNAL(&step, 5);
    
    res = pthread_join(t0, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_join t0: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_join t0 successful.\n");
    
    res = pthread_join(t1, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_join t1: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_join t1 successful.\n");
    
    // Restore CPU 1.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "1\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    printf("[+] Done\n");
    return 0;
}]

281/5 2026/08/27 19:43 action compile-c-prog
0m Results:
map[CompilerError: FormattedReproC:// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"

// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.

#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>

// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)

// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu)                                                \
	do {                                                           \
		cpu_set_t mask;                                        \
		CPU_ZERO(&mask);                                       \
		CPU_SET(cpu, &mask);                                   \
		if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
			perror("sched_setaffinity");                   \
		}                                                      \
	} while (0)

// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)

// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val)                                               \
	do {                                                             \
		while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
			;                                                \
	} while (0)

// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)

// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).

static inline double timer_elapsed_sec(struct timespec* start)
{
	struct timespec now;
	if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
		perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
		exit(1);
	}
	return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}

// Initialize a monotonic timer variable.
#define TIMER_START(t)                                          \
	struct timespec t;                                      \
	if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) {         \
		perror("clock_gettime(CLOCK_MONOTONIC) start"); \
		exit(1);                                        \
	}

// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))

// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
	int state;
} event_t;

static void event_init(event_t* ev)
{
	ev->state = 0;
}
static void event_reset(event_t* ev)
{
	ev->state = 0;
}

static void event_set(event_t* ev)
{
	if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
		fprintf(stderr, "event already set\n");
		exit(1);
	}
	__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
	syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}

static void event_wait(event_t* ev)
{
	while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
		syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}

// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
	int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
	if (uffd == -1)
		return -1;
	struct uffdio_api api = {.api = UFFD_API, .features = 0};
	if (ioctl(uffd, UFFDIO_API, &api) == -1) {
		close(uffd);
		return -1;
	}
	struct uffdio_register reg = {
	    .range = {.start = (uintptr_t)addr, .len = len},
	    .mode = UFFDIO_REGISTER_MODE_MISSING};
	if (ioctl(uffd, UFFDIO_REGISTER, &reg) == -1) {
		close(uffd);
		return -1;
	}
	return uffd;
}

// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
//    pause a thread accessing that memory until you handle the fault, creating a reliable
//    and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
//    immediately. This is essential for understanding the exact interleaving of events
//    when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
//    or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
//    Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
//        TIMER_START(start);
//        while (TIMER_NOT_EXPIRED(start, 10.0)) {
//            // Your race logic here
//        }

#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

volatile int step = 0;
void *addr;

void *thread0(void *arg) {
    PIN_TO_CPU(0);
    
    WAIT_ON(&step, 1);
    
    // Fault in the page on CPU 0.
    // It gets added to CPU 0's lru_add batch, but not yet on the LRU list.
    *(volatile char *)addr = 1;
    printf("[+] thread0: faulted in page on CPU 0\n");
    
    SIGNAL(&step, 2);
    
    // Spin to prevent CPU 0 from draining its lru_add batch.
    WAIT_ON(&step, 5);
    
    return NULL;
}

void *thread1(void *arg) {
    PIN_TO_CPU(1);
    
    WAIT_ON(&step, 2);
    
    // mlock the page on CPU 1.
    // It adds the page to CPU 1's mlock_fbatch with LRU_FOLIO, then drains it.
    // __mlock_folio sees the page is not on LRU (still in CPU 0's batch) and does nothing.
    int res = mlock(addr, 4096);
    if (res < 0) {
        printf("[-] Failed to mlock: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] mlock successful.\n");
    
    // munmap the page on CPU 1.
    // Since the VMA is locked, it calls munlock_vma_folio, which adds the page
    // to CPU 1's mlock_fbatch with NO flags. munmap does not drain the batch.
    res = munmap(addr, 4096);
    if (res < 0) {
        printf("[-] Failed to munmap: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] munmap successful.\n");
    
    SIGNAL(&step, 3);
    
    // Sleep until the test finishes.
    WAIT_ON(&step, 5);
    
    return NULL;
}

int main() {
    SETUP_UNBUFFERED_IO();
    
    // Pin main thread to CPU 2+ to avoid interfering with CPU 0 and 1.
    // If CPU 2 is not available, it will just fail and run anywhere.
    cpu_set_t set;
    CPU_ZERO(&set);
    for (int i = 2; i < 8; i++) {
        CPU_SET(i, &set);
    }
    int res = sched_setaffinity(0, sizeof(set), &set);
    if (res < 0) {
        printf("[-] Failed to sched_setaffinity (ignoring): %s\n", strerror(errno));
    } else {
        printf("[+] sched_setaffinity successful.\n");
    }
    
    // Ensure CPU 1 is online initially.
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "1\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    if (addr == MAP_FAILED) {
        printf("[-] Failed to mmap: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] mmap successful.\n");
    
    pthread_t t0, t1;
    res = pthread_create(&t0, NULL, thread0, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_create t0: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_create t0 successful.\n");
    
    res = pthread_create(&t1, NULL, thread1, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_create t1: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_create t1 successful.\n");
    
    SIGNAL(&step, 1);
    
    WAIT_ON(&step, 3);
    
    // Offline CPU 1.
    // This triggers page_alloc_cpu_dead -> mlock_drain_remote on a surviving CPU.
    // mlock_drain_remote calls __munlock_folio, which sees the page is not on LRU,
    // skips taking the LRU lock, and calls __zone_stat_mod_folio with preemption enabled,
    // triggering the warning.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "0\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    // Wait a bit to ensure the asynchronous warning is triggered and printed.
    sleep(1);
    
    SIGNAL(&step, 5);
    
    res = pthread_join(t0, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_join t0: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_join t0 successful.\n");
    
    res = pthread_join(t1, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_join t1: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_join t1 successful.\n");
    
    // Restore CPU 1.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "1\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    printf("[+] Done\n");
    return 0;
}]

282/5 2026/08/27 19:43 action If
0m Args:
map[CompilerError:]

283/3 2026/08/27 19:43 action run-c-repro
4m Results:
map[CandidateBugTitle:WARNING in __mod_zone_page_state CandidateCrashReport:smpboot: CPU 1 is now offline
------------[ cut here ]------------
IS_ENABLED(CONFIG_PREEMPT_COUNT) && __lockdep_enabled && (preempt_count() == 0 && this_cpu_read(hardirqs_enabled))
WARNING: mm/vmstat.c:361 at __mod_zone_page_state+0xfc/0x140 mm/vmstat.c:361, CPU#0: syz-executor334/5899
Modules linked in:
CPU: 0 UID: 0 PID: 5899 Comm: syz-executor334 Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__mod_zone_page_state+0xfc/0x140 mm/vmstat.c:361
Code: c7 af 09 65 43 88 1c 34 5b 41 5c 41 5d 41 5e 41 5f 5d e9 c7 ac b2 09 cc 48 89 df 4c 89 fe 89 ea e8 59 00 00 00 31 db eb ce 90 <0f> 0b 90 eb 8b 48 c7 c7 40 d6 e6 8e 4c 89 f6 e8 30 2c fc 02 e9 34
RSP: 0000:ffffc9000354f890 EFLAGS: 00010202
RAX: 0000000000000001 RBX: ffffffffffffffff RCX: ffff888117054b00
RDX: ffffffffffffffff RSI: 0000000000000008 RDI: ffff88817fffc140
RBP: 0000000000000008 R08: ffffea00047ac9c7 R09: 1ffffd40008f5938
R10: dffffc0000000000 R11: fffff940008f5939 R12: ffffffff939bb700
R13: dffffc0000000000 R14: 0000000000000008 R15: ffff88817fffc140
FS:  000055557544d400(0000) GS:ffff8881a4c86000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055ef7c002388 CR3: 00000001867be000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 __zone_stat_mod_folio include/linux/vmstat.h:410 [inline]
 __munlock_folio mm/mlock.c:144 [inline]
 mlock_folio_batch+0x1a9c/0x3c00 mm/mlock.c:204
 page_alloc_cpu_dead+0x23/0x100 mm/page_alloc.c:6468
 cpuhp_invoke_callback+0x434/0x810 kernel/cpu.c:194
 __cpuhp_invoke_callback_range kernel/cpu.c:972 [inline]
 cpuhp_invoke_callback_range kernel/cpu.c:996 [inline]
 cpuhp_down_callbacks kernel/cpu.c:1386 [inline]
 _cpu_down+0x343/0x840 kernel/cpu.c:1457
 cpu_down_maps_locked kernel/cpu.c:1483 [inline]
 cpu_down kernel/cpu.c:1491 [inline]
 cpu_device_down+0x82/0xc0 kernel/cpu.c:1508
 device_offline+0x2d2/0x3c0 drivers/base/core.c:4283
 online_store+0x123/0x1a0 drivers/base/core.c:2883
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fae41a5a05e
Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
RSP: 002b:00007ffcba1a9468 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 000055557544d400 RCX: 00007fae41a5a05e
RDX: 0000000000000002 RSI: 00007fae41a9f0ff RDI: 0000000000000003
RBP: 00007fae41aa15e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fae41aa1578
R13: 00007fae41a9f09a R14: 00007fae41a9f0b9 R15: 0000000000000002
 </TASK>
 CandidateReproduced:true ConsoleOutput:[  108.236232][   T33] kauditd_printk_skb: 10 callbacks suppressed
[  108.236247][   T33] audit: type=1400 audit(1787859949.483:202): avc:  denied  { transition } for  pid=5831 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  108.266756][   T33] audit: type=1400 audit(1787859949.493:203): avc:  denied  { noatsecure } for  pid=5831 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  108.278795][   T33] audit: type=1400 audit(1787859949.493:204): avc:  denied  { rlimitinh } for  pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  108.289906][   T33] audit: type=1400 audit(1787859949.493:205): avc:  denied  { siginh } for  pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  111.477731][   T33] audit: type=1400 audit(1787859952.723:206): avc:  denied  { write } for  pid=5837 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  111.551787][   T33] audit: type=1400 audit(1787859952.803:207): avc:  denied  { write } for  pid=5840 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  111.696575][   T33] audit: type=1400 audit(1787859952.943:208): avc:  denied  { write } for  pid=5843 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  111.770139][   T33] audit: type=1400 audit(1787859953.023:209): avc:  denied  { write } for  pid=5846 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.423068][   T33] audit: type=1400 audit(1787859953.673:210): avc:  denied  { write } for  pid=5849 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.638631][   T33] audit: type=1400 audit(1787859953.883:211): avc:  denied  { write } for  pid=5853 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  113.917070][   T33] kauditd_printk_skb: 2 callbacks suppressed
[  113.917085][   T33] audit: type=1400 audit(1787859955.163:214): avc:  denied  { write } for  pid=5866 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.004139][   T33] audit: type=1400 audit(1787859955.253:215): avc:  denied  { write } for  pid=5869 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.138414][   T33] audit: type=1400 audit(1787859955.383:216): avc:  denied  { write } for  pid=5872 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.230406][   T33] audit: type=1400 audit(1787859955.473:217): avc:  denied  { write } for  pid=5875 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.808194][   T33] audit: type=1400 audit(1787859956.053:218): avc:  denied  { write } for  pid=5878 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.903890][   T33] audit: type=1400 audit(1787859956.153:219): avc:  denied  { write } for  pid=5881 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  115.037775][   T33] audit: type=1400 audit(1787859956.283:220): avc:  denied  { write } for  pid=5884 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  115.137120][   T33] audit: type=1400 audit(1787859956.383:221): avc:  denied  { write } for  pid=5887 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:55200' (ED25519) to the list of known hosts.
[-] Failed to sched_setaffinity (ignoring): Invalid argument
[+] open /sys/devices/system/cpu/cpu1/online successful.
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).
[+] close fd successful.
[+] mmap successful.
[+] pthread_create t0 successful.
[+] pthread_create t1 successful.
[+] thread0: faulted in page on CPU 0
[+] mlock successful.
[+] munmap successful.
[+] open /sys/devices/system/cpu/cpu1/online successful.
[  116.991378][   T22] process 5900 (syz-executor297) no longer affine to cpu1
[  117.048824][ T5898] smpboot: CPU 1 is now offline
[  117.053938][ T1107] kworker/u10:8 (1107) used greatest stack depth: 20032 bytes left
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).
[+] close fd successful.
[+] pthread_join t0 successful.
[+] pthread_join t1 successful.
[+] open /sys/devices/system/cpu/cpu1/online successful.
[  118.224653][ T5898] smpboot: Booting Node 1 Processor 1 APIC 0x1
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).
[+] close fd successful.
[+] Done
 OtherCrashReports:<nil> StraceOutput:/strace -e \!wait4,clock_nanosleep,nanosleep -s 100 -x -f /syz-executor2072235128

<...>
[   92.983278][   T35] kauditd_printk_skb: 10 callbacks suppressed
[   92.983291][   T35] audit: type=1400 audit(1787860068.954:201): avc:  denied  { transition } for  pid=5832 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[   92.992482][   T35] audit: type=1400 audit(1787860068.964:202): avc:  denied  { noatsecure } for  pid=5832 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[   92.998665][   T35] audit: type=1400 audit(1787860068.964:203): avc:  denied  { rlimitinh } for  pid=5832 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[   93.006487][   T35] audit: type=1400 audit(1787860068.964:204): avc:  denied  { siginh } for  pid=5832 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[   93.329573][ T1285] cfg80211: failed to load regulatory.db
[   95.852362][   T35] audit: type=1400 audit(1787860071.834:205): avc:  denied  { write } for  pid=5839 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   95.905168][   T35] audit: type=1400 audit(1787860071.884:206): avc:  denied  { write } for  pid=5842 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   96.010003][   T35] audit: type=1400 audit(1787860071.984:207): avc:  denied  { write } for  pid=5845 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   96.063658][   T35] audit: type=1400 audit(1787860072.044:208): avc:  denied  { write } for  pid=5849 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   96.126505][   T35] audit: type=1400 audit(1787860072.104:209): avc:  denied  { write } for  pid=5853 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   96.167170][   T35] audit: type=1400 audit(1787860072.144:210): avc:  denied  { write } for  pid=5858 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:9160' (ED25519) to the list of known hosts.
execve("/syz-executor2072235128", ["/syz-executor2072235128"], 0x7ffd86d041b0 /* 11 vars */) = 0
brk(NULL)                               = 0x55555637e000
brk(0x55555637ed80)                     = 0x55555637ed80
arch_prctl(ARCH_SET_FS, 0x55555637e400) = 0
set_tid_address(0x55555637e6d0)         = 5878
set_robust_list(0x55555637e6e0, 24)     = 0
rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
readlinkat(AT_FDCWD, "/proc/self/exe", "/syz-executor2072235128", 4096) = 23
getrandom("\xb5\x88\xdf\xb0\x71\x4e\xb5\x62", 8, GRND_NONBLOCK) = 8
brk(NULL)                               = 0x55555637ed80
brk(0x55555639fd80)                     = 0x55555639fd80
brk(0x5555563a0000)                     = 0x5555563a0000
mprotect(0x7f5336bc7000, 20480, PROT_READ) = 0
sched_setaffinity(0, 128, [2 3 4 5 6 7]) = -1 EINVAL (Invalid argument)
[-] Failed to sched_setaffinity (ignoring): Invalid argument
write(1, "[-] Failed to sched_setaffinity (ignoring): Invalid argument\n", 61) = 61
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/online", O_WRONLY) = 3
write(1, "[+] open /sys/devices/system/cpu/cpu1/online successful.", 56) = 56
[+] open /sys/devices/system/cpu/cpu1/online successful.
write(1, "\n", 1)                       = 1
write(3, "1\n", 2)                      = 2
write(1, "[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).", 78) = 78
write(1, "\n", 1)                       = 1
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).
close(3)                                = 0
write(1, "[+] close fd successful.", 24) = 24
write(1, "\n", 1)                       = 1
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5336af7000
[+] close fd successful.
write(1, "[+] mmap successful.", 20)    = 20
[+] mmap successful.
write(1, "\n", 1)                       = 1
rt_sigaction(SIGRT_1, {sa_handler=0x7f5336b52cb0, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f5336b415e0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f53362f6000
mprotect(0x7f53362f7000, 8388608, PROT_READ|PROT_WRITE) = 0
rt_sigprocmask(SIG_BLOCK, ~[], [], 8)   = 0
clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f5336af6990, parent_tid=0x7f5336af6990, exit_signal=0, stack=0x7f53362f6000, stack_size=0x8002c0, tls=0x7f5336af66c0} => {parent_tid=[5885]}, 88) = 5885
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
write(1, "[+] pthread_create t0 successful.", 33) = 33
/strace: Process 5885 attached
[pid  5878] write(1, "\n", 1)           = 1
[pid  5878] mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f5335af5000
[+] pthread_create t0 successful.
[pid  5878] mprotect(0x7f5335af6000, 8388608, PROT_READ|PROT_WRITE) = 0
[pid  5878] rt_sigprocmask(SIG_BLOCK, ~[] <unfinished ...>
[pid  5885] rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053 <unfinished ...>
[pid  5878] <... rt_sigprocmask resumed>, [], 8) = 0
[pid  5885] <... rseq resumed>)         = 0
[pid  5878] clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f53362f5990, parent_tid=0x7f53362f5990, exit_signal=0, stack=0x7f5335af5000, stack_size=0x8002c0, tls=0x7f53362f56c0} <unfinished ...>
[pid  5885] set_robust_list(0x7f5336af69a0, 24/strace: Process 5886 attached
) = 0
[pid  5878] <... clone3 resumed> => {parent_tid=[5886]}, 88) = 5886
[pid  5886] rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053 <unfinished ...>
[pid  5885] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid  5878] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid  5886] <... rseq resumed>)         = 0
[pid  5885] <... rt_sigprocmask resumed>, NULL, 8) = 0
[pid  5886] set_robust_list(0x7f53362f59a0, 24 <unfinished ...>
[pid  5885] sched_setaffinity(0, 128, [0] <unfinished ...>
[pid  5878] <... rt_sigprocmask resumed>, NULL, 8) = 0
[pid  5886] <... set_robust_list resumed>) = 0
[pid  5885] <... sched_setaffinity resumed>) = 0
[pid  5878] write(1, "[+] pthread_create t1 successful.", 33 <unfinished ...>
[pid  5886] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid  5878] <... write resumed>)        = 33
[pid  5886] <... rt_sigprocmask resumed>, NULL, 8) = 0
[+] pthread_create t1 successful.
[pid  5878] write(1, "\n", 1)           = 1
[pid  5886] sched_setaffinity(0, 128, [1]) = 0
[pid  5885] write(1, "[+] thread0: faulted in page on CPU 0", 37) = 37
[pid  5885] write(1, "\n", 1)           = 1
[+] thread0: faulted in page on CPU 0
[pid  5886] mlock(0x7f5336af7000, 4096) = 0
[pid  5886] write(1, "[+] mlock successful.", 21) = 21
[pid  5886] write(1, "\n", 1)           = 1
[pid  5886] munmap(0x7f5336af7000, 4096) = 0
[pid  5886] write(1, "[+] munmap successful.", 22) = 22
[pid  5886] write(1, "\n", 1)           = 1
[+] mlock successful.
[+] munmap successful.
[pid  5878] openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/online", O_WRONLY) = 3
[pid  5878] write(1, "[+] open /sys/devices/system/cpu/cpu1/online successful.", 56) = 56
[+] open /sys/devices/system/cpu/cpu1/online successful.
[pid  5878] write(1, "\n", 1)           = 1
[   97.984888][ T5878] smpboot: CPU 1 is now offline
[   98.033335][   T35] kauditd_printk_skb: 6 callbacks suppressed
[   98.033346][   T35] audit: type=1400 audit(1787860074.004:216): avc:  denied  { write } for  pid=5889 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).
[+] close fd successful.
[pid  5878] write(3, "0\n", 2)          = 2
[pid  5878] write(1, "[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).", 77) = 77
[pid  5878] write(1, "\n", 1)           = 1
[pid  5878] close(3)                    = 0
[pid  5878] write(1, "[+] close fd successful.", 24) = 24
[pid  5878] write(1, "\n", 1)           = 1
[   98.265841][   T35] audit: type=1400 audit(1787860074.244:217): avc:  denied  { write } for  pid=5893 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   98.396760][   T35] audit: type=1400 audit(1787860074.374:218): avc:  denied  { write } for  pid=5896 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   98.625325][   T35] audit: type=1400 audit(1787860074.594:219): avc:  denied  { write } for  pid=5899 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   98.747826][   T35] audit: type=1400 audit(1787860074.724:220): avc:  denied  { write } for  pid=5902 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[pid  5878] futex(0x7f5336af6990, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, 5885, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid  5885] rt_sigprocmask(SIG_BLOCK, ~[RT_1], NULL, 8) = 0
[pid  5885] madvise(0x7f53362f6000, 8372224, MADV_DONTNEED) = 0
[pid  5885] exit(0)                     = ?
[pid  5878] <... futex resumed>)        = 0
[pid  5885] +++ exited with 0 +++
[pid  5878] write(1, "[+] pthread_join t0 successful.", 31) = 31
[pid  5878] write(1, "\n", 1)           = 1
[+] pthread_join t0 successful.
[pid  5878] futex(0x7f53362f5990, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, 5886, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid  5886] rt_sigprocmask(SIG_BLOCK, ~[RT_1], NULL, 8) = 0
[pid  5886] madvise(0x7f5335af5000, 8372224, MADV_DONTNEED) = 0
[pid  5886] exit(0)                     = ?
[pid  5878] <... futex resumed>)        = 0
[pid  5878] write(1, "[+] pthread_join t1 successful.", 31) = 31
[pid  5878] write(1, "\n", 1)           = 1
[pid  5878] openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/online", O_WRONLY) = 3
[pid  5878] write(1, "[+] open /sys/devices/system/cpu/cpu1/online successful.", 56) = 56
[pid  5878] write(1, "\n", 1)           = 1
[+] pthread_join t1 successful.
[+] open /sys/devices/system/cpu/cpu1/online successful.
[   99.094110][ T5878] smpboot: Booting Node 1 Processor 1 APIC 0x1
[pid  5878] write(3, "1\n", 2 <unfinished ...>
[pid  5886] +++ exited with 0 +++
<... write resumed>)                    = 2
write(1, "[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).", 77) = 77
write(1, "\n", 1)                       = 1
close(3)                                = 0
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).
write(1, "[+] close fd successful.", 24) = 24
write(1, "\n", 1)                       = 1
write(1, "[+] Done", 8)                 = 8
write(1, "\n", 1)                       = 1
exit_group(0)                           = ?
+++ exited with 0 +++
[+] close fd successful.
[+] Done
 TestError:]

284/3 2026/08/27 19:48 action truncate-log
0m Results:
map[TruncatedConsoleOutput:[  108.236232][   T33] kauditd_printk_skb: 10 callbacks suppressed
[  108.236247][   T33] audit: type=1400 audit(1787859949.483:202): avc:  denied  { transition } for  pid=5831 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  108.266756][   T33] audit: type=1400 audit(1787859949.493:203): avc:  denied  { noatsecure } for  pid=5831 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  108.278795][   T33] audit: type=1400 audit(1787859949.493:204): avc:  denied  { rlimitinh } for  pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  108.289906][   T33] audit: type=1400 audit(1787859949.493:205): avc:  denied  { siginh } for  pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  111.477731][   T33] audit: type=1400 audit(1787859952.723:206): avc:  denied  { write } for  pid=5837 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  111.551787][   T33] audit: type=1400 audit(1787859952.803:207): avc:  denied  { write } for  pid=5840 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  111.696575][   T33] audit: type=1400 audit(1787859952.943:208): avc:  denied  { write } for  pid=5843 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  111.770139][   T33] audit: type=1400 audit(1787859953.023:209): avc:  denied  { write } for  pid=5846 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.423068][   T33] audit: type=1400 audit(1787859953.673:210): avc:  denied  { write } for  pid=5849 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.638631][   T33] audit: type=1400 audit(1787859953.883:211): avc:  denied  { write } for  pid=5853 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  113.917070][   T33] kauditd_printk_skb: 2 callbacks suppressed
[  113.917085][   T33] audit: type=1400 audit(1787859955.163:214): avc:  denied  { write } for  pid=5866 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.004139][   T33] audit: type=1400 audit(1787859955.253:215): avc:  denied  { write } for  pid=5869 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.138414][   T33] audit: type=1400 audit(1787859955.383:216): avc:  denied  { write } for  pid=5872 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.230406][   T33] audit: type=1400 audit(1787859955.473:217): avc:  denied  { write } for  pid=5875 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.808194][   T33] audit: type=1400 audit(1787859956.053:218): avc:  denied  { write } for  pid=5878 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.903890][   T33] audit: type=1400 audit(1787859956.153:219): avc:  denied  { write } for  pid=5881 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  115.037775][   T33] audit: type=1400 audit(1787859956.283:220): avc:  denied  { write } for  pid=5884 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  115.137120][   T33] audit: type=1400 audit(1787859956.383:221): avc:  denied  { write } for  pid=5887 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:55200' (ED25519) to the list of known hosts.
[-] Failed to sched_setaffinity (ignoring): Invalid argument
[+] open /sys/devices/system/cpu/cpu1/online successful.
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).
[+] close fd successful.
[+] mmap successful.
[+] pthread_create t0 successful.
[+] pthread_create t1 successful.
[+] thread0: faulted in page on CPU 0
[+] mlock successful.
[+] munmap successful.
[+] open /sys/devices/system/cpu/cpu1/online successful.
[  116.991378][   T22] process 5900 (syz-executor297) no longer affine to cpu1
[  117.048824][ T5898] smpboot: CPU 1 is now offline
[  117.053938][ T1107] kworker/u10:8 (1107) used greatest stack depth: 20032 bytes left
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).
[+] close fd successful.
[+] pthread_join t0 successful.
[+] pthread_join t1 successful.
[+] open /sys/devices/system/cpu/cpu1/online successful.
[  118.224653][ T5898] smpboot: Booting Node 1 Processor 1 APIC 0x1
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).
[+] close fd successful.
[+] Done
 TruncatedCrashReport:smpboot: CPU 1 is now offline
------------[ cut here ]------------
IS_ENABLED(CONFIG_PREEMPT_COUNT) && __lockdep_enabled && (preempt_count() == 0 && this_cpu_read(hardirqs_enabled))
WARNING: mm/vmstat.c:361 at __mod_zone_page_state+0xfc/0x140 mm/vmstat.c:361, CPU#0: syz-executor334/5899
Modules linked in:
CPU: 0 UID: 0 PID: 5899 Comm: syz-executor334 Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__mod_zone_page_state+0xfc/0x140 mm/vmstat.c:361
Code: c7 af 09 65 43 88 1c 34 5b 41 5c 41 5d 41 5e 41 5f 5d e9 c7 ac b2 09 cc 48 89 df 4c 89 fe 89 ea e8 59 00 00 00 31 db eb ce 90 <0f> 0b 90 eb 8b 48 c7 c7 40 d6 e6 8e 4c 89 f6 e8 30 2c fc 02 e9 34
RSP: 0000:ffffc9000354f890 EFLAGS: 00010202
RAX: 0000000000000001 RBX: ffffffffffffffff RCX: ffff888117054b00
RDX: ffffffffffffffff RSI: 0000000000000008 RDI: ffff88817fffc140
RBP: 0000000000000008 R08: ffffea00047ac9c7 R09: 1ffffd40008f5938
R10: dffffc0000000000 R11: fffff940008f5939 R12: ffffffff939bb700
R13: dffffc0000000000 R14: 0000000000000008 R15: ffff88817fffc140
FS:  000055557544d400(0000) GS:ffff8881a4c86000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055ef7c002388 CR3: 00000001867be000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 __zone_stat_mod_folio include/linux/vmstat.h:410 [inline]
 __munlock_folio mm/mlock.c:144 [inline]
 mlock_folio_batch+0x1a9c/0x3c00 mm/mlock.c:204
 page_alloc_cpu_dead+0x23/0x100 mm/page_alloc.c:6468
 cpuhp_invoke_callback+0x434/0x810 kernel/cpu.c:194
 __cpuhp_invoke_callback_range kernel/cpu.c:972 [inline]
 cpuhp_invoke_callback_range kernel/cpu.c:996 [inline]
 cpuhp_down_callbacks kernel/cpu.c:1386 [inline]
 _cpu_down+0x343/0x840 kernel/cpu.c:1457
 cpu_down_maps_locked kernel/cpu.c:1483 [inline]
 cpu_down kernel/cpu.c:1491 [inline]
 cpu_device_down+0x82/0xc0 kernel/cpu.c:1508
 device_offline+0x2d2/0x3c0 drivers/base/core.c:4283
 online_store+0x123/0x1a0 drivers/base/core.c:2883
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fae41a5a05e
Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
RSP: 002b:00007ffcba1a9468 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 000055557544d400 RCX: 00007fae41a5a05e
RDX: 0000000000000002 RSI: 00007fae41a9f0ff RDI: 0000000000000003
RBP: 00007fae41aa15e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fae41aa1578
R13: 00007fae41a9f09a R14: 00007fae41a9f0b9 R15: 0000000000000002
 </TASK>
 TruncatedStraceOutput:/strace -e \!wait4,clock_nanosleep,nanosleep -s 100 -x -f /syz-executor2072235128

<...>
[   92.983278][   T35] kauditd_printk_skb: 10 callbacks suppressed
[   92.983291][   T35] audit: type=1400 audit(1787860068.954:201): avc:  denied  { transition } for  pid=5832 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[   92.992482][   T35] audit: type=1400 audit(1787860068.964:202): avc:  denied  { noatsecure } for  pid=5832 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[   92.998665][   T35] audit: type=1400 audit(1787860068.964:203): avc:  denied  { rlimitinh } for  pid=5832 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[   93.006487][   T35] audit: type=1400 audit(1787860068.964:204): avc:  denied  { siginh } for  pid=5832 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[   93.329573][ T1285] cfg80211: failed to load regulatory.db
[   95.852362][   T35] audit: type=1400 audit(1787860071.834:205): avc:  denied  { write } for  pid=5839 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   95.905168][   T35] audit: type=1400 audit(1787860071.884:206): avc:  denied  { write } for  pid=5842 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   96.010003][   T35] audit: type=1400 audit(1787860071.984:207): avc:  denied  { write } for  pid=5845 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   96.063658][   T35] audit: type=1400 audit(1787860072.044:208): avc:  denied  { write } for  pid=5849 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   96.126505][   T35] audit: type=1400 audit(1787860072.104:209): avc:  denied  { write } for  pid=5853 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   96.167170][   T35] audit: type=1400 audit(1787860072.144:210): avc:  denied  { write } for  pid=5858 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:9160' (ED25519) to the list of known hosts.
execve("/syz-executor2072235128", ["/syz-executor2072235128"], 0x7ffd86d041b0 /* 11 vars */) = 0
brk(NULL)                               = 0x55555637e000
brk(0x55555637ed80)                     = 0x55555637ed80
arch_prctl(ARCH_SET_FS, 0x55555637e400) = 0
set_tid_address(0x55555637e6d0)         = 5878
set_robust_list(0x55555637e6e0, 24)     = 0
rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
readlinkat(AT_FDCWD, "/proc/self/exe", "/syz-executor2072235128", 4096) = 23
getrandom("\xb5\x88\xdf\xb0\x71\x4e\xb5\x62", 8, GRND_NONBLOCK) = 8
brk(NULL)                               = 0x55555637ed80
brk(0x55555639fd80)                     = 0x55555639fd80
brk(0x5555563a0000)                     = 0x5555563a0000
mprotect(0x7f5336bc7000, 20480, PROT_READ) = 0
sched_setaffinity(0, 128, [2 3 4 5 6 7]) = -1 EINVAL (Invalid argument)
[-] Failed to sched_setaffinity (ignoring): Invalid argument
write(1, "[-] Failed to sched_setaffinity (ignoring): Invalid argument\n", 61) = 61
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/online", O_WRONLY) = 3
write(1, "[+] open /sys/devices/system/cpu/cpu1/online successful.", 56) = 56
[+] open /sys/devices/system/cpu/cpu1/online successful.
write(1, "\n", 1)                       = 1
write(3, "1\n", 2)                      = 2
write(1, "[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).", 78) = 78
write(1, "\n", 1)                       = 1
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).
close(3)                                = 0
write(1, "[+] close fd successful.", 24) = 24
write(1, "\n", 1)                       = 1
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5336af7000
[+] close fd successful.
write(1, "[+] mmap successful.", 20)    = 20
[+] mmap successful.
write(1, "\n", 1)                       = 1
rt_sigaction(SIGRT_1, {sa_handler=0x7f5336b52cb0, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f5336b415e0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f53362f6000
mprotect(0x7f53362f7000, 8388608, PROT_READ|PROT_WRITE) = 0
rt_sigprocmask(SIG_BLOCK, ~[], [], 8)   = 0
clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f5336af6990, parent_tid=0x7f5336af6990, exit_signal=0, stack=0x7f53362f6000, stack_size=0x8002c0, tls=0x7f5336af66c0} => {parent_tid=[5885]}, 88) = 5885
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
write(1, "[+] pthread_create t0 successful.", 33) = 33
/strace: Process 5885 attached
[pid  5878] write(1, "\n", 1)           = 1
[pid  5878] mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f5335af5000
[+] pthread_create t0 successful.
[pid  5878] mprotect(0x7f5335af6000, 8388608, PROT_READ|PROT_WRITE) = 0
[pid  5878] rt_sigprocmask(SIG_BLOCK, ~[] <unfinished ...>
[pid  5885] rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053 <unfinished ...>
[pid  5878] <... rt_sigprocmask resumed>, [], 8) = 0
[pid  5885] <... rseq resumed>)         = 0
[pid  5878] clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f53362f5990, parent_tid=0x7f53362f5990, exit_signal=0, stack=0x7f5335af5000, stack_size=0x8002c0, tls=0x7f53362f56c0} <unfinished ...>
[pid  5885] set_robust_list(0x7f5336af69a0, 24/strace: Process 5886 attached
) = 0
[pid  5878] <... clone3 resumed> => {parent_tid=[5886]}, 88) = 5886
[pid  5886] rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053 <unfinished ...>
[pid  5885] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid  5878] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid  5886] <... rseq resumed>)         = 0
[pid  5885] <... rt_sigprocmask resumed>, NULL, 8) = 0
[pid  5886] set_robust_list(0x7f53362f59a0, 24 <unfinished ...>
[pid  5885] sched_setaffinity(0, 128, [0] <unfinished ...>
[pid  5878] <... rt_sigprocmask resumed>, NULL, 8) = 0
[pid  5886] <... set_robust_list resumed>) = 0
[pid  5885] <... sched_setaffinity resumed>) = 0
[pid  5878] write(1, "[+] pthread_create t1 successful.", 33 <unfinished ...>
[pid  5886] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid  5878] <... write resumed>)        = 33
[pid  5886] <... rt_sigprocmask resumed>, NULL, 8) = 0
[+] pthread_create t1 successful.
[pid  5878] write(1, "\n", 1)           = 1
[pid  5886] sched_setaffinity(0, 128, [1]) = 0
[pid  5885] write(1, "[+] thread0: faulted in page on CPU 0", 37) = 37
[pid  5885] write(1, "\n", 1)           = 1
[+] thread0: faulted in page on CPU 0
[pid  5886] mlock(0x7f5336af7000, 4096) = 0
[pid  5886] write(1, "[+] mlock successful.", 21) = 21
[pid  5886] write(1, "\n", 1)           = 1
[pid  5886] munmap(0x7f5336af7000, 4096) = 0
[pid  5886] write(1, "[+] munmap successful.", 22) = 22
[pid  5886] write(1, "\n", 1)           = 1
[+] mlock successful.
[+] munmap successful.
[pid  5878] openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/online", O_WRONLY) = 3
[pid  5878] write(1, "[+] open /sys/devices/system/cpu/cpu1/online successful.", 56) = 56
[+] open /sys/devices/system/cpu/cpu1/online successful.
[pid  5878] write(1, "\n", 1)           = 1
[   97.984888][ T5878] smpboot: CPU 1 is now offline
[   98.033335][   T35] kauditd_printk_skb: 6 callbacks suppressed
[   98.033346][   T35] audit: type=1400 audit(1787860074.004:216): avc:  denied  { write } for  pid=5889 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).
[+] close fd successful.
[pid  5878] write(3, "0\n", 2)          = 2
[pid  5878] write(1, "[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).", 77) = 77
[pid  5878] write(1, "\n", 1)           = 1
[pid  5878] close(3)                    = 0
[pid  5878] write(1, "[+] close fd successful.", 24) = 24
[pid  5878] write(1, "\n", 1)           = 1
[   98.265841][   T35] audit: type=1400 audit(1787860074.244:217): avc:  denied  { write } for  pid=5893 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   98.396760][   T35] audit: type=1400 audit(1787860074.374:218): avc:  denied  { write } for  pid=5896 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   98.625325][   T35] audit: type=1400 audit(1787860074.594:219): avc:  denied  { write } for  pid=5899 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   98.747826][   T35] audit: type=1400 audit(1787860074.724:220): avc:  denied  { write } for  pid=5902 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[pid  5878] futex(0x7f5336af6990, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, 5885, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid  5885] rt_sigprocmask(SIG_BLOCK, ~[RT_1], NULL, 8) = 0
[pid  5885] madvise(0x7f53362f6000, 8372224, MADV_DONTNEED) = 0
[pid  5885] exit(0)                     = ?
[pid  5878] <... futex resumed>)        = 0
[pid  5885] +++ exited with 0 +++
[pid  5878] write(1, "[+] pthread_join t0 successful.", 31) = 31
[pid  5878] write(1, "\n", 1)           = 1
[+] pthread_join t0 successful.
[pid  5878] futex(0x7f53362f5990, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, 5886, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid  5886] rt_sigprocmask(SIG_BLOCK, ~[RT_1], NULL, 8) = 0
[pid  5886] madvise(0x7f5335af5000, 8372224, MADV_DONTNEED) = 0
[pid  5886] exit(0)                     = ?
[pid  5878] <... futex resumed>)        = 0
[pid  5878] write(1, "[+] pthread_join t1 successful.", 31) = 31
[pid  5878] write(1, "\n", 1)           = 1
[pid  5878] openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/online", O_WRONLY) = 3
[pid  5878] write(1, "[+] open /sys/devices/system/cpu/cpu1/online successful.", 56) = 56
[pid  5878] write(1, "\n", 1)           = 1
[+] pthread_join t1 successful.
[+] open /sys/devices/system/cpu/cpu1/online successful.
[   99.094110][ T5878] smpboot: Booting Node 1 Processor 1 APIC 0x1
[pid  5878] write(3, "1\n", 2 <unfinished ...>
[pid  5886] +++ exited with 0 +++
<... write resumed>)                    = 2
write(1, "[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).", 77) = 77
write(1, "\n", 1)                       = 1
close(3)                                = 0
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).
write(1, "[+] close fd successful.", 24) = 24
write(1, "\n", 1)                       = 1
write(1, "[+] Done", 8)                 = 8
write(1, "\n", 1)                       = 1
exit_group(0)                           = ?
+++ exited with 0 +++
[+] close fd successful.
[+] Done
]

285/3 2026/08/27 19:48 agent repro-oracle
0m Model:
deep-reasoning

Results:
map[Feedback:The reproducer successfully triggered the expected crash. The crash signature matches the original bug description, with the same warning in `__mod_zone_page_state` triggered during CPU offline (`page_alloc_cpu_dead` -> `mlock_folio_batch` -> `__munlock_folio` -> `__zone_stat_mod_folio`). The warning indicates that `__mod_zone_page_state` is being called with preemption and interrupts enabled, which violates its constraints. The slight difference in the call trace (absence of `mlock_drain_remote`) is likely due to inlining or minor kernel version differences, but the root cause and the bug are identical. ProbePassed:false TerminalError: TitleMatches:true]

Instruction:
You are a security researcher with deep Linux kernel background.
Analyze the results of running the generated program.

=== CRITICAL ENVIRONMENT & TARGET CLASSIFICATION ===
Set 'TerminalError' to a descriptive error message ONLY if:
1. The execution failed due to missing hardware device nodes, subsystems, kernel modules, or privilege limits
   that cannot be loaded, created, or bypassed by user-space C code edits in the VM guest.
2. The target source files or functions described in the bug description do not exist in the checked-out codebase,
   meaning the codebase version is mismatched and the target code is absent.

=== CRITICAL PROHIBITIONS ===
- Do NOT classify a run as a terminal failure or assume a bug is fixed based on git log entries, commit titles,
  or commit messages. Reproducibility can ONLY be determined by executing reproducer candidates in the VM.
- Do NOT suggest C code strategies, repairs, or namespace bypasses when setting 'TerminalError'.


=== PHASE 2: BUG REPRODUCTION (EVALUATION) ===
The executed program was a full reproducer candidate attempting to trigger the target bug/crash.
Use this to guide your classification and feedback:
1. If a crash was triggered (Reproduced is true):
   - Determine if the triggered crash matches the expected bug.
   - If you conclude they represent the same underlying bug (the same root cause)
     despite different titles, crash signatures, or call traces, set TitleMatches
     to true and provide a detailed, technical, and verbose explanation of the
     equivalence in the 'Feedback' field.
   - If they do not represent the same bug (a completely unrelated crash/collision),
     set TitleMatches to false and explain the collision in 'Feedback'.
   - If they match exactly, set TitleMatches to true and provide a brief confirmation in 'Feedback'.
2. If the execution was successful (exit 0) WITHOUT a crash (Reproduced is false):
   - The reproduction attempt failed to trigger the bug. Analyze the console/strace output
     to understand why the bug did not trigger (e.g., timing, input arguments, environment setup)
     and provide feedback on how to improve the reproducer logic to trigger the crash.

Critical Diagnostic Rule for Reproduction Failures:
If the reproduction attempt fails (e.g., a system call returns an error, or a
warning/error message appears in the console log), you MUST:
1. Identify the failing system call from the execution trace or strace output.
2. Identify any corresponding warning or error messages in the console log.
3. Immediately search the kernel source tree for the warning message strings or
   the code of the failing system call/subsystem to locate the validation logic.
4. Trace the kernel's validation logic to diagnose the exact constraint violation
   or input mismatch in the generated program.
5. Provide a technical diagnosis in the feedback explaining the exact kernel constraint that was violated and why.

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:
Bug Description: WARNING in __mod_zone_page_state

smpboot: CPU 1 is now offline
------------[ cut here ]------------
IS_ENABLED(CONFIG_PREEMPT_COUNT) && __lockdep_enabled && (preempt_count() == 0 && this_cpu_read(hardirqs_enabled))
WARNING: mm/vmstat.c:361 at __mod_zone_page_state+0x96/0x190 mm/vmstat.c:361, CPU#0: syz.0.301/7156
Modules linked in:
CPU: 0 UID: 0 PID: 7156 Comm: syz.0.301 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__mod_zone_page_state+0x96/0x190 mm/vmstat.c:361
Code: d0 00 00 00 8b 05 7e 0b ed 0e 85 c0 74 1f 65 8b 05 e7 56 32 12 65 0b 05 30 10 32 12 75 0f 65 8b 05 33 52 32 12 85 c0 74 04 90 <0f> 0b 90 48 c7 c7 40 e3 ff 8b e8 9b 69 71 09 65 48 0f be 5d 00 48
RSP: 0000:ffffc900033ef8c0 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000000 RCX: 1ffffffff2289b6c
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88807ffd69b8
RBP: ffffffff948bfd88 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffffffffffffffff
R13: 0000000000000008 R14: ffff88807ffd6940 R15: ffffffff948bfd80
FS:  0000000000000000(0000) GS:ffff888096982000(0063) knlGS:00000000f5486b40
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000f5453ff4 CR3: 0000000053822000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 __zone_stat_mod_folio include/linux/vmstat.h:410 [inline]
 __munlock_folio mm/mlock.c:144 [inline]
 mlock_folio_batch+0xf97/0x36e0 mm/mlock.c:204
 mlock_drain_remote+0xe5/0x140 mm/mlock.c:230
 page_alloc_cpu_dead+0x16/0x130 mm/page_alloc.c:6468
 cpuhp_invoke_callback+0x3b4/0x9a0 kernel/cpu.c:194
 __cpuhp_invoke_callback_range+0x158/0x1d0 kernel/cpu.c:972
 cpuhp_invoke_callback_range kernel/cpu.c:996 [inline]
 cpuhp_down_callbacks kernel/cpu.c:1386 [inline]
 _cpu_down+0x523/0x1020 kernel/cpu.c:1457
 cpu_down_maps_locked kernel/cpu.c:1483 [inline]
 cpu_down kernel/cpu.c:1491 [inline]
 cpu_device_down+0x82/0xc0 kernel/cpu.c:1508
 device_offline drivers/base/core.c:4283 [inline]
 device_offline+0x2f4/0x400 drivers/base/core.c:4267
 online_store+0xd1/0x180 drivers/base/core.c:2883
 dev_attr_store+0x58/0x80 drivers/base/core.c:2509
 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x6af/0x1050 fs/read_write.c:687
 ksys_write+0x12a/0x250 fs/read_write.c:739
 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline]
 __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291
 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316
 entry_SYSENTER_compat_after_hwframe+0x84/0x8e
RIP: 0023:0xf7fc5fec
Code: Unable to access opcode bytes at 0xf7fc5fc2.
RSP: 002b:00000000f548650c EFLAGS: 00000292 ORIG_RAX: 0000000000000004
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000080000180
RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

IsProbe: false
Reproduced: true
Console Output: [  108.236232][   T33] kauditd_printk_skb: 10 callbacks suppressed
[  108.236247][   T33] audit: type=1400 audit(1787859949.483:202): avc:  denied  { transition } for  pid=5831 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  108.266756][   T33] audit: type=1400 audit(1787859949.493:203): avc:  denied  { noatsecure } for  pid=5831 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  108.278795][   T33] audit: type=1400 audit(1787859949.493:204): avc:  denied  { rlimitinh } for  pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  108.289906][   T33] audit: type=1400 audit(1787859949.493:205): avc:  denied  { siginh } for  pid=5831 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[  111.477731][   T33] audit: type=1400 audit(1787859952.723:206): avc:  denied  { write } for  pid=5837 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  111.551787][   T33] audit: type=1400 audit(1787859952.803:207): avc:  denied  { write } for  pid=5840 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  111.696575][   T33] audit: type=1400 audit(1787859952.943:208): avc:  denied  { write } for  pid=5843 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  111.770139][   T33] audit: type=1400 audit(1787859953.023:209): avc:  denied  { write } for  pid=5846 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.423068][   T33] audit: type=1400 audit(1787859953.673:210): avc:  denied  { write } for  pid=5849 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  112.638631][   T33] audit: type=1400 audit(1787859953.883:211): avc:  denied  { write } for  pid=5853 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  113.917070][   T33] kauditd_printk_skb: 2 callbacks suppressed
[  113.917085][   T33] audit: type=1400 audit(1787859955.163:214): avc:  denied  { write } for  pid=5866 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.004139][   T33] audit: type=1400 audit(1787859955.253:215): avc:  denied  { write } for  pid=5869 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.138414][   T33] audit: type=1400 audit(1787859955.383:216): avc:  denied  { write } for  pid=5872 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.230406][   T33] audit: type=1400 audit(1787859955.473:217): avc:  denied  { write } for  pid=5875 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.808194][   T33] audit: type=1400 audit(1787859956.053:218): avc:  denied  { write } for  pid=5878 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  114.903890][   T33] audit: type=1400 audit(1787859956.153:219): avc:  denied  { write } for  pid=5881 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  115.037775][   T33] audit: type=1400 audit(1787859956.283:220): avc:  denied  { write } for  pid=5884 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[  115.137120][   T33] audit: type=1400 audit(1787859956.383:221): avc:  denied  { write } for  pid=5887 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:55200' (ED25519) to the list of known hosts.
[-] Failed to sched_setaffinity (ignoring): Invalid argument
[+] open /sys/devices/system/cpu/cpu1/online successful.
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).
[+] close fd successful.
[+] mmap successful.
[+] pthread_create t0 successful.
[+] pthread_create t1 successful.
[+] thread0: faulted in page on CPU 0
[+] mlock successful.
[+] munmap successful.
[+] open /sys/devices/system/cpu/cpu1/online successful.
[  116.991378][   T22] process 5900 (syz-executor297) no longer affine to cpu1
[  117.048824][ T5898] smpboot: CPU 1 is now offline
[  117.053938][ T1107] kworker/u10:8 (1107) used greatest stack depth: 20032 bytes left
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).
[+] close fd successful.
[+] pthread_join t0 successful.
[+] pthread_join t1 successful.
[+] open /sys/devices/system/cpu/cpu1/online successful.
[  118.224653][ T5898] smpboot: Booting Node 1 Processor 1 APIC 0x1
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).
[+] close fd successful.
[+] Done

Strace Output: /strace -e \!wait4,clock_nanosleep,nanosleep -s 100 -x -f /syz-executor2072235128

<...>
[   92.983278][   T35] kauditd_printk_skb: 10 callbacks suppressed
[   92.983291][   T35] audit: type=1400 audit(1787860068.954:201): avc:  denied  { transition } for  pid=5832 comm="sshd-session" path="/bin/sh" dev="sda1" ino=90 scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[   92.992482][   T35] audit: type=1400 audit(1787860068.964:202): avc:  denied  { noatsecure } for  pid=5832 comm="sshd-session" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[   92.998665][   T35] audit: type=1400 audit(1787860068.964:203): avc:  denied  { rlimitinh } for  pid=5832 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[   93.006487][   T35] audit: type=1400 audit(1787860068.964:204): avc:  denied  { siginh } for  pid=5832 comm="sh" scontext=system_u:system_r:sshd_t tcontext=root:sysadm_r:sysadm_t tclass=process permissive=1
[   93.329573][ T1285] cfg80211: failed to load regulatory.db
[   95.852362][   T35] audit: type=1400 audit(1787860071.834:205): avc:  denied  { write } for  pid=5839 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   95.905168][   T35] audit: type=1400 audit(1787860071.884:206): avc:  denied  { write } for  pid=5842 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   96.010003][   T35] audit: type=1400 audit(1787860071.984:207): avc:  denied  { write } for  pid=5845 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   96.063658][   T35] audit: type=1400 audit(1787860072.044:208): avc:  denied  { write } for  pid=5849 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   96.126505][   T35] audit: type=1400 audit(1787860072.104:209): avc:  denied  { write } for  pid=5853 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   96.167170][   T35] audit: type=1400 audit(1787860072.144:210): avc:  denied  { write } for  pid=5858 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
Warning: Permanently added '[localhost]:9160' (ED25519) to the list of known hosts.
execve("/syz-executor2072235128", ["/syz-executor2072235128"], 0x7ffd86d041b0 /* 11 vars */) = 0
brk(NULL)                               = 0x55555637e000
brk(0x55555637ed80)                     = 0x55555637ed80
arch_prctl(ARCH_SET_FS, 0x55555637e400) = 0
set_tid_address(0x55555637e6d0)         = 5878
set_robust_list(0x55555637e6e0, 24)     = 0
rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
readlinkat(AT_FDCWD, "/proc/self/exe", "/syz-executor2072235128", 4096) = 23
getrandom("\xb5\x88\xdf\xb0\x71\x4e\xb5\x62", 8, GRND_NONBLOCK) = 8
brk(NULL)                               = 0x55555637ed80
brk(0x55555639fd80)                     = 0x55555639fd80
brk(0x5555563a0000)                     = 0x5555563a0000
mprotect(0x7f5336bc7000, 20480, PROT_READ) = 0
sched_setaffinity(0, 128, [2 3 4 5 6 7]) = -1 EINVAL (Invalid argument)
[-] Failed to sched_setaffinity (ignoring): Invalid argument
write(1, "[-] Failed to sched_setaffinity (ignoring): Invalid argument\n", 61) = 61
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/online", O_WRONLY) = 3
write(1, "[+] open /sys/devices/system/cpu/cpu1/online successful.", 56) = 56
[+] open /sys/devices/system/cpu/cpu1/online successful.
write(1, "\n", 1)                       = 1
write(3, "1\n", 2)                      = 2
write(1, "[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).", 78) = 78
write(1, "\n", 1)                       = 1
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).
close(3)                                = 0
write(1, "[+] close fd successful.", 24) = 24
write(1, "\n", 1)                       = 1
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5336af7000
[+] close fd successful.
write(1, "[+] mmap successful.", 20)    = 20
[+] mmap successful.
write(1, "\n", 1)                       = 1
rt_sigaction(SIGRT_1, {sa_handler=0x7f5336b52cb0, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f5336b415e0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f53362f6000
mprotect(0x7f53362f7000, 8388608, PROT_READ|PROT_WRITE) = 0
rt_sigprocmask(SIG_BLOCK, ~[], [], 8)   = 0
clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f5336af6990, parent_tid=0x7f5336af6990, exit_signal=0, stack=0x7f53362f6000, stack_size=0x8002c0, tls=0x7f5336af66c0} => {parent_tid=[5885]}, 88) = 5885
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
write(1, "[+] pthread_create t0 successful.", 33) = 33
/strace: Process 5885 attached
[pid  5878] write(1, "\n", 1)           = 1
[pid  5878] mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f5335af5000
[+] pthread_create t0 successful.
[pid  5878] mprotect(0x7f5335af6000, 8388608, PROT_READ|PROT_WRITE) = 0
[pid  5878] rt_sigprocmask(SIG_BLOCK, ~[] <unfinished ...>
[pid  5885] rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053 <unfinished ...>
[pid  5878] <... rt_sigprocmask resumed>, [], 8) = 0
[pid  5885] <... rseq resumed>)         = 0
[pid  5878] clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f53362f5990, parent_tid=0x7f53362f5990, exit_signal=0, stack=0x7f5335af5000, stack_size=0x8002c0, tls=0x7f53362f56c0} <unfinished ...>
[pid  5885] set_robust_list(0x7f5336af69a0, 24/strace: Process 5886 attached
) = 0
[pid  5878] <... clone3 resumed> => {parent_tid=[5886]}, 88) = 5886
[pid  5886] rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, __reserved=0}, 33, 0, 0x53053053 <unfinished ...>
[pid  5885] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid  5878] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid  5886] <... rseq resumed>)         = 0
[pid  5885] <... rt_sigprocmask resumed>, NULL, 8) = 0
[pid  5886] set_robust_list(0x7f53362f59a0, 24 <unfinished ...>
[pid  5885] sched_setaffinity(0, 128, [0] <unfinished ...>
[pid  5878] <... rt_sigprocmask resumed>, NULL, 8) = 0
[pid  5886] <... set_robust_list resumed>) = 0
[pid  5885] <... sched_setaffinity resumed>) = 0
[pid  5878] write(1, "[+] pthread_create t1 successful.", 33 <unfinished ...>
[pid  5886] rt_sigprocmask(SIG_SETMASK, [] <unfinished ...>
[pid  5878] <... write resumed>)        = 33
[pid  5886] <... rt_sigprocmask resumed>, NULL, 8) = 0
[+] pthread_create t1 successful.
[pid  5878] write(1, "\n", 1)           = 1
[pid  5886] sched_setaffinity(0, 128, [1]) = 0
[pid  5885] write(1, "[+] thread0: faulted in page on CPU 0", 37) = 37
[pid  5885] write(1, "\n", 1)           = 1
[+] thread0: faulted in page on CPU 0
[pid  5886] mlock(0x7f5336af7000, 4096) = 0
[pid  5886] write(1, "[+] mlock successful.", 21) = 21
[pid  5886] write(1, "\n", 1)           = 1
[pid  5886] munmap(0x7f5336af7000, 4096) = 0
[pid  5886] write(1, "[+] munmap successful.", 22) = 22
[pid  5886] write(1, "\n", 1)           = 1
[+] mlock successful.
[+] munmap successful.
[pid  5878] openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/online", O_WRONLY) = 3
[pid  5878] write(1, "[+] open /sys/devices/system/cpu/cpu1/online successful.", 56) = 56
[+] open /sys/devices/system/cpu/cpu1/online successful.
[pid  5878] write(1, "\n", 1)           = 1
[   97.984888][ T5878] smpboot: CPU 1 is now offline
[   98.033335][   T35] kauditd_printk_skb: 6 callbacks suppressed
[   98.033346][   T35] audit: type=1400 audit(1787860074.004:216): avc:  denied  { write } for  pid=5889 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).
[+] close fd successful.
[pid  5878] write(3, "0\n", 2)          = 2
[pid  5878] write(1, "[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).", 77) = 77
[pid  5878] write(1, "\n", 1)           = 1
[pid  5878] close(3)                    = 0
[pid  5878] write(1, "[+] close fd successful.", 24) = 24
[pid  5878] write(1, "\n", 1)           = 1
[   98.265841][   T35] audit: type=1400 audit(1787860074.244:217): avc:  denied  { write } for  pid=5893 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   98.396760][   T35] audit: type=1400 audit(1787860074.374:218): avc:  denied  { write } for  pid=5896 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   98.625325][   T35] audit: type=1400 audit(1787860074.594:219): avc:  denied  { write } for  pid=5899 comm="dhcpcd-run-hook" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[   98.747826][   T35] audit: type=1400 audit(1787860074.724:220): avc:  denied  { write } for  pid=5902 comm="rm" name="hook-state" dev="tmpfs" ino=1794 scontext=system_u:system_r:dhcpc_t tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=1
[pid  5878] futex(0x7f5336af6990, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, 5885, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid  5885] rt_sigprocmask(SIG_BLOCK, ~[RT_1], NULL, 8) = 0
[pid  5885] madvise(0x7f53362f6000, 8372224, MADV_DONTNEED) = 0
[pid  5885] exit(0)                     = ?
[pid  5878] <... futex resumed>)        = 0
[pid  5885] +++ exited with 0 +++
[pid  5878] write(1, "[+] pthread_join t0 successful.", 31) = 31
[pid  5878] write(1, "\n", 1)           = 1
[+] pthread_join t0 successful.
[pid  5878] futex(0x7f53362f5990, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, 5886, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid  5886] rt_sigprocmask(SIG_BLOCK, ~[RT_1], NULL, 8) = 0
[pid  5886] madvise(0x7f5335af5000, 8372224, MADV_DONTNEED) = 0
[pid  5886] exit(0)                     = ?
[pid  5878] <... futex resumed>)        = 0
[pid  5878] write(1, "[+] pthread_join t1 successful.", 31) = 31
[pid  5878] write(1, "\n", 1)           = 1
[pid  5878] openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/online", O_WRONLY) = 3
[pid  5878] write(1, "[+] open /sys/devices/system/cpu/cpu1/online successful.", 56) = 56
[pid  5878] write(1, "\n", 1)           = 1
[+] pthread_join t1 successful.
[+] open /sys/devices/system/cpu/cpu1/online successful.
[   99.094110][ T5878] smpboot: Booting Node 1 Processor 1 APIC 0x1
[pid  5878] write(3, "1\n", 2 <unfinished ...>
[pid  5886] +++ exited with 0 +++
<... write resumed>)                    = 2
write(1, "[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).", 77) = 77
write(1, "\n", 1)                       = 1
close(3)                                = 0
[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).
write(1, "[+] close fd successful.", 24) = 24
write(1, "\n", 1)                       = 1
write(1, "[+] Done", 8)                 = 8
write(1, "\n", 1)                       = 1
exit_group(0)                           = ?
+++ exited with 0 +++
[+] close fd successful.
[+] Done

Crash Report: smpboot: CPU 1 is now offline
------------[ cut here ]------------
IS_ENABLED(CONFIG_PREEMPT_COUNT) && __lockdep_enabled && (preempt_count() == 0 && this_cpu_read(hardirqs_enabled))
WARNING: mm/vmstat.c:361 at __mod_zone_page_state+0xfc/0x140 mm/vmstat.c:361, CPU#0: syz-executor334/5899
Modules linked in:
CPU: 0 UID: 0 PID: 5899 Comm: syz-executor334 Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__mod_zone_page_state+0xfc/0x140 mm/vmstat.c:361
Code: c7 af 09 65 43 88 1c 34 5b 41 5c 41 5d 41 5e 41 5f 5d e9 c7 ac b2 09 cc 48 89 df 4c 89 fe 89 ea e8 59 00 00 00 31 db eb ce 90 <0f> 0b 90 eb 8b 48 c7 c7 40 d6 e6 8e 4c 89 f6 e8 30 2c fc 02 e9 34
RSP: 0000:ffffc9000354f890 EFLAGS: 00010202
RAX: 0000000000000001 RBX: ffffffffffffffff RCX: ffff888117054b00
RDX: ffffffffffffffff RSI: 0000000000000008 RDI: ffff88817fffc140
RBP: 0000000000000008 R08: ffffea00047ac9c7 R09: 1ffffd40008f5938
R10: dffffc0000000000 R11: fffff940008f5939 R12: ffffffff939bb700
R13: dffffc0000000000 R14: 0000000000000008 R15: ffff88817fffc140
FS:  000055557544d400(0000) GS:ffff8881a4c86000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055ef7c002388 CR3: 00000001867be000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 __zone_stat_mod_folio include/linux/vmstat.h:410 [inline]
 __munlock_folio mm/mlock.c:144 [inline]
 mlock_folio_batch+0x1a9c/0x3c00 mm/mlock.c:204
 page_alloc_cpu_dead+0x23/0x100 mm/page_alloc.c:6468
 cpuhp_invoke_callback+0x434/0x810 kernel/cpu.c:194
 __cpuhp_invoke_callback_range kernel/cpu.c:972 [inline]
 cpuhp_invoke_callback_range kernel/cpu.c:996 [inline]
 cpuhp_down_callbacks kernel/cpu.c:1386 [inline]
 _cpu_down+0x343/0x840 kernel/cpu.c:1457
 cpu_down_maps_locked kernel/cpu.c:1483 [inline]
 cpu_down kernel/cpu.c:1491 [inline]
 cpu_device_down+0x82/0xc0 kernel/cpu.c:1508
 device_offline+0x2d2/0x3c0 drivers/base/core.c:4283
 online_store+0x123/0x1a0 drivers/base/core.c:2883
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fae41a5a05e
Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
RSP: 002b:00007ffcba1a9468 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 000055557544d400 RCX: 00007fae41a5a05e
RDX: 0000000000000002 RSI: 00007fae41a9f0ff RDI: 0000000000000003
RBP: 00007fae41aa15e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fae41aa1578
R13: 00007fae41a9f09a R14: 00007fae41a9f0b9 R15: 0000000000000002
 </TASK>



286/4 2026/08/27 19:48 llm repro-oracle
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 15931
							output: 174
							thoughts: 684
						

Thoughts:
**My Thoughts on Reproducing the Kernel Bug**

Alright, so the primary goal here is to confirm whether the program I generated actually manages to reproduce the kernel bug described. I've just executed the reproducer, and it seems to have done its job – it triggered a crash. The `IsProbe` flag is false, indicating this wasn't just a probe execution but a full-blown test, and `Reproduced` is true, which is exactly what I was aiming for.

Now, I need to meticulously compare the crash report I just received with the original bug description. Looking at it, the warning is `WARNING in __mod_zone_page_state`, and the call trace starts with `__zone_stat_mod_folio`, `__munlock_folio`, `mlock_folio_batch`, and then branches into `page_alloc_cpu_dead`, leading up to the CPU offline sequence (`cpuhp_invoke_callback`, `_cpu_down`, `cpu_device_down`, `device_offline`, `online_store`, `sysfs_kf_write` or `kernfs_fop_write_iter`, and finally `vfs_write`).

This new crash report aligns almost perfectly with the initial bug description. The only notable divergence is the absence of `mlock_drain_remote` in the latest trace. However, this isn't a cause for concern. It's very common for functions to be inlined or for minor kernel version changes to alter call stacks slightly. The fact that `mlock_folio_batch` is directly called from what appears to be the CPU offline path, and the subsequent functions (`__munlock_folio`, `__zone_stat_mod_folio`) are identical, strongly suggests this is indeed the same bug. It's essentially a variation in the preceding context, not a different underlying issue.

The core of the problem, as indicated by the warning itself, is that `__mod_zone_page_state` is being invoked under conditions it wasn't designed for. The critical part of the warning is `IS_ENABLED(CONFIG_PREEMPT_COUNT) && __lockdep_enabled && (preempt_count() == 0 && this_cpu_read(hardirqs_enabled))`. This condition highlights that the function expects to be called when preemption is disabled *and* interrupts are disabled, but it was evidently called with both preemption and interrupts enabled. This is precisely the scenario that should occur during the CPU offline process, where certain synchronization mechanisms might be expected to be in place.

Given this strong confirmation, I'm confident in setting `TitleMatches` to true. My feedback to the user will clearly state that the reproducer was successful, the crash signature matches the original bug, and the slight call trace variation is insignificant. I'll emphasize that the warning and the suspected cause – `__mod_zone_page_state` being called with preemption and interrupts enabled during CPU offline – remain the core of the issue.

Now, I just need to execute the `set-results` command to finalize this.


287/4 2026/08/27 19:48 tool set-results
0m Args:
map[Feedback:The reproducer successfully triggered the expected crash. The crash signature matches the original bug description, with the same warning in `__mod_zone_page_state` triggered during CPU offline (`page_alloc_cpu_dead` -> `mlock_folio_batch` -> `__munlock_folio` -> `__zone_stat_mod_folio`). The warning indicates that `__mod_zone_page_state` is being called with preemption and interrupts enabled, which violates its constraints. The slight difference in the call trace (absence of `mlock_drain_remote`) is likely due to inlining or minor kernel version differences, but the root cause and the bug are identical. ProbePassed:false TerminalError: TitleMatches:true]

Results:
map[Feedback:The reproducer successfully triggered the expected crash. The crash signature matches the original bug description, with the same warning in `__mod_zone_page_state` triggered during CPU offline (`page_alloc_cpu_dead` -> `mlock_folio_batch` -> `__munlock_folio` -> `__zone_stat_mod_folio`). The warning indicates that `__mod_zone_page_state` is being called with preemption and interrupts enabled, which violates its constraints. The slight difference in the call trace (absence of `mlock_drain_remote`) is likely due to inlining or minor kernel version differences, but the root cause and the bug are identical. ProbePassed:false TerminalError: TitleMatches:true]

288/3 2026/08/27 19:48 action loop-controller
0m Results:
map[CapabilitiesVerified:true ContinueSignal: EquivalenceAnalysis:The reproducer successfully triggered the expected crash. The crash signature matches the original bug description, with the same warning in `__mod_zone_page_state` triggered during CPU offline (`page_alloc_cpu_dead` -> `mlock_folio_batch` -> `__munlock_folio` -> `__zone_stat_mod_folio`). The warning indicates that `__mod_zone_page_state` is being called with preemption and interrupts enabled, which violates its constraints. The slight difference in the call trace (absence of `mlock_drain_remote`) is likely due to inlining or minor kernel version differences, but the root cause and the bug are identical. OracleFeedback:The reproducer successfully triggered the expected crash. The crash signature matches the original bug description, with the same warning in `__mod_zone_page_state` triggered during CPU offline (`page_alloc_cpu_dead` -> `mlock_folio_batch` -> `__munlock_folio` -> `__zone_stat_mod_folio`). The warning indicates that `__mod_zone_page_state` is being called with preemption and interrupts enabled, which violates its constraints. The slight difference in the call trace (absence of `mlock_drain_remote`) is likely due to inlining or minor kernel version differences, but the root cause and the bug are identical. ReproC:// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

// IMPORTANT: Do not copy the macros or definitions below directly into your reproducer.
// Instead, add the following line to your reproducer:
// #include "race_toolkit.h"

// --- Race Condition Toolkit ---
// Macros and snippets for CPU pinning, memory barriers, and userfaultfd.

#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>

// Unbuffered I/O: Ensure logs are written immediately.
#define SETUP_UNBUFFERED_IO() setvbuf(stdout, NULL, _IONBF, 0)

// CPU Pinning: Pin the current thread to a specific CPU core.
#define PIN_TO_CPU(cpu)                                                \
	do {                                                           \
		cpu_set_t mask;                                        \
		CPU_ZERO(&mask);                                       \
		CPU_SET(cpu, &mask);                                   \
		if (sched_setaffinity(0, sizeof(mask), &mask) == -1) { \
			perror("sched_setaffinity");                   \
		}                                                      \
	} while (0)

// Memory Barrier: Ensure memory ordering.
#define MB() __atomic_thread_fence(__ATOMIC_SEQ_CST)

// Spin-wait Barrier: Wait until a memory location has a specific value.
// Best for tight race windows (low latency, no context switches).
#define WAIT_ON(addr, val)                                               \
	do {                                                             \
		while (__atomic_load_n(addr, __ATOMIC_ACQUIRE) != (val)) \
			;                                                \
	} while (0)

// Signal: Set a memory location to a specific value to release a WAIT_ON.
#define SIGNAL(addr, val) __atomic_store_n(addr, val, __ATOMIC_RELEASE)

// --- Timing Primitives ---
// Robust timing loops in VM environments (using CLOCK_MONOTONIC to avoid time(NULL) jumps).

static inline double timer_elapsed_sec(struct timespec* start)
{
	struct timespec now;
	if (clock_gettime(CLOCK_MONOTONIC, &now) == -1) {
		perror("clock_gettime(CLOCK_MONOTONIC) elapsed");
		exit(1);
	}
	return (double)(now.tv_sec - start->tv_sec) + (double)(now.tv_nsec - start->tv_nsec) / 1e9;
}

// Initialize a monotonic timer variable.
#define TIMER_START(t)                                          \
	struct timespec t;                                      \
	if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) {         \
		perror("clock_gettime(CLOCK_MONOTONIC) start"); \
		exit(1);                                        \
	}

// Check if the elapsed time since 't' is less than 'sec' seconds.
#define TIMER_NOT_EXPIRED(t, sec) (timer_elapsed_sec(&(t)) < (double)(sec))

// Futex-based Event: Shared with syzkaller executor.
// Best for general synchronization or longer waits to save CPU.
typedef struct {
	int state;
} event_t;

static void event_init(event_t* ev)
{
	ev->state = 0;
}
static void event_reset(event_t* ev)
{
	ev->state = 0;
}

static void event_set(event_t* ev)
{
	if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) {
		fprintf(stderr, "event already set\n");
		exit(1);
	}
	__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
	syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}

static void event_wait(event_t* ev)
{
	while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
		syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}

// userfaultfd setup: Register a memory range for page fault handling.
static int setup_uffd(void* addr, size_t len)
{
	int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
	if (uffd == -1)
		return -1;
	struct uffdio_api api = {.api = UFFD_API, .features = 0};
	if (ioctl(uffd, UFFDIO_API, &api) == -1) {
		close(uffd);
		return -1;
	}
	struct uffdio_register reg = {
	    .range = {.start = (uintptr_t)addr, .len = len},
	    .mode = UFFDIO_REGISTER_MODE_MISSING};
	if (ioctl(uffd, UFFDIO_REGISTER, &reg) == -1) {
		close(uffd);
		return -1;
	}
	return uffd;
}

// --- Guidance on Usage ---
// 1. Use WAIT_ON/SIGNAL for tight race conditions to avoid scheduling overhead.
// 2. Use event_t (futexes) for general coordination or when waiting for longer periods.
// 3. Always use PIN_TO_CPU to increase race probability on multi-core systems.
// 4. Use setup_uffd to register a memory range for page fault handling. This allows you to
//    pause a thread accessing that memory until you handle the fault, creating a reliable
//    and controllable race window.
// 5. Call SETUP_UNBUFFERED_IO() at the start of main() to ensure that logs are printed
//    immediately. This is essential for understanding the exact interleaving of events
//    when debugging race conditions.
// 6. For timing-based loops (e.g., running a race for 10 seconds), do NOT use time(NULL)
//    or loops relying on real-time clocks, as VM clocks are highly unreliable and can fail or drift.
//    Instead, use the robust monotonic timing primitives TIMER_START and TIMER_NOT_EXPIRED:
//        TIMER_START(start);
//        while (TIMER_NOT_EXPIRED(start, 10.0)) {
//            // Your race logic here
//        }

#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

volatile int step = 0;
void *addr;

void *thread0(void *arg) {
    PIN_TO_CPU(0);
    
    WAIT_ON(&step, 1);
    
    // Fault in the page on CPU 0.
    // It gets added to CPU 0's lru_add batch, but not yet on the LRU list.
    *(volatile char *)addr = 1;
    printf("[+] thread0: faulted in page on CPU 0\n");
    
    SIGNAL(&step, 2);
    
    // Spin to prevent CPU 0 from draining its lru_add batch.
    WAIT_ON(&step, 5);
    
    return NULL;
}

void *thread1(void *arg) {
    PIN_TO_CPU(1);
    
    WAIT_ON(&step, 2);
    
    // mlock the page on CPU 1.
    // It adds the page to CPU 1's mlock_fbatch with LRU_FOLIO, then drains it.
    // __mlock_folio sees the page is not on LRU (still in CPU 0's batch) and does nothing.
    int res = mlock(addr, 4096);
    if (res < 0) {
        printf("[-] Failed to mlock: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] mlock successful.\n");
    
    // munmap the page on CPU 1.
    // Since the VMA is locked, it calls munlock_vma_folio, which adds the page
    // to CPU 1's mlock_fbatch with NO flags. munmap does not drain the batch.
    res = munmap(addr, 4096);
    if (res < 0) {
        printf("[-] Failed to munmap: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] munmap successful.\n");
    
    SIGNAL(&step, 3);
    
    // Sleep until the test finishes.
    WAIT_ON(&step, 5);
    
    return NULL;
}

int main() {
    SETUP_UNBUFFERED_IO();
    
    // Pin main thread to CPU 2+ to avoid interfering with CPU 0 and 1.
    // If CPU 2 is not available, it will just fail and run anywhere.
    cpu_set_t set;
    CPU_ZERO(&set);
    for (int i = 2; i < 8; i++) {
        CPU_SET(i, &set);
    }
    int res = sched_setaffinity(0, sizeof(set), &set);
    if (res < 0) {
        printf("[-] Failed to sched_setaffinity (ignoring): %s\n", strerror(errno));
    } else {
        printf("[+] sched_setaffinity successful.\n");
    }
    
    // Ensure CPU 1 is online initially.
    int fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "1\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 is online).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    if (addr == MAP_FAILED) {
        printf("[-] Failed to mmap: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] mmap successful.\n");
    
    pthread_t t0, t1;
    res = pthread_create(&t0, NULL, thread0, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_create t0: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_create t0 successful.\n");
    
    res = pthread_create(&t1, NULL, thread1, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_create t1: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_create t1 successful.\n");
    
    SIGNAL(&step, 1);
    
    WAIT_ON(&step, 3);
    
    // Offline CPU 1.
    // This triggers page_alloc_cpu_dead -> mlock_drain_remote on a surviving CPU.
    // mlock_drain_remote calls __munlock_folio, which sees the page is not on LRU,
    // skips taking the LRU lock, and calls __zone_stat_mod_folio with preemption enabled,
    // triggering the warning.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "0\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 offlined).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    // Wait a bit to ensure the asynchronous warning is triggered and printed.
    sleep(1);
    
    SIGNAL(&step, 5);
    
    res = pthread_join(t0, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_join t0: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_join t0 successful.\n");
    
    res = pthread_join(t1, NULL);
    if (res != 0) {
        printf("[-] Failed to pthread_join t1: %s\n", strerror(res));
        exit(1);
    }
    printf("[+] pthread_join t1 successful.\n");
    
    // Restore CPU 1.
    fd = open("/sys/devices/system/cpu/cpu1/online", O_WRONLY);
    if (fd < 0) {
        printf("[-] Failed to open /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] open /sys/devices/system/cpu/cpu1/online successful.\n");
    
    res = write(fd, "1\n", 2);
    if (res < 0) {
        printf("[-] Failed to write to /sys/devices/system/cpu/cpu1/online: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] write to /sys/devices/system/cpu/cpu1/online successful (CPU 1 restored).\n");
    
    res = close(fd);
    if (res < 0) {
        printf("[-] Failed to close fd: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] close fd successful.\n");
    
    printf("[+] Done\n");
    return 0;
} Reproduced:true ReproducedBugTitle:WARNING in __mod_zone_page_state ReproducedCrashReport:smpboot: CPU 1 is now offline
------------[ cut here ]------------
IS_ENABLED(CONFIG_PREEMPT_COUNT) && __lockdep_enabled && (preempt_count() == 0 && this_cpu_read(hardirqs_enabled))
WARNING: mm/vmstat.c:361 at __mod_zone_page_state+0xfc/0x140 mm/vmstat.c:361, CPU#0: syz-executor334/5899
Modules linked in:
CPU: 0 UID: 0 PID: 5899 Comm: syz-executor334 Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__mod_zone_page_state+0xfc/0x140 mm/vmstat.c:361
Code: c7 af 09 65 43 88 1c 34 5b 41 5c 41 5d 41 5e 41 5f 5d e9 c7 ac b2 09 cc 48 89 df 4c 89 fe 89 ea e8 59 00 00 00 31 db eb ce 90 <0f> 0b 90 eb 8b 48 c7 c7 40 d6 e6 8e 4c 89 f6 e8 30 2c fc 02 e9 34
RSP: 0000:ffffc9000354f890 EFLAGS: 00010202
RAX: 0000000000000001 RBX: ffffffffffffffff RCX: ffff888117054b00
RDX: ffffffffffffffff RSI: 0000000000000008 RDI: ffff88817fffc140
RBP: 0000000000000008 R08: ffffea00047ac9c7 R09: 1ffffd40008f5938
R10: dffffc0000000000 R11: fffff940008f5939 R12: ffffffff939bb700
R13: dffffc0000000000 R14: 0000000000000008 R15: ffff88817fffc140
FS:  000055557544d400(0000) GS:ffff8881a4c86000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055ef7c002388 CR3: 00000001867be000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 __zone_stat_mod_folio include/linux/vmstat.h:410 [inline]
 __munlock_folio mm/mlock.c:144 [inline]
 mlock_folio_batch+0x1a9c/0x3c00 mm/mlock.c:204
 page_alloc_cpu_dead+0x23/0x100 mm/page_alloc.c:6468
 cpuhp_invoke_callback+0x434/0x810 kernel/cpu.c:194
 __cpuhp_invoke_callback_range kernel/cpu.c:972 [inline]
 cpuhp_invoke_callback_range kernel/cpu.c:996 [inline]
 cpuhp_down_callbacks kernel/cpu.c:1386 [inline]
 _cpu_down+0x343/0x840 kernel/cpu.c:1457
 cpu_down_maps_locked kernel/cpu.c:1483 [inline]
 cpu_down kernel/cpu.c:1491 [inline]
 cpu_device_down+0x82/0xc0 kernel/cpu.c:1508
 device_offline+0x2d2/0x3c0 drivers/base/core.c:4283
 online_store+0x123/0x1a0 drivers/base/core.c:2883
 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x612/0xba0 fs/read_write.c:687
 ksys_write+0x150/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fae41a5a05e
Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
RSP: 002b:00007ffcba1a9468 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 000055557544d400 RCX: 00007fae41a5a05e
RDX: 0000000000000002 RSI: 00007fae41a9f0ff RDI: 0000000000000003
RBP: 00007fae41aa15e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fae41aa1578
R13: 00007fae41a9f09a R14: 00007fae41a9f0b9 R15: 0000000000000002
 </TASK>
]

289/1 2026/08/27 19:48 action save-repro-c
0m Results:
map[]

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)