From: Danilo Krummrich <dakr@kernel.org>
To: "Christian König" <christian.koenig@amd.com>, i@cassiopeiae
Cc: tursulin@ursulin.net, phasta@mailbox.org,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH 1/4] drm/sched: optimize drm_sched_job_add_dependency
Date: Mon, 26 May 2025 13:14:34 +0200 [thread overview]
Message-ID: <aDRNGnPjmFDwzPOR@cassiopeiae> (raw)
In-Reply-To: <9ee10cc3-733b-4d64-b396-28e62c631dc4@amd.com>
(Cc: Matthew)
Let's get this clarified to not work with assumptions. :)
On Mon, May 26, 2025 at 12:59:41PM +0200, Christian König wrote:
> On 5/24/25 13:17, Danilo Krummrich wrote:
> > On Fri, May 23, 2025 at 04:11:39PM +0200, Danilo Krummrich wrote:
> > So, your code here should be correct. However, I'd still remove the goto and
> > just call xas_store() again. There's no reason to make this a loop and backwards
> > goto is better avoided anyways. :)
>
>
> I was considering that as well, but than abandoned this idea. The xarray() sample code and test cases as well as the use cases where I took a look either use a loop or a goto.
>
> I'm not 100% sure why, my suspicion is that you need the loop when there can be concurrent add/remove operations on the xarray, but I think we should stick with the common approach.
I don't think that concurrency is relevant here. xas_nomem() stores the
allocated memory in the XA_STATE structure, which is on the stack.
I know that for maple tree a pre-allocation is only valid for the exact state
of the tree it was allocated for.
But I think xarray does not have this limitation, i.e. concurrent modification
of the xarray does not invalidate an xas_nomem() allocation in terms of being
sufficient for a subsequent store.
@Matthew: Can you clarify this please?
next prev parent reply other threads:[~2025-05-26 11:14 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-23 12:56 Fixing AMDGPUs gang submit error handling Christian König
2025-05-23 12:56 ` [PATCH 1/4] drm/sched: optimize drm_sched_job_add_dependency Christian König
2025-05-23 13:49 ` Tvrtko Ursulin
2025-05-23 14:11 ` Danilo Krummrich
2025-05-23 14:16 ` Danilo Krummrich
2025-05-26 9:25 ` Christian König
2025-05-26 9:34 ` Philipp Stanner
2025-05-26 11:16 ` Christian König
2025-05-26 11:27 ` Philipp Stanner
2025-05-28 12:30 ` Simona Vetter
2025-05-28 13:24 ` Christian König
2025-05-28 13:29 ` Alex Deucher
2025-05-28 14:38 ` Danilo Krummrich
2025-05-28 14:47 ` Danilo Krummrich
2025-06-03 11:34 ` Simona Vetter
2025-05-24 11:17 ` Danilo Krummrich
2025-05-26 10:59 ` Christian König
2025-05-26 11:14 ` Danilo Krummrich [this message]
2025-05-26 11:36 ` Christian König
2025-05-26 7:28 ` Philipp Stanner
2025-05-23 12:56 ` [PATCH 2/4] drm/sched: add drm_sched_prealloc_dependency_slots Christian König
2025-05-23 12:56 ` [PATCH 3/4] drm/sched: Add a test for prealloced fence slots Christian König
2025-05-23 12:56 ` [PATCH 4/4] drm/amdgpu: fix gang submission error handling Christian König
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=aDRNGnPjmFDwzPOR@cassiopeiae \
--to=dakr@kernel.org \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=i@cassiopeiae \
--cc=phasta@mailbox.org \
--cc=tursulin@ursulin.net \
--cc=willy@infradead.org \
/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.