From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Mirian Shilakadze <mirian.shilakadze@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 0/1] drm/amdgpu: fix init ordering in amdgpu_vram_mgr_init()
Date: Thu, 12 Nov 2026 14:31:47 +0100 [thread overview]
Message-ID: <179449030752.4060562.15667236530704998805.b4-review@b4> (raw)
In-Reply-To: <20261106145524.96305-1-mirian.shilakadze@virtuozzo.com>
Applying as is.
On Fri, 06 Nov 2026 18:55:18 +0400, Mirian Shilakadze wrote:
> Thomas Hellström (1):
> ms/drm/amdgpu: Fix init ordering in amdgpu_vram_mgr_init()
Thanks. Your reading of the probe path is right: a failed GMC sw_init
never reaches amdgpu_ttm_fini(), so the crash cannot happen here.
Separate patches, not needed for this one; I created a task for
each:
1. amdgpu_vram_mgr_init(): free the buddy allocator when
drmm_cgroup_register_region() fails, call drm_buddy_fini(&mgr->mm)
before "return PTR_ERR(man->cg);".
Why: the registration now runs after drm_buddy_init(), and with no
teardown on that path an -ENOMEM at probe leaks the buddy memory.
Upstream added the same call in bd4f284df04d ("drm/amdgpu: Wire up
dmem cgroup reclaim for VRAM manager"), the reclaim wiring we did
not take.
https://virtuozzo.atlassian.net/browse/VSTOR-154845
2. Backport 7d0507772406 ("drm/buddy: release free_trees array on buddy
mm teardown").
Why: our drm_buddy_fini() frees each free tree but not the
free_trees array itself, so every amdgpu or xe unload leaks it.
https://virtuozzo.atlassian.net/browse/VSTOR-154850
3. amdgpu_ttm_init() and gmc_v*_sw_init(): undo ttm_device_init() on
the error paths after it. Fix it upstream first (amd-gfx), then
backport.
Why: a probe that fails after ttm_device_init() (a VRAM or GTT heap
error, gart_init, -ENOMEM) never reaches ttm_device_fini(), because
sw_fini is skipped for a block whose sw_init failed. The bdev stays
on the TTM global device list while adev is freed with the failed
probe, and the next TTM swapout or ttm_device_init() of another GPU
walks into freed memory. Mainline has the same code.
https://virtuozzo.atlassian.net/browse/VSTOR-154875
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-12 13:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 14:55 Mirian Shilakadze
2026-11-06 14:55 ` [Devel] [PATCH hci-8.1 1/1] ms/drm/amdgpu: Fix " Mirian Shilakadze
2026-11-06 15:00 ` no-reply
2026-11-12 13:31 ` Konstantin Khorenko
2026-11-12 13:31 ` Konstantin Khorenko [this message]
2026-11-12 13:32 ` [Devel] [PATCH hci-8.1 0/1] drm/amdgpu: fix " Konstantin Khorenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179449030752.4060562.15667236530704998805.b4-review@b4 \
--to=khorenko@virtuozzo.com \
--cc=devel@openvz.org \
--cc=mirian.shilakadze@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.