public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] lib: Use read() for timerfd timeout detection
Date: Wed, 15 Apr 2020 11:04:08 -0700	[thread overview]
Message-ID: <87k12g4odj.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20200415143900.2927491-1-chris@chris-wilson.co.uk>

On Wed, 15 Apr 2020 07:39:00 -0700, Chris Wilson wrote:
>
> The poll() is proving unreliable, where our tests timeout without the
> spinner being terminated. Let's try a blocking read instead!
>
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1676
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>


Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>


> ---
>  lib/igt_dummyload.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> index 99ca84ad8..ae0fb9378 100644
> --- a/lib/igt_dummyload.c
> +++ b/lib/igt_dummyload.c
> @@ -399,14 +399,14 @@ igt_spin_factory(int fd, const struct igt_spin_factory *opts)
>  static void *timer_thread(void *data)
>  {
>	igt_spin_t *spin = data;
> -	struct pollfd pfd = {
> -		.fd = spin->timerfd,
> -		.events = POLLIN,
> -	};
> +	uint64_t overruns = 0;
>
> -	if (poll(&pfd, 1, -1) >= 0)
> -		igt_spin_end(spin);
> +	/* Wait until we see the timer fire, or we get cancelled */
> +	do {
> +		read(spin->timerfd, &overruns, sizeof(overruns));
> +	} while (!overruns);
>
> +	igt_spin_end(spin);
>	return NULL;
>  }
>
> --
> 2.26.0
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2020-04-15 18:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14 19:05 [igt-dev] [PATCH i-g-t] lib: Use read() for timerfd timeout detection Chris Wilson
2020-04-14 19:58 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-04-14 21:37 ` [igt-dev] [Intel-gfx] [PATCH i-g-t] " Dixit, Ashutosh
2020-04-14 21:54   ` Chris Wilson
2020-04-15 11:57 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork
2020-04-15 12:54 ` [igt-dev] [PATCH i-g-t] " Chris Wilson
2020-04-15 13:36 ` [igt-dev] ✗ Fi.CI.BUILD: failure for lib: Use read() for timerfd timeout detection (rev2) Patchwork
2020-04-15 13:39 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
2020-04-15 14:39 ` [igt-dev] [PATCH i-g-t] lib: Use read() for timerfd timeout detection Chris Wilson
2020-04-15 18:04   ` Dixit, Ashutosh [this message]
2020-04-15 15:16 ` [igt-dev] ✓ Fi.CI.BAT: success for lib: Use read() for timerfd timeout detection (rev3) Patchwork
2020-04-16 10:55 ` [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=87k12g4odj.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@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