public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [Intel-gfx] [PATCH i-g-t] i915: Use O_NONBLOCK for faster ringsize probing
Date: Fri, 11 Oct 2019 09:25:14 +0100	[thread overview]
Message-ID: <433b70c0-12f9-27fa-9c3d-447247b3d563@linux.intel.com> (raw)
In-Reply-To: <20191011080642.23061-1-chris@chris-wilson.co.uk>


On 11/10/2019 09:06, Chris Wilson wrote:
> When the kernel supports O_NONBLOCK reporting of a full execbuf queue,
> take advantage of that to immediately report when the output would block
> due to the ring being full.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   lib/i915/gem_ring.c | 13 ++++++++++---
>   1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/i915/gem_ring.c b/lib/i915/gem_ring.c
> index 9f099edff..5ca2a728b 100644
> --- a/lib/i915/gem_ring.c
> +++ b/lib/i915/gem_ring.c
> @@ -21,6 +21,7 @@
>    * IN THE SOFTWARE.
>    */
>   
> +#include <fcntl.h>
>   #include <signal.h>
>   #include <sys/ioctl.h>
>   #include <sys/time.h>
> @@ -89,11 +90,16 @@ __gem_measure_ring_inflight(int fd, unsigned int engine, enum measure_ring_flags
>   
>   	count = 0;
>   	do {
> -		if (__execbuf(fd, &execbuf) == 0) {
> +		int err = __execbuf(fd, &execbuf);
> +
> +		if (err == 0) {
>   			count++;
>   			continue;
>   		}
>   
> +		if (err == -EWOULDBLOCK)
> +			break;
> +
>   		if (last[1] == count)
>   			break;
>   
> @@ -102,8 +108,6 @@ __gem_measure_ring_inflight(int fd, unsigned int engine, enum measure_ring_flags
>   		last[1] = last[0];
>   		last[0] = count;
>   	} while (1);
> -
> -	igt_assert_eq(__execbuf(fd, &execbuf), -EINTR);
>   	igt_assert(count > 2);
>   
>   	memset(&itv, 0, sizeof(itv));
> @@ -145,6 +149,9 @@ gem_measure_ring_inflight(int fd, unsigned int engine, enum measure_ring_flags f
>   
>   	fd = gem_reopen_driver(fd);
>   
> +	/* When available, disable execbuf throttling */
> +	fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | O_NONBLOCK);
> +
>   	if (engine == ALL_ENGINES) {
>   		for_each_physical_engine(fd, engine) {
>   			unsigned int count =
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-10-11  8:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11  8:06 [igt-dev] [PATCH i-g-t] i915: Use O_NONBLOCK for faster ringsize probing Chris Wilson
2019-10-11  8:25 ` Tvrtko Ursulin [this message]
2019-10-11  8:50 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-10-11 15:51 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=433b70c0-12f9-27fa-9c3d-447247b3d563@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox