All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
To: Mirian Shilakadze <mirian.shilakadze@virtuozzo.com>,
	khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 0/6] cgroup/dmem: backport fixes and apply a lower dmem.max at once
Date: Thu, 5 Nov 2026 18:15:47 +0100	[thread overview]
Message-ID: <920d420a-3a7c-495b-9e4f-f9133e540f76@virtuozzo.com> (raw)
In-Reply-To: <20261101235155.124059-1-mirian.shilakadze@virtuozzo.com>

Reviewed-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>

First 5 are clean cherry-pick, 6 has reasonable rework as reclaim
logic is excess in our kernel. All fixes are from stable and look
needed for proper dmem.max functioning.

On 11/2/26 00:51, Mirian Shilakadze wrote:
> Per-container GPU memory limits (VSTOR-135023) enable the dmem cgroup
> controller for Containers. Our dmem.c is upstream as of 8821f36333e2
> (6.14) and lacks four upstream fixes tagged for stable. The first one
> matters most: with dmem enabled for Containers, root in a Container can
> write a region name without a value to dmem.max of its own child
> cgroup, which dereferences NULL and, with CONFIG_PANIC_ON_OOPS=y,
> panics the node.
> 
> Patch 6 is an adapted 747c4bb450ad: a dmem.max below the current usage
> takes effect at once, as upstream, instead of being dropped while the
> write reports success. Its reclaim callback is left out, see the rebase
> note. For the NVIDIA driver this is the same as upstream. For amdgpu
> and xe a lower limit evicts at their next allocation instead of at the
> write. Patch 5 is the stable TTM fix that lets that eviction go on past
> the first buffer, upstream has it before 747c4bb450ad.
> 
> Tested on bg-sdc2-e18-04 (H200, NVIDIA 615.71.10 open modules) with the
> koji 211.52.1.22.14 SRPM plus this series, normal and debug kernels:
> - a region without a value in dmem.max returns -EINVAL, from the host
>   and from Container root
> - a lower dmem.max takes effect at once: while usage is above it a new
>   CUDA context fails, after release allocations stop at the new limit.
>   The stock kernel keeps the old limit and lets both through.
> - NVIDIA driver unload with lockdep active no longer warns about RCU in
>   dmem_cgroup_unregister_region(), as the stock debug kernel did, and
>   reload cycles give no KASAN reports
> - a failed pool preallocation (failslab, debug kernel) makes the write
>   return -ENOMEM
> Patch 5 and the amdgpu and xe paths are build-tested only, the host has
> no such GPU.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-152813
> 
> Chen Ridong (3):
>   ms/cgroup/dmem: fix NULL pointer dereference when setting max
>   ms/cgroup/dmem: avoid rcu warning when unregister region
>   ms/cgroup/dmem: avoid pool UAF
> 
> Guopeng Zhang (1):
>   ms/cgroup/dmem: Return -ENOMEM on failed pool preallocation
> 
> Thomas Hellström (2):
>   ms/drm/ttm: Convert -EAGAIN from dmem_cgroup_try_charge to -ENOSPC
>   ms/cgroup/dmem: Add reclaim callback for lowering max below current
>     usage
> 
>  drivers/gpu/drm/ttm/ttm_bo.c       |  2 +-
>  drivers/gpu/drm/ttm/ttm_resource.c |  5 +-
>  kernel/cgroup/dmem.c               | 76 ++++++++++++++++++++++++++----
>  3 files changed, 73 insertions(+), 10 deletions(-)
> 

-- 
Best regards, Pavel Tikhomirov
Senior Software Developer, Virtuozzo.

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  parent reply	other threads:[~2026-11-05 17:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-01 23:51 Mirian Shilakadze
2026-11-01 23:51 ` [Devel] [PATCH hci-8.1 1/6] ms/cgroup/dmem: fix NULL pointer dereference when setting max Mirian Shilakadze
2026-11-01 23:54   ` no-reply
2026-11-01 23:51 ` [Devel] [PATCH hci-8.1 2/6] ms/cgroup/dmem: avoid rcu warning when unregister region Mirian Shilakadze
2026-11-01 23:55   ` no-reply
2026-11-01 23:51 ` [Devel] [PATCH hci-8.1 3/6] ms/cgroup/dmem: avoid pool UAF Mirian Shilakadze
2026-11-01 23:56   ` no-reply
2026-11-01 23:51 ` [Devel] [PATCH hci-8.1 4/6] ms/cgroup/dmem: Return -ENOMEM on failed pool preallocation Mirian Shilakadze
2026-11-01 23:55   ` no-reply
2026-11-01 23:51 ` [Devel] [PATCH hci-8.1 5/6] ms/drm/ttm: Convert -EAGAIN from dmem_cgroup_try_charge to -ENOSPC Mirian Shilakadze
2026-11-01 23:56   ` no-reply
2026-11-01 23:51 ` [Devel] [PATCH hci-8.1 6/6] ms/cgroup/dmem: Add reclaim callback for lowering max below current usage Mirian Shilakadze
2026-11-01 23:57   ` no-reply
2026-11-05 17:15 ` Pavel Tikhomirov [this message]
2026-11-05 18:10 ` [Devel] [PATCH hci-8.1 0/6] cgroup/dmem: backport fixes and apply a lower dmem.max at once Konstantin Khorenko
2026-11-05 18:10 ` 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=920d420a-3a7c-495b-9e4f-f9133e540f76@virtuozzo.com \
    --to=ptikhomirov@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=khorenko@virtuozzo.com \
    --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.