All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yu, Fei" <fei.yu@intel.com>
To: tvrtko.ursulin@igalia.com
Cc: dri-devel@lists.freedesktop.org, kernel-dev@igalia.com,
	mcanal@igalia.com, christian.koenig@amd.com, fei.yu@intel.com
Subject: Re: [PATCH 3/3] drm/syncobj: Add a fast path to drm_syncobj_array_find
Date: Wed, 18 Nov 2026 16:06:43 +0800	[thread overview]
Message-ID: <20261118080643.180983-1-fei.yu@intel.com> (raw)
In-Reply-To: <20261117103916.9101-4-tvrtko.ursulin@igalia.com>

From: Fei Yu <fei.yu@intel.com>

On 11/17/26 10:39, Tvrtko Ursulin wrote:
> Therefore lets add a fast path to bypass the kmalloc_array/kfree and use a
> pre-allocated stack array for those cases.

Same as in 2/3, it's vmemdup_array_user()/kvmalloc_objs() now.

> @@ -1265,6 +1265,9 @@ static int drm_syncobj_array_wait(struct drm_device *dev,
>  static int drm_syncobj_array_find(struct drm_file *file_private,
>  				  void __user *user_handles,
>  				  uint32_t count_handles,
> +				  uint32_t *stack_handles,
> +				  struct drm_syncobj **stack_syncobjs,
> +				  u32 stack_count,
>  				  struct drm_syncobj ***syncobjs_out)

The handles array is freed before drm_syncobj_array_find() returns,
so the callers don't need to provide it. A local
"u32 stack_handles[DRM_SYNCOBJ_FAST_PATH_ENTRIES]" in
drm_syncobj_array_find() would do, and the six callers would only
declare and pass stack_syncobjs. Not a must, but it saves some
boilerplate. (Also u32 vs. uint32_t is mixed here.)

> -	syncobjs = kvmalloc_objs(*syncobjs, count_handles);
> -	if (syncobjs == NULL) {
> -		ret = -ENOMEM;
> -		goto err_free_handles;
> +		syncobjs = kvmalloc_objs(*syncobjs, count_handles);;

Double semicolon (checkpatch warns).

The DRM_SYNCOBJ_MAX_HANDLES check stays in front of the fast/slow
split, good. With the ";;" fixed:

Reviewed-by: Fei Yu <fei.yu@intel.com>

Thanks,
Fei

  reply	other threads:[~2026-11-18  8:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 10:39 [PATCH 0/3] drm/syncobj: Allocation avoiding fast path Tvrtko Ursulin
2026-11-17 10:39 ` [PATCH 1/3] drm/syncobj: Use vmemdup_array_user in drm_syncobj_array_find Tvrtko Ursulin
2026-11-17 12:57   ` Maíra Canal
2026-11-17 13:23   ` Christian König
2026-11-17 10:39 ` [PATCH 2/3] drm/syncobj: Add a fast path to drm_syncobj_array_wait_timeout Tvrtko Ursulin
2026-11-18  8:06   ` Yu, Fei
2026-11-17 10:39 ` [PATCH 3/3] drm/syncobj: Add a fast path to drm_syncobj_array_find Tvrtko Ursulin
2026-11-18  8:06   ` Yu, Fei [this message]
2026-11-18  8:06 ` [PATCH 0/3] drm/syncobj: Allocation avoiding fast path Yu, Fei
  -- strict thread matches above, loose matches on Subject: below --
2025-11-10 15:11 [PATCH 3/3] drm/syncobj: Add a fast path to drm_syncobj_array_find kernel test robot
2025-11-06 13:26 [PATCH 0/3] DRM syncobj wait fast path Tvrtko Ursulin
2025-11-06 13:26 ` [PATCH 3/3] drm/syncobj: Add a fast path to drm_syncobj_array_find Tvrtko Ursulin

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=20261118080643.180983-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.