All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nicolai Hähnle" <nhaehnle-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Andres Rodriguez
	<andresx7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amdgpu: add parameter to allocate high priority contexts v8
Date: Tue, 25 Apr 2017 20:01:40 +0200	[thread overview]
Message-ID: <2c2a2270-5c75-fa9f-b0f9-7af68348bc7e@gmail.com> (raw)
In-Reply-To: <20170424162015.3206-2-andresx7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On 24.04.2017 18:20, Andres Rodriguez wrote:
> Add a new context creation parameter to express a global context priority.
>
> The priority ranking in descending order is as follows:
>  * AMDGPU_CTX_PRIORITY_HIGH
>  * AMDGPU_CTX_PRIORITY_NORMAL
>  * AMDGPU_CTX_PRIORITY_LOW
>
> The driver will attempt to schedule work to the hardware according to
> the priorities. No latency or throughput guarantees are provided by
> this patch.
>
> This interface intends to service the EGL_IMG_context_priority
> extension, and vulkan equivalents.
>
> v2: Instead of using flags, repurpose __pad
> v3: Swap enum values of _NORMAL _HIGH for backwards compatibility
> v4: Validate usermode priority and store it
> v5: Move priority validation into amdgpu_ctx_ioctl(), headline reword
> v6: add UAPI note regarding priorities requiring CAP_SYS_ADMIN
> v7: remove ctx->priority
> v8: added AMDGPU_CTX_PRIORITY_LOW, s/CAP_SYS_ADMIN/CAP_SYS_NICE
 >
> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
> Reviewed-by: Christian König <christian.koenig@amd.com>
> Signed-off-by: Andres Rodriguez <andresx7@gmail.com>

I didn't follow all the discussion, so feel free to shut me up if this 
has already been discussed, but...


[snip]
> +/* Context priority level */
> +#define AMDGPU_CTX_PRIORITY_NORMAL	0
> +#define AMDGPU_CTX_PRIORITY_LOW		1
> +/* Selecting a priority above NORMAL requires CAP_SYS_ADMIN */
> +#define AMDGPU_CTX_PRIORITY_HIGH	2
> +#define AMDGPU_CTX_PRIORITY_NUM		3

I get that normal priority needs to be 0 for backwards compatibility, 
but having LOW between NORMAL and HIGH is still odd. Have you considered 
using signed integers as a way to fix that?

(AMDGPU_CTX_PRIORITY_NUM doesn't seem to be used anywhere...)

Cheers,
Nicolai


> +
>  struct drm_amdgpu_ctx_in {
>  	/** AMDGPU_CTX_OP_* */
>  	__u32	op;
>  	/** For future use, no flags defined so far */
>  	__u32	flags;
>  	__u32	ctx_id;
> -	__u32	_pad;
> +	__u32	priority;
>  };
>
>  union drm_amdgpu_ctx_out {
>  		struct {
>  			__u32	ctx_id;
>  			__u32	_pad;
>  		} alloc;
>
>  		struct {
>  			/** For future use, no flags defined so far */
>  			__u64	flags;
>  			/** Number of resets caused by this context so far. */
>  			__u32	hangs;
>  			/** Reset status since the last call of the ioctl. */
>  			__u32	reset_status;
>  		} state;
>  };
>
>  union drm_amdgpu_ctx {
>  	struct drm_amdgpu_ctx_in in;
>


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-04-25 18:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-24 16:20 [PATCH] Interface changes for prioritized contexts amd-staging-4.9 Andres Rodriguez
     [not found] ` <20170424162015.3206-1-andresx7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-24 16:20   ` [PATCH] drm/amdgpu: add parameter to allocate high priority contexts v8 Andres Rodriguez
     [not found]     ` <20170424162015.3206-2-andresx7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-25 18:01       ` Nicolai Hähnle [this message]
     [not found]         ` <2c2a2270-5c75-fa9f-b0f9-7af68348bc7e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-25 20:28           ` Andres Rodriguez
     [not found]             ` <f5b65546-d3a6-ec1c-aa73-ad0c205f5caa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-25 22:21               ` Alex Deucher
     [not found]                 ` <CADnq5_M-p8TUiD_RdJSz_K68S+svwhWsaBUM+u9V23PP5VKDWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-25 22:26                   ` 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=2c2a2270-5c75-fa9f-b0f9-7af68348bc7e@gmail.com \
    --to=nhaehnle-re5jqeeqqe8avxtiumwx3w@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.