From: Boris Brezillon <boris.brezillon@collabora.com>
To: "Christian König" <christian.koenig@amd.com>
Cc: matthew.brost@intel.com, Sarah Walker <sarah.walker@imgtec.com>,
nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, luben.tuikov@amd.com,
Danilo Krummrich <dakr@redhat.com>,
Donald Robson <Donald.Robson@imgtec.com>,
faith.ekstrand@collabora.com
Subject: Re: [PATCH drm-misc-next 1/3] drm/sched: implement dynamic job flow control
Date: Tue, 26 Sep 2023 09:11:29 +0200 [thread overview]
Message-ID: <20230926091129.2d7d7472@collabora.com> (raw)
In-Reply-To: <c6ec9ab4-d63b-0a72-4abf-682b94739877@amd.com>
On Mon, 25 Sep 2023 19:55:21 +0200
Christian König <christian.koenig@amd.com> wrote:
> Am 25.09.23 um 14:55 schrieb Boris Brezillon:
> > +The imagination team, who's probably interested too.
> >
> > On Mon, 25 Sep 2023 00:43:06 +0200
> > Danilo Krummrich <dakr@redhat.com> wrote:
> >
> >> Currently, job flow control is implemented simply by limiting the amount
> >> of jobs in flight. Therefore, a scheduler is initialized with a
> >> submission limit that corresponds to a certain amount of jobs.
> >>
> >> This implies that for each job drivers need to account for the maximum
> >> job size possible in order to not overflow the ring buffer.
> >>
> >> However, there are drivers, such as Nouveau, where the job size has a
> >> rather large range. For such drivers it can easily happen that job
> >> submissions not even filling the ring by 1% can block subsequent
> >> submissions, which, in the worst case, can lead to the ring run dry.
> >>
> >> In order to overcome this issue, allow for tracking the actual job size
> >> instead of the amount job jobs. Therefore, add a field to track a job's
> >> submission units, which represents the amount of units a job contributes
> >> to the scheduler's submission limit.
> > As mentioned earlier, this might allow some simplifications in the
> > PowerVR driver where we do flow-control using a dma_fence returned
> > through ->prepare_job(). The only thing that'd be missing is a way to
> > dynamically query the size of a job (a new hook?), instead of having the
> > size fixed at creation time, because PVR jobs embed native fence waits,
> > and the number of native fences will decrease if some of these fences
> > are signalled before ->run_job() is called, thus reducing the job size.
>
> Exactly that is a little bit questionable since it allows for the device
> to postpone jobs infinitely.
>
> It would be good if the scheduler is able to validate if it's ever able
> to run the job when it is pushed into the entity.
Yes, we do that already. We check that the immutable part of the job
(everything that's not a native fence wait) fits in the ringbuf.
WARNING: multiple messages have this Message-ID (diff)
From: Boris Brezillon <boris.brezillon@collabora.com>
To: "Christian König" <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@redhat.com>,
airlied@gmail.com, daniel@ffwll.ch, matthew.brost@intel.com,
faith.ekstrand@collabora.com, luben.tuikov@amd.com,
dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Donald Robson <Donald.Robson@imgtec.com>,
Frank Binns <Frank.Binns@imgtec.com>,
Sarah Walker <sarah.walker@imgtec.com>
Subject: Re: [PATCH drm-misc-next 1/3] drm/sched: implement dynamic job flow control
Date: Tue, 26 Sep 2023 09:11:29 +0200 [thread overview]
Message-ID: <20230926091129.2d7d7472@collabora.com> (raw)
In-Reply-To: <c6ec9ab4-d63b-0a72-4abf-682b94739877@amd.com>
On Mon, 25 Sep 2023 19:55:21 +0200
Christian König <christian.koenig@amd.com> wrote:
> Am 25.09.23 um 14:55 schrieb Boris Brezillon:
> > +The imagination team, who's probably interested too.
> >
> > On Mon, 25 Sep 2023 00:43:06 +0200
> > Danilo Krummrich <dakr@redhat.com> wrote:
> >
> >> Currently, job flow control is implemented simply by limiting the amount
> >> of jobs in flight. Therefore, a scheduler is initialized with a
> >> submission limit that corresponds to a certain amount of jobs.
> >>
> >> This implies that for each job drivers need to account for the maximum
> >> job size possible in order to not overflow the ring buffer.
> >>
> >> However, there are drivers, such as Nouveau, where the job size has a
> >> rather large range. For such drivers it can easily happen that job
> >> submissions not even filling the ring by 1% can block subsequent
> >> submissions, which, in the worst case, can lead to the ring run dry.
> >>
> >> In order to overcome this issue, allow for tracking the actual job size
> >> instead of the amount job jobs. Therefore, add a field to track a job's
> >> submission units, which represents the amount of units a job contributes
> >> to the scheduler's submission limit.
> > As mentioned earlier, this might allow some simplifications in the
> > PowerVR driver where we do flow-control using a dma_fence returned
> > through ->prepare_job(). The only thing that'd be missing is a way to
> > dynamically query the size of a job (a new hook?), instead of having the
> > size fixed at creation time, because PVR jobs embed native fence waits,
> > and the number of native fences will decrease if some of these fences
> > are signalled before ->run_job() is called, thus reducing the job size.
>
> Exactly that is a little bit questionable since it allows for the device
> to postpone jobs infinitely.
>
> It would be good if the scheduler is able to validate if it's ever able
> to run the job when it is pushed into the entity.
Yes, we do that already. We check that the immutable part of the job
(everything that's not a native fence wait) fits in the ringbuf.
next prev parent reply other threads:[~2023-09-26 7:11 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-24 22:43 [Nouveau] [PATCH drm-misc-next 1/3] drm/sched: implement dynamic job flow control Danilo Krummrich
2023-09-24 22:43 ` Danilo Krummrich
2023-09-24 22:43 ` Danilo Krummrich
2023-09-25 12:55 ` Boris Brezillon
2023-09-25 12:55 ` Boris Brezillon
2023-09-25 17:55 ` [Nouveau] " Christian König
2023-09-25 17:55 ` Christian König
2023-09-25 17:55 ` Christian König
2023-09-26 7:11 ` Boris Brezillon [this message]
2023-09-26 7:11 ` Boris Brezillon
2023-09-27 11:54 ` [Nouveau] " Christian König
2023-09-27 11:54 ` Christian König
2023-09-27 11:54 ` Christian König
2023-09-27 12:11 ` [Nouveau] " Danilo Krummrich
2023-09-27 12:11 ` Danilo Krummrich
2023-09-27 12:11 ` Danilo Krummrich
2023-09-27 12:15 ` [Nouveau] " Christian König
2023-09-27 12:15 ` Christian König
2023-09-27 12:15 ` Christian König
2023-09-27 12:41 ` [Nouveau] " Luben Tuikov
2023-09-27 12:41 ` Luben Tuikov
2023-09-27 12:41 ` Luben Tuikov
2023-09-27 14:12 ` [Nouveau] " Danilo Krummrich
2023-09-27 14:12 ` Danilo Krummrich
2023-09-27 14:12 ` Danilo Krummrich
2023-09-28 8:02 ` Boris Brezillon
2023-09-28 8:02 ` Boris Brezillon
2023-09-28 14:44 ` [Nouveau] " Luben Tuikov
2023-09-28 14:44 ` Luben Tuikov
2023-09-28 14:44 ` Luben Tuikov
2023-09-28 16:26 ` Boris Brezillon
2023-09-28 16:26 ` Boris Brezillon
2023-09-26 20:43 ` [Nouveau] " Luben Tuikov
2023-09-26 20:43 ` Luben Tuikov
2023-09-26 20:43 ` Luben Tuikov
2023-09-26 23:48 ` [Nouveau] " Luben Tuikov
2023-09-26 23:48 ` Luben Tuikov
2023-09-26 23:48 ` Luben Tuikov
2023-09-27 0:18 ` [Nouveau] " Danilo Krummrich
2023-09-27 0:18 ` Danilo Krummrich
2023-09-27 0:18 ` Danilo Krummrich
2023-09-27 0:13 ` [Nouveau] " Danilo Krummrich
2023-09-27 0:13 ` Danilo Krummrich
2023-09-27 0:13 ` Danilo Krummrich
2023-09-27 1:55 ` [Nouveau] " Luben Tuikov
2023-09-27 1:55 ` Luben Tuikov
2023-09-27 1:55 ` Luben Tuikov
2023-09-27 7:25 ` Boris Brezillon
2023-09-27 7:25 ` Boris Brezillon
2023-09-27 11:45 ` [Nouveau] " Danilo Krummrich
2023-09-27 11:45 ` Danilo Krummrich
2023-09-27 11:45 ` Danilo Krummrich
2023-09-27 11:54 ` Boris Brezillon
2023-09-27 11:54 ` Boris Brezillon
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=20230926091129.2d7d7472@collabora.com \
--to=boris.brezillon@collabora.com \
--cc=Donald.Robson@imgtec.com \
--cc=christian.koenig@amd.com \
--cc=dakr@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=faith.ekstrand@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luben.tuikov@amd.com \
--cc=matthew.brost@intel.com \
--cc=nouveau@lists.freedesktop.org \
--cc=sarah.walker@imgtec.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.