From: Danilo Krummrich <dakr@kernel.org>
To: "Christian König" <christian.koenig@amd.com>
Cc: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>,
alexander.deucher@amd.com, amd-gfx@lists.freedesktop.org,
Philipp Stanner <phasta@kernel.org>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v1] drm/amdgpu: give each kernel job a unique id
Date: Wed, 11 Jun 2025 16:25:59 +0200 [thread overview]
Message-ID: <aEmR9420vj-ISz-W@cassiopeiae> (raw)
In-Reply-To: <2cefb0f5-3820-4828-8360-ff8c92e21aa6@amd.com>
(Cc: dri-devel)
On Tue, Jun 10, 2025 at 03:05:34PM +0200, Christian König wrote:
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h
> > index 5a8bc6342222..6108a6f9dba7 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h
> > @@ -44,6 +44,22 @@
> > struct amdgpu_fence;
> > enum amdgpu_ib_pool_type;
> >
> > +/* Internal kernel job ids. (decreasing values, starting from U64_MAX). */
> > +#define AMDGPU_KERNEL_JOB_ID_VM_UPDATE (18446744073709551615ULL)
> > +#define AMDGPU_KERNEL_JOB_ID_VM_UPDATE_PDES (18446744073709551614ULL)
> > +#define AMDGPU_KERNEL_JOB_ID_VM_UPDATE_RANGE (18446744073709551613ULL)
> > +#define AMDGPU_KERNEL_JOB_ID_VM_PT_CLEAR (18446744073709551612ULL)
> > +#define AMDGPU_KERNEL_JOB_ID_TTM_MAP_BUFFER (18446744073709551611ULL)
> > +#define AMDGPU_KERNEL_JOB_ID_TTM_ACCESS_MEMORY_SDMA (18446744073709551610ULL)
> > +#define AMDGPU_KERNEL_JOB_ID_TTM_COPY_BUFFER (18446744073709551609ULL)
> > +#define AMDGPU_KERNEL_JOB_ID_CLEAR_ON_RELEASE (18446744073709551608ULL)
> > +#define AMDGPU_KERNEL_JOB_ID_MOVE_BLIT (18446744073709551607ULL)
> > +#define AMDGPU_KERNEL_JOB_ID_TTM_CLEAR_BUFFER (18446744073709551606ULL)
> > +#define AMDGPU_KERNEL_JOB_ID_CLEANER_SHADER (18446744073709551605ULL)
> > +#define AMDGPU_KERNEL_JOB_ID_FLUSH_GPU_TLB (18446744073709551604ULL)
> > +#define AMDGPU_KERNEL_JOB_ID_KFD_GART_MAP (18446744073709551603ULL)
> > +#define AMDGPU_KERNEL_JOB_ID_VCN_RING_TEST (18446744073709551602ULL)
Why not
(U64_MAX - {1, 2, ...})?
> Mhm, reiterating our internal discussion on the mailing list.
>
> I think it would be nicer if we could use negative values for the kernel submissions and positive for userspace. But as discussed internally we would need to adjust the scheduler trace points for that once more.
>
> @Philip and @Danilo any opinion on that?
Both, the U64_MAX and the positive-negative approach, are a bit hacky. I wonder
why we need client_id to be a u64, wouldn't a u32 not be enough?
Anyways, if client_id remains to be a u64, we could add a global DRM constant
instead, e.g.
#define DRM_CLIENT_ID_MAX 0x0fffffffffffffff
#define DRM_KERNEL_ID_BASE (DRM_CLIENT_ID_MAX + 1)
And in drm_file_alloc() fail if we're out of IDs.
I think this would be much cleaner.
next prev parent reply other threads:[~2025-06-11 14:26 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-04 12:28 [PATCH v1] drm/amdgpu: give each kernel job a unique id Pierre-Eric Pelloux-Prayer
2025-06-10 13:05 ` Christian König
2025-06-11 14:25 ` Danilo Krummrich [this message]
2025-06-11 14:57 ` Christian König
2025-06-11 15:11 ` Danilo Krummrich
2025-06-12 7:00 ` Christian König
2025-06-12 23:48 ` Danilo Krummrich
2025-06-13 7:51 ` Pierre-Eric Pelloux-Prayer
2025-06-13 8:31 ` Danilo Krummrich
2025-06-13 8:23 ` Christian König
2025-06-13 8:29 ` Philipp Stanner
2025-06-13 8:42 ` Danilo Krummrich
2025-06-13 8:35 ` Danilo Krummrich
2025-06-13 9:27 ` Pierre-Eric Pelloux-Prayer
2025-06-13 11:48 ` Danilo Krummrich
2025-06-18 9:18 ` Pierre-Eric Pelloux-Prayer
2025-07-02 9:23 ` Pierre-Eric Pelloux-Prayer
2025-07-02 9:42 ` Danilo Krummrich
2025-08-01 15:34 ` Alex Deucher
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=aEmR9420vj-ISz-W@cassiopeiae \
--to=dakr@kernel.org \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=phasta@kernel.org \
--cc=pierre-eric.pelloux-prayer@amd.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.