[FEATURE] nvidia-open: carry NVIDIA PR #1525 (order-3 kzalloc in nv_drm_atomic_state_alloc invokes the OOM killer)

Open
#1,134 0 comments 0 reactions 2 assignees View on GitHub

@ptr1337 is already working on this.

Since Nov 6, 2026.

Assessment

This issue has not been assessed yet.

Description

enhancement
Pre-flight checklist
  • I have searched existing issues/PRs and this has not been requested before.
  • I have read the Contributing Guidelines.
Request type
  • New patch / patchset inclusion
  • Kernel config change (enable/disable option)
  • New kernel variant
  • Scheduler tuning / addition
  • Compiler / LTO / PGO optimization
  • Security hardening
  • Driver or hardware enablement
  • Other
Summary

Please carry NVIDIA/open-gpu-kernel-modules#1525 in linux-cachyos-nvidia-open (kernel-patches misc/nvidia/) and nvidia-open-dkms (CachyOS-PKGBUILDS nvidia/nvidia-utils/) until NVIDIA ships it. It allocates the atomic state in nv_drm_atomic_state_alloc() with kvzalloc/kvfree instead of kzalloc, so the allocation falls back to vmalloc when no order-3 block is free. 620.70.06, which CachyOS-PKGBUILDS already moved to, still has the same kzalloc path.

Replaces #1132, which I filed with the bug template.

Motivation / use case

nv_drm_atomic_state_alloc() allocates 16,744 bytes with kzalloc(GFP_KERNEL) (order 3), called from drm_mode_atomic_ioctl (Hyprland) or nv_drm_revoke_modeset_permission (Electron closing its DRM file). When no order-3 block can be found, the allocator invokes the OOM killer although file cache and swap remain, killing desktop processes including noctalia (shell), pipewire, wireplumber, xdg-desktop-portal, Electron apps and the browser. All 66 OOM-killer runs in my journal (6 boots, linux-cachyos 7.2.11 to 7.3.1-1) are this call; in 59 of them, as below, neither DMA32 nor Normal has a free block of 32 kB or larger. There is no on-demand trigger; it comes in bursts with Hyprland on the NVIDIA GPU.

Hyprland invoked oom-killer: gfp_mask=0x40dc0(GFP_KERNEL|__GFP_ZERO|__GFP_COMP), order=3, oom_score_adj=0
…
 out_of_memory+0x4ab/0x5f0
 __alloc_pages_slowpath+0xeb6/0x1790
…
 __kmalloc_noprof+0x27f/0x380
…
 nv_drm_atomic_state_alloc+0x20/0x60 [nvidia_drm 63853839a1240a08ba38014d126a5909887d85b8]
 drm_mode_atomic_ioctl+0x12a/0x740
…
Node 0 Normal free:66912kB boost:0kB min:59796kB low:74744kB high:89692kB … inactive_file:3470772kB …
…
Node 0 DMA32: 3134*4kB (UME) 3112*8kB (UME) 1508*16kB (UME) 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 61560kB
Node 0 Normal: 4465*4kB (UME) 837*8kB (UME) 2297*16kB (UME) 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 61308kB
…
Free swap  = 26551780kB
Patch / upstream reference (if available)

Proposed fix: https://github.com/NVIDIA/open-gpu-kernel-modules/pull/1525 (open)
Upstream report: https://github.com/NVIDIA/open-gpu-kernel-modules/issues/1516 (stock Fedora 7.2.13, open)

Testing / benchmarks

Not built or run with the patch. It applies to the 615.78.08 and 620.70.06 sources without fuzz, and CachyOS's NVIDIA patches touch other files.

objdump -dr --disassemble=nv_drm_atomic_state_alloc on the shipped module shows mov $0x1,%edi, mov $0x4168,%esi and a call to nv_drm_calloc, which returns kzalloc(nmemb * size, GFP_KERNEL).

Additional context

CONFIG_CACHY=y sets vm.compaction_proactiveness and vm.watermark_boost_factor to 0 (upstream: 20 and 15000), disabling background compaction and watermark boosting; boosting exists "to increase the success rate of future high-order allocations such as SLUB allocations" (Documentation/admin-guide/sysctl/vm.rst). So CachyOS kernels may hit this more often; untested.

RTX 3070 Laptop with the MUX on dGPU (supergfxctl -g: AsusMuxDgpu), MemTotal 14.9 GiB, Hyprland 0.57.1, linux-cachyos 7.3.1-1. cachyos-bugreport.sh: https://paste.cachyos.org/p/fd8fccc.log

Dominant language
Shell
Stars
4.9k
Forks
190
Avg merge
1d 3h
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CachyOS/linux-cachyos

All issues in CachyOS/linux-cachyos

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.