From: Fei Yu <fei.yu@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: dri-devel@lists.freedesktop.org, kernel-dev@igalia.com,
"Christian König" <christian.koenig@amd.com>,
"Maíra Canal" <mcanal@igalia.com>
Subject: Re: [PATCH v2 7/7] drm/syncobj: Add temporary array allocation fast paths
Date: Fri, 27 Nov 2026 15:59:10 +0800 [thread overview]
Message-ID: <20261127075910.1869135-1-fei.yu@intel.com> (raw)
In-Reply-To: <20261126114945.67886-1-tvrtko.ursulin@igalia.com>
On Thu, Nov 26, 2026 at 11:49:45AM +0000, Tvrtko Ursulin wrote:
> Running the Cyberpunk 2077 benchmark we can observe that waiting on DRM
> sycobjs (drm_syncobj_array_wait_timeout) is relatively hot, but that the
Nit: "sycobjs" -> "syncobjs".
> v2:
> * Use fast path in drm_syncobj_array_find itself!
Thanks, that drops the handles allocation from every array ioctl
(and covers the sashiko comment on v1).
> +#define DRM_SYNCOBJ_INIT_FASTPATH_ARRAY(_name, _src, _count) ({ \
[...]
> + } else { \
> + size_t __size = (_count) * sizeof(*(_name)); \
> + \
> + _name = _name##_stack; \
> + if (_src) { \
> + if (copy_from_user(_name, (_src), __size)) \
> + __ret = -EFAULT; \
> + } else { \
> + memset(_name, 0, __size); \
> + } \
> + } \
> + __ret; \
> +})
A NULL _src means "zero-fill" here. That is the right thing for the
points arrays, but it is also why array_find needs its own check:
> + if (!user_handles)
> + return -EFAULT; /* Preserve ABI error code */
A future caller that forgets this check would silently get zeroes
instead of -EFAULT for a NULL user pointer. Maybe split the init into
a copy variant and a zero variant (a NULL user pointer then fails in
copy_from_user() / vmemdup_array_user() as before, and this check can
go), or at least say in a comment above the macro that NULL means
zero-fill?
Reviewed-by: Fei Yu <fei.yu@intel.com>
Thanks,
Fei
next prev parent reply other threads:[~2026-11-27 7:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 11:11 [PATCH 0/7] DRM syncobj scoped cleanup and fast path Tvrtko Ursulin
2026-11-26 11:11 ` [PATCH 1/7] drm/syncobj: Use vmemdup_array_user in drm_syncobj_array_find Tvrtko Ursulin
2026-11-26 11:59 ` Christian König
2026-11-26 11:11 ` [PATCH 2/7] drm/syncobj: Use scoped cleanup for drm_syncobj_array_wait_timeout points Tvrtko Ursulin
2026-11-26 12:09 ` Christian König
2026-11-26 14:22 ` Tvrtko Ursulin
2026-11-26 11:11 ` [PATCH 3/7] drm/syncobj: Use scoped cleanup for drm_syncobj_array_wait_timeout syncobjs Tvrtko Ursulin
2026-11-26 11:17 ` sashiko-bot
2026-11-26 12:11 ` Christian König
2026-11-26 14:33 ` Tvrtko Ursulin
2026-11-26 11:11 ` [PATCH 4/7] drm/syncobj: Use scoped cleanup for drm_syncobj_timeline_signal_ioctl points Tvrtko Ursulin
2026-11-26 12:15 ` Christian König
2026-11-26 11:11 ` [PATCH 5/7] drm/syncobj: Use scoped cleanup for drm_syncobj_timeline_signal_ioctl chains Tvrtko Ursulin
2026-11-26 11:21 ` sashiko-bot
2026-11-26 12:19 ` Christian König
2026-11-26 11:11 ` [PATCH 6/7] drm/syncobj: Use scoped cleanup in drm_syncobj_array_find and callers Tvrtko Ursulin
2026-11-26 11:19 ` sashiko-bot
2026-11-26 11:11 ` [PATCH 7/7] drm/syncobj: Add temporary array allocation fast paths Tvrtko Ursulin
2026-11-26 11:22 ` sashiko-bot
2026-11-26 11:49 ` [PATCH v2 " Tvrtko Ursulin
2026-11-27 7:59 ` Fei Yu [this message]
2026-11-27 7:58 ` [PATCH 0/7] DRM syncobj scoped cleanup and fast path Fei Yu
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=20261127075910.1869135-1-fei.yu@intel.com \
--to=fei.yu@intel.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-dev@igalia.com \
--cc=mcanal@igalia.com \
--cc=tvrtko.ursulin@igalia.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.