[Intel-gfx] -ERESTARTSYS on ioctl

Peter Clifton pcjc2 at cam.ac.uk
Wed Jan 6 20:10:12 CET 2010


I've got this in my dmesg output:

[ 3341.199958] [drm:i915_gem_execbuffer] *ERROR* i915_gem_do_execbuffer
returns -512

Tracking it down, it seems -512 is -ERESTARTSYS


Should that be handled as a somewhere? Most cases seem to special case
it as "not an error".

I'm not sure how ERESTARTSYS is (or should be handled), but after using
Google, I infer that it means something to do with the kernel
auto-magically restarting an interrupted system call, but that if it
cannot, it ends up converted to an EINTR returned to userspace.

In i915_gem_execbuffer(), i915_gem_do_execbuffer() returning ERESTARTSYS
isn't caught explicitly, so the routine goes on to free exec_list and
exec2_list. Does that cause any issue with a potential automatic restart
of the original system call?


I'm using Ubuntu xorg-edgers drm, which is git HEAD, plus a revert of
"intel: Repeat execbuffer after EINTR". Is reverting this a good idea?

I'm just wondering if ERESTARTSYS needs to feature somewhere as well.


>From 7dc62a60d9b014254f2e80852baa05d8c47c3042 Mon Sep 17 00:00:00 2001
From: Robert Hooker <sarvatt at ubuntu.com>
Date: Mon, 28 Dec 2009 09:53:38 -0500
Subject: [PATCH 2/2] Revert "intel: Repeat execbuffer after EINTR"

This reverts commit b73612e4fd69565aa2c5c2e9677f3e0af1945f7d.
---
 intel/intel_bufmgr_gem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index b306e5d..592965e 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -1300,7 +1300,7 @@ drm_intel_gem_bo_exec(drm_intel_bo *bo, int used,
                ret = ioctl(bufmgr_gem->fd,
                            DRM_IOCTL_I915_GEM_EXECBUFFER,
                            &execbuf);
-       } while (ret != 0 && errno == EINTR);
+       } while (ret != 0 && errno == EAGAIN);
 
        if (ret != 0) {
                ret = -errno;
-- 
1.6.5


Regards

Peter C.




More information about the Intel-gfx mailing list