64-byte os_alloc_mem leak in reusemappingdbMap (kbusMapFbAperture) survives client exit (595.99.02)

オープン
#1,619 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c, linux

調査の方向性

Start by tracing reusemappingdbMap and kbusMapFbAperture_GM107 in the kernel module sources, then follow the allocation and cleanup paths shown in the issue’s stack trace. Reproduce with the listed headless Chromium or vulkaninfo workload and compare surviving 64-byte allocations after client exit. Done means the allocations are released and repeated runs return the slab count to baseline.

索引モデルが issue の本文から書いたものです。

説明

Note: This issue was written by my clanker. While I try to verify its steps as much as possible, it might not be 100% correct.


Summary

Each short-lived Vulkan client that maps video memory to the CPU leaves 64-byte os_alloc_mem allocations behind
after it exits. They are inserted by reusemappingdbMap under kbusMapFbAperture_GM107 and are never freed, so they
accumulate in kmalloc-64 (SUnreclaim) until a reboot.

Environment

  • GPU: NVIDIA GeForce RTX 4090 (AD102)
  • Driver: NVIDIA open kernel modules 595.99.02 (nvidia-driver-595-open, Ubuntu 24.04)
  • Kernel: 7.0.0-44-generic, CONFIG_RANDOM_KMALLOC_CACHES=y
  • Desktop: X11 (Cinnamon); the clients below are headless and use no display
  • Client: headless Chromium (Playwright chrome-headless-shell), --use-angle=vulkan --enable-gpu, drawing WebGL2

Evidence

A bpftrace window of 30 minutes remembered every 64-byte kmalloc by pointer, with its process and kernel stack, and
forgot it at its kfree. Survivors whose process had exited by the end of the window cannot be freed by anyone:

551 survivors, 539 of them from exited chrome-headless processes
    __kmalloc_noprof+655
    os_alloc_mem+213
    _portMemAllocNonPagedUntracked+44
    _portMemAllocatorAlloc+43
    mapInsertNew_IMPL+44
    reusemappingdbMap+811
    kbusMapFbAperture_GM107+712
    memMap_IMPL+2134
    serverMap+781
    rmapiMapToCpuWithSecInfoV2+422
    rmapiMapToCpuWithSecInfoTlsV2+100
    Nv04MapMemoryWithSecInfo+105

A separate perf measurement (every 64-byte kmalloc, kfree and fork, attributed to the workload's own process tree,
5 s after it exits) shows the same per launch: 10 headless Chromium launches drawing 60 WebGL frames each left 11
os_alloc_mem objects; 30 vulkaninfo --summary runs left 11 as well.

Reproducer

  1. Launch headless Chromium with --use-angle=vulkan --enable-gpu --enable-features=Vulkan --ignore-gpu-blocklist.
  2. Draw a WebGL2 canvas for 60 frames, then close the browser.
  3. Repeat; count 64-byte kmalloc objects (sum of kmalloc-64 and every kmalloc-rnd-*-64 in /proc/slabinfo).
  4. The count does not return to its baseline; the surviving allocations carry the stack above.

Impact

Small per client (one or a few 64-byte objects per launch), but unbounded: CI machines and test suites that launch
GPU browsers thousands of times a day accumulate it in unreclaimable slab until a reboot.

主要言語
C
スター
17.7k
フォーク
2k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA/open-gpu-kernel-modules のほかの issue

NVIDIA/open-gpu-kernel-modules の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。