From: "Huang, Honglei" <honghuan@amd.com>
To: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Cc: gurchetansingh@chromium.org, olvaffe@gmail.com,
Ray.Huang@amd.com, dri-devel@lists.freedesktop.org,
virtualization@lists.linux.dev, linux-kernel@vger.kernel.org,
odaki@rsg.ci.i.u-tokyo.ac.jp, airlied@redhat.com,
kraxel@redhat.com
Subject: Re: [RFC PATCH v9 3/4] drm/virtio: implement userptr resource support
Date: Sat, 10 Oct 2026 15:36:52 +0800 [thread overview]
Message-ID: <f1437a1e-387c-4eac-a5dd-e1fe42a444ff@amd.com> (raw)
In-Reply-To: <f0c5d61a-d4bd-4f92-aba9-50c67cef74c6@collabora.com>
On 10/10/2026 2:46 AM, Dmitry Osipenko wrote:
> 09.10.2026 21:38, Dmitry Osipenko пишет:
>> 24.09.2026 12:55, Honglei Huang пишет:
>>> + mm = current->mm;
>>> + mmgrab(mm);
>>> + lock_limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT;
>>> + new_pinned = atomic64_add_return(userptr->npages, &mm->pinned_vm);
>>> + if (new_pinned < 0 ||
>>> + (new_pinned > lock_limit && !capable(CAP_IPC_LOCK))) {
>>> + atomic64_sub(userptr->npages, &mm->pinned_vm)
>>
>> At a quick glance over other kernel code touching pinned_vm, nobody else
>> check for new_pinned < 0 and then doing atomic64_sub() for the negative
>> value will be incorrect.
> Though no, negative will restore pinned_vm. Still neg looks confusing
> and shouldn't be needed as such overflow shouldn't be possible.
>
Got it will remove this check in next version
Regards,
Honglei
next prev parent reply other threads:[~2026-10-10 7:37 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 9:55 [RFC PATCH v9 0/4] virtio-gpu: Add userptr support for compute workloads Honglei Huang
2026-09-24 9:55 ` [RFC PATCH v9 1/4] drm/virtio-gpu: Add VIRTIO_GPU_CAPSET_ROCM capability Honglei Huang
2026-09-24 10:03 ` sashiko-bot
2026-09-24 9:55 ` [RFC PATCH v9 2/4] drm/virtgpu api: add blob userptr resource Honglei Huang
2026-09-24 10:04 ` sashiko-bot
2026-09-24 9:55 ` [RFC PATCH v9 3/4] drm/virtio: implement userptr resource support Honglei Huang
2026-09-24 10:07 ` sashiko-bot
2026-09-26 11:33 ` Akihiko Odaki
2026-09-28 16:22 ` Huang, Honglei
2026-09-28 17:25 ` Akihiko Odaki
2026-09-29 2:22 ` Huang, Honglei
2026-09-30 4:56 ` Akihiko Odaki
2026-09-30 13:32 ` Huang, Honglei
2026-10-09 18:32 ` Dmitry Osipenko
2026-10-10 7:36 ` Huang, Honglei
2026-10-09 18:38 ` Dmitry Osipenko
2026-10-09 18:46 ` Dmitry Osipenko
2026-10-10 7:36 ` Huang, Honglei [this message]
2026-10-09 18:53 ` Dmitry Osipenko
2026-10-10 7:37 ` Huang, Honglei
2026-10-10 12:50 ` Dmitry Osipenko
2026-10-13 5:32 ` Huang, Honglei
2026-10-13 22:12 ` Dmitry Osipenko
2026-09-24 9:55 ` [RFC PATCH v9 4/4] drm/virtio: wire blob ioctl creation to userptr objects Honglei Huang
2026-09-24 10:04 ` sashiko-bot
2026-09-27 1:04 ` Akihiko Odaki
2026-09-28 16:23 ` Huang, Honglei
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=f1437a1e-387c-4eac-a5dd-e1fe42a444ff@amd.com \
--to=honghuan@amd.com \
--cc=Ray.Huang@amd.com \
--cc=airlied@redhat.com \
--cc=dmitry.osipenko@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gurchetansingh@chromium.org \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
--cc=olvaffe@gmail.com \
--cc=virtualization@lists.linux.dev \
/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.