All of lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH igt v2] tests/kms_cursor_legacy: Boost timing sensitive subtests to RT prio
Date: Mon, 12 Sep 2016 23:57:54 +0300	[thread overview]
Message-ID: <1473713874.10939.40.camel@intel.com> (raw)
In-Reply-To: <20160912200444.GB25084@nuc-i3427.alporthouse.com>

On Mon, 2016-09-12 at 21:04 +0100, Chris Wilson wrote:
> On Mon, Sep 12, 2016 at 05:47:57PM +0300, Imre Deak wrote:
> > Even in an otherwise quiescent system there may be user/kernel
> > threads
> > independent of the test that add enough latency to make timing
> > sensitive
> > subtests fail. Boost the priority of such subtests to avoid these
> > failures.
> > 
> > This got rid of sporadic failures in basic-cursor-vs-flip-legacy
> > and
> > basic-cursor-vs-flip-varying-size with 'missed 1 frame' error
> > message
> > APL and BSW.
> > 
> > v2:
> > - Boost the priority in flip_vs_cursor_crc() too.
> > 
> > CC: Chris Wilson <chris@chris-wilson.co.uk>
> > CC: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> 
> But we shouldn't need to. The basic test is:
> 
> 	align to vblank
> 	request non-blocking flip
> 	update cursor

In these subtests we run these cursor updates in a loop.

> 	check vblank hasn't advanced
> 
> We are not doing any busy loops here and there should be nothing else
> running on the system. So what caused the context switch? Who are we
> fighting against?

The cursor thread is one source for the delay, other than that it could
be anything running in the background. In my traces it looked like
something related to CI remote logging that caused >16ms delay for both
the user flip thread and the subsequent MMIO work. Imo there is no
guarantee that such delays won't happen between threads running at the
same priority, hence the need for higher priority for timing sensitive
stuff. Note that we see this problem on BSW with with 2 CPUs.

> If the only thing that is causing the issue is the
> kernel thread used for the mmioflip (which won't be scheduled for
> another 16ms until the next vblank), we have another bug to track
> down.

The MMIO flip work is scheduled right after we request the flip (since
we do the request after the previous flip completed) and I saw it being
delayed >16ms for the above reasons. Besides this I also saw the user
space flip thread being delayed the same way.

> Imo, this patch is just papering over an issue that as it stands will
> be
> present in real userspace (i.e. causing jerkiness in X, weston, cros
> etc).

I can't see any other way than adjusting priorities to guarantee the
timely completion of some work. Otherwise you'll only get best effort
scheduling and that doesn't seem to be enough in these subtests.

--Imre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-09-12 20:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 14:09 [PATCH igt] tests/kms_cursor_legacy: Boost timing sensitive subtests to RT prio Imre Deak
2016-09-12 14:47 ` [PATCH igt v2] " Imre Deak
2016-09-12 20:04   ` Chris Wilson
2016-09-12 20:57     ` Imre Deak [this message]
2016-09-13  7:38       ` Chris Wilson
2016-09-13 11:14         ` Imre Deak

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=1473713874.10939.40.camel@intel.com \
    --to=imre.deak@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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 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.