All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
To: Andres Rodriguez
	<andresx7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: Add support for high priority scheduling in amdgpu
Date: Wed, 1 Mar 2017 12:42:20 +0100	[thread overview]
Message-ID: <25194b1a-4756-e1ad-f597-17063a14eb4c@vodafone.de> (raw)
In-Reply-To: <1488320089-22035-1-git-send-email-andresx7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Patches #1-#14 are Acked-by: Christian König <christian.koenig@amd.com>.

Patch #15:

Not sure if that is a good idea or not, need to take a closer look after 
digging through the rest.

In general the HW IP is just for the IOCTL API and not for internal use 
inside the driver.

Patch #16:

Really nice :) I don't have time to look into it in detail, but you have 
one misconception I like to point out:
> The queue manager maintains a per-file descriptor map of user ring ids
> to amdgpu_ring pointers. Once a map is created it is permanent (this is
> required to maintain FIFO execution guarantees for a ring).
Actually we don't have a FIFO execution guarantee per ring. We only have 
that per context.

E.g. commands from different context can execute at the same time and 
out of order.

Making this per file is ok for now, but you should keep in mind that we 
might want to change that sooner or later.

Patch #17 & #18 need to take a closer look when I have more time, but 
the comments from others sounded valid to me as well.

Patch #19: Raising and lowering the priority of a ring during command 
submission doesn't sound like a good idea to me.

The way you currently have it implemented would also raise the priority 
of already running jobs on the same ring. Keep in mind that everything 
is pipelined here.

Additional to that you can't have a fence callback in the job structure, 
cause the job structure is freed by the same fence as well. So it can 
happen that you access freed up memory (but only for a very short period 
of time).

Patches #20-#22 are Acked-by: Christian König <christian.koenig@amd.com>.

Regards,
Christian.

Am 28.02.2017 um 23:14 schrieb Andres Rodriguez:
> This patch series introduces a mechanism that allows users with sufficient
> privileges to categorize their work as "high priority". A userspace app can
> create a high priority amdgpu context, where any work submitted to this context
> will receive preferential treatment over any other work.
>
> High priority contexts will be scheduled ahead of other contexts by the sw gpu
> scheduler. This functionality is generic for all HW blocks.
>
> Optionally, a ring can implement a set_priority() function that allows
> programming HW specific features to elevate a ring's priority.
>
> This patch series implements set_priority() for gfx8 compute rings. It takes
> advantage of SPI scheduling and CU reservation to provide improved frame
> latencies for high priority contexts.
>
> For compute + compute scenarios we get near perfect scheduling latency. E.g.
> one high priority ComputeParticles + one low priority ComputeParticles:
>      - High priority ComputeParticles: 2.0-2.6 ms/frame
>      - Regular ComputeParticles: 35.2-68.5 ms/frame
>
> For compute + gfx scenarios the high priority compute application does
> experience some latency variance. However, the variance has smaller bounds and
> a smalled deviation then without high priority scheduling.
>
> Following is a graph of the frame time experienced by a high priority compute
> app in 4 different scenarios to exemplify the compute + gfx latency variance:
>      - ComputeParticles: this scenario invloves running the compute particles
>        sample on its own.
>      - +SSAO: Previous scenario with the addition of running the ssao sample
>        application that clogs the GFX ring with constant work.
>      - +SPI Priority: Previous scenario with the addition of SPI priority
>        programming for compute rings.
>      - +CU Reserve: Previous scenario with the addition of dynamic CU
>        reservation for compute rings.
>
> Graph link:
> https://plot.ly/~lostgoat/9/
>
> As seen above, high priority contexts for compute allow us to schedule work
> with enhanced confidence of completion latency under high GPU loads. This
> property will be important for VR reprojection workloads.
>
> Note: The first part of this series is a resend of "Change queue/pipe split
> between amdkfd and amdgpu" with the following changes:
>      - Fixed kfdtest on Kaveri due to shift overflow. Refer to: "drm/amdkfdallow
>        split HQD on per-queue granularity v3"
>      - Used Felix's suggestions for a simplified HQD programming sequence
>      - Added a workaround for a Tonga HW bug during HQD programming
>
> This series is also available at:
> https://github.com/lostgoat/linux/tree/wip-high-priority
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-03-01 11:42 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-28 22:14 Add support for high priority scheduling in amdgpu Andres Rodriguez
     [not found] ` <1488320089-22035-1-git-send-email-andresx7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-28 22:14   ` [PATCH 01/22] drm/amdgpu: refactor MQD/HQD initialization Andres Rodriguez
2017-02-28 22:14   ` [PATCH 02/22] drm/amdgpu: doorbell registers need only be set once v2 Andres Rodriguez
2017-02-28 22:14   ` [PATCH 03/22] drm/amdgpu: detect timeout error when deactivating hqd Andres Rodriguez
2017-02-28 22:14   ` [PATCH 04/22] drm/amdgpu: remove duplicate definition of cik_mqd Andres Rodriguez
2017-02-28 22:14   ` [PATCH 05/22] drm/amdgpu: unify MQD programming sequence for kfd and amdgpu Andres Rodriguez
2017-02-28 22:14   ` [PATCH 06/22] drm/amdgpu: rename rdev to adev Andres Rodriguez
2017-02-28 22:14   ` [PATCH 07/22] drm/amdgpu: take ownership of per-pipe configuration Andres Rodriguez
2017-02-28 22:14   ` [PATCH 08/22] drm/radeon: take ownership of pipe initialization Andres Rodriguez
2017-02-28 22:14   ` [PATCH 09/22] drm/amdgpu: allow split of queues with kfd at queue granularity Andres Rodriguez
2017-02-28 22:14   ` [PATCH 10/22] drm/amdgpu: teach amdgpu how to enable interrupts for any pipe Andres Rodriguez
2017-02-28 22:14   ` [PATCH 11/22] drm/amdkfd: allow split HQD on per-queue granularity v3 Andres Rodriguez
2017-02-28 22:14   ` [PATCH 12/22] drm/amdgpu: remove duplicate magic constants from amdgpu_amdkfd_gfx*.c Andres Rodriguez
2017-02-28 22:14   ` [PATCH 13/22] drm/amdgpu: allocate queues horizontally across pipes Andres Rodriguez
2017-02-28 22:14   ` [PATCH 14/22] drm/amdgpu: new queue policy, take first 2 queues of each pipe Andres Rodriguez
2017-02-28 22:14   ` [PATCH 15/22] drm/amdgpu: add hw_ip member to amdgpu_ring Andres Rodriguez
     [not found]     ` <1488320089-22035-16-git-send-email-andresx7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-03-01 15:33       ` Alex Deucher
2017-02-28 22:14   ` [PATCH 16/22] drm/amdgpu: add a mechanism to untie user ring ids from kernel ring ids Andres Rodriguez
2017-02-28 22:14   ` [PATCH 17/22] drm/amdgpu: implement lru amdgpu_queue_mgr policy for compute Andres Rodriguez
2017-02-28 22:14   ` [PATCH 18/22] drm/amdgpu: add flag for high priority contexts v4 Andres Rodriguez
     [not found]     ` <1488320089-22035-19-git-send-email-andresx7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-03-01  1:13       ` Emil Velikov
     [not found]         ` <CACvgo51=1-8dHmC8MOmbCijDv3vpD4dTC6hibQMe5bYB9zsB4Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-02  3:52           ` Andres Rodriguez
     [not found]             ` <782283a5-3871-0827-ed2c-9069a6dc6734-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-03-03 14:48               ` Emil Velikov
2017-03-01  6:52       ` zhoucm1
     [not found]         ` <58B66FB8.8050300-5C7GfCeVMHo@public.gmane.org>
2017-03-01  7:09           ` zhoucm1
     [not found]             ` <58B673C0.4070006-5C7GfCeVMHo@public.gmane.org>
2017-03-01 11:51               ` Emil Velikov
2017-02-28 22:14   ` [PATCH 19/22] drm/amdgpu: add framework for HW specific priority settings Andres Rodriguez
     [not found]     ` <1488320089-22035-20-git-send-email-andresx7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-03-01  7:27       ` zhoucm1
     [not found]         ` <58B677DD.4070408-5C7GfCeVMHo@public.gmane.org>
2017-03-01 15:49           ` Alex Deucher
     [not found]             ` <CADnq5_NhLAOsR7tHhRZRzA12j_-5MWFEXfWeGqKmSifHp_5jKg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-01 17:44               ` Andres Rodriguez
     [not found]                 ` <f0de5e4f-bf94-9222-cc9e-1d535c228b0a-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-03-02  6:45                   ` Andres Rodriguez
2017-02-28 22:14   ` [PATCH 20/22] drm/amdgpu: implement ring set_priority for gfx_v8 compute Andres Rodriguez
2017-02-28 22:14   ` [PATCH 21/22] drm/amdgpu: condense mqd programming sequence Andres Rodriguez
2017-02-28 22:14   ` [PATCH 22/22] drm/amdgpu: workaround tonga HW bug in HQD " Andres Rodriguez
2017-03-01 11:42   ` Christian König [this message]
     [not found]     ` <25194b1a-4756-e1ad-f597-17063a14eb4c-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-03-01 17:13       ` Add support for high priority scheduling in amdgpu Andres Rodriguez
     [not found]         ` <ddeb4a53-ec4f-9a87-9323-897c571b1634-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-03-01 17:24           ` Andres Rodriguez
     [not found]             ` <4c908b1f-fcb2-7d89-026a-76fd3f4f1f22-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-03-02 11:00               ` Christian König
2017-03-01 16:14   ` Bridgman, John
     [not found]     ` <BN6PR12MB1348B8F1F537321557D522AFE8290-/b2+HYfkarQX0pEhCR5T8QdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-03-01 16:37       ` Andres Rodriguez

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=25194b1a-4756-e1ad-f597-17063a14eb4c@vodafone.de \
    --to=deathsimple-antagkrnahcb1svskn2v4q@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=andresx7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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.