From: Eric Anholt <eric@anholt.net>
To: Lucas Stach <l.stach@pengutronix.de>, dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] drm/v3d: Delay the scheduler timeout if we're still making progress.
Date: Thu, 05 Jul 2018 09:59:08 -0700 [thread overview]
Message-ID: <87k1q97h5v.fsf@anholt.net> (raw)
In-Reply-To: <1530788347.15725.2.camel@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 1757 bytes --]
Lucas Stach <l.stach@pengutronix.de> writes:
> Am Dienstag, den 03.07.2018, 10:05 -0700 schrieb Eric Anholt:
>> GTF-GLES2.gtf.GL.acos.acos_float_vert_xvary submits jobs that take 4
>> seconds at maximum resolution, but we still want to reset quickly if a
>> job is really hung. Sample the CL's current address and the return
>> address (since we call into tile lists repeatedly) and if either has
>> changed then assume we've made progress.
>
> So this means you are doubling your timeout? AFAICS for the first time
> you hit the timeout handler the cached ctca and ctra values will
> probably always differ from the current values. Maybe this warrants a
> mention in the commit message, as it's changing the behavior of the
> scheduler timeout.
I supposes that doubles the minimum timeout, but I don't think there's
any principled choice behind that value.
> Also how easy is it for userspace to construct such an infinite loop in
> the CL? Thinking about a rogue client DoSing the GPU while exploiting
> this check in the timeout handler to stay under the radar...
You'd need to have a big enough CL that you don't sample the same
location twice in a row, but otherwise it's trivial and equivalent to a
V3D33 igt case I wrote. I don't think we as the kernel particularly
cares to protect from that case, though -- it's mainly "does a broken
WebGL shader take down your desktop?" which we will still be protecting
from. If you wanted to protect from a general userspace attacker, you
could have a maximum 1 minute timeout or something, but I'm not sure
your life is actually much better when you let an arbitrary number of
clients submit many jobs to round-robin through each of which has a long
timeout like that.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2018-07-05 16:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-03 17:05 Eric Anholt
2018-07-03 17:05 ` [PATCH 2/4] drm/v3d: Remove unnecessary dma_fence_ops Eric Anholt
2018-07-03 17:05 ` [PATCH 3/4] drm/v3d: Add missing v3d documentation structure Eric Anholt
2018-07-03 17:05 ` [PATCH 4/4] drm/v3d: Fix a grammar nit in the scheduler docs Eric Anholt
2018-07-03 20:45 ` [PATCH 1/4] drm/v3d: Delay the scheduler timeout if we're still making progress Alex Deucher
2018-07-04 8:31 ` Daniel Vetter
2018-07-05 10:59 ` Lucas Stach
2018-07-05 16:59 ` Eric Anholt [this message]
2018-07-06 10:03 ` Lucas Stach
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=87k1q97h5v.fsf@anholt.net \
--to=eric@anholt.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=l.stach@pengutronix.de \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®