All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Cc: David Airlie <airlied@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Gurchetan Singh <gurchetansingh@chromium.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>,
	linux-kernel@vger.kernel.org,
	syzbot+1b129b44597a126d2d79@syzkaller.appspotmail.com,
	dri-devel@lists.freedesktop.org, virtualization@lists.linux.dev
Subject: Re: [PATCH] drm/virtio: share one vbuf cache across all devices
Date: Wed, 14 Oct 2026 09:41:10 +0800	[thread overview]
Message-ID: <20261014014112.515-1-hdanton@sina.com> (raw)
In-Reply-To: <bf25fc38-95d7-4cb5-b0ee-6afe1488e5e7@collabora.com>

On Fri, 9 Oct 2026 20:39:54 +0300 Dmitry Osipenko wrote:
>27.09.2026 07:09, Nguyen Ngoc Thang пишет:
>> On Sun, 27 Sep 2026, Hillf Danton wrote:
>>> What is unclear -- why is kmalloc failing to work in 2026?
>> 
>> kmalloc isn't failing. The failure is in kmem_cache_create(): the driver
>> creates a dedicated cache with a fixed global name for each device, so a
>> second probe while the first drm_device is still alive (release is
>> deferred by an open /dev/fbN) trips the duplicate-name check.
>> 
>> Your question made me look at whether the dedicated cache is needed at all.
>> A vbuf is sizeof(struct virtio_gpu_vbuffer) + 96 + 24 = 216 bytes, which
>> lands in kmalloc-256 anyway, so the cache buys nothing over kzalloc()/kfree().
>> Dropping it also removes the lifetime problem entirely and needs no
>> module-level state.
>> 
>> I'll send a v2 that switches the kmem_cache_zalloc() calls and
>> kmem_cache_free() to kzalloc()/kfree() and deletes the cache setup and
>> teardown.
>> 
>> Thanks,
>> Nguyen Ngoc Thang
>
> kmem_cache is used by GPU drivers to avoid kmalloc stalls in a
> latency-sensitive job-submission code path.
>
This makes no sense before showing the stall, given my failure of locating
the lore page where the tglx dude was taught a few years back (by Mathew
Wilcox?) that the percpu page is faster that thought.

  reply	other threads:[~2026-10-14  1:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-26 16:24 [PATCH] drm/virtio: share one vbuf cache across all devices Nguyen Ngoc Thang
2026-09-26 16:33 ` sashiko-bot
2026-09-27  0:03 ` Hillf Danton
2026-09-27  4:09   ` Nguyen Ngoc Thang
2026-10-09 17:39     ` Dmitry Osipenko
2026-10-14  1:41       ` Hillf Danton [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-10-10 15:04 Nguyen Ngoc Thang

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=20261014014112.515-1-hdanton@sina.com \
    --to=hdanton@sina.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=ngocthang2710.1999@gmail.com \
    --cc=syzbot+1b129b44597a126d2d79@syzkaller.appspotmail.com \
    --cc=tzimmermann@suse.de \
    --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.