Date: Sat, 12 Mar 2016 16:27:11 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Jean-S??bastien P??dron <dumbbell@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296720 - head/sys/dev/drm2/i915 Message-ID: <20160312142711.GG1741@kib.kiev.ua> In-Reply-To: <201603121154.u2CBswhx034030@repo.freebsd.org> References: <201603121154.u2CBswhx034030@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Mar 12, 2016 at 11:54:58AM +0000, Jean-S??bastien P??dron wrote: > Author: dumbbell > Date: Sat Mar 12 11:54:58 2016 > New Revision: 296720 > URL: https://svnweb.freebsd.org/changeset/base/296720 > > Log: > drm/i915: Fix page fault handler failure > > ... when __wait_seqno() is interrupted by a signal. In this case, > __wait_seqno() returns -ERESTARTSYS. Like we already do in drm_ioctl(), > we need to convert this error to a common code such as -EINTR, so the > page fault handler is restarted. > > Reported by: Frederic Chardon <chardon.frederic@gmail.com> > Tested by: Frederic Chardon <chardon.frederic@gmail.com> > > Modified: > head/sys/dev/drm2/i915/i915_gem.c > > Modified: head/sys/dev/drm2/i915/i915_gem.c > ============================================================================== > --- head/sys/dev/drm2/i915/i915_gem.c Sat Mar 12 09:44:23 2016 (r296719) > +++ head/sys/dev/drm2/i915/i915_gem.c Sat Mar 12 11:54:58 2016 (r296720) > @@ -1619,6 +1619,13 @@ out: > KASSERT(ret != 0, ("i915_gem_pager_fault: wrong return")); > CTR4(KTR_DRM, "fault_fail %p %jx %x err %d", gem_obj, offset, prot, > -ret); > + if (ret == -ERESTARTSYS) { > + /* > + * NOTE Linux<->FreeBSD: Convert Linux' -ERESTARTSYS to > + * the more common -EINTR, so the page fault is retried. > + */ > + ret = -EINTR; > + } > if (ret == -EAGAIN || ret == -EIO || ret == -EINTR) { > kern_yield(PRI_USER); > goto retry; It may be that the time come to remove i915_intr_pf tunable, and always take device lock non-interruptible in i915 fault handler. TTM behaves that way, and I think that situations where I used interruptible page handlers, AFAIR to kill X or other gem clients in case of OOM, really not useful to users.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160312142711.GG1741>