From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Anton V. Boyarshinov" Subject: Re: [PATCH] xf86drm.c: add counter for ioctl restarting Date: Mon, 16 Apr 2012 12:45:40 +0400 Message-ID: <20120416124540.5de0b8c2@boyarsh.office.altlinux.ru> References: <20120413172642.4c423352@boyarsh.office.altlinux.ru> <1334324469_408990@CP5-2952> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from vint.altlinux.org (vint.altlinux.org [194.107.17.35]) by gabe.freedesktop.org (Postfix) with ESMTP id 481229E7B5 for ; Mon, 16 Apr 2012 01:45:46 -0700 (PDT) In-Reply-To: <1334324469_408990@CP5-2952> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Chris Wilson Cc: DRI mailing list List-Id: dri-devel@lists.freedesktop.org Hello > > It seems, that limiting ioctl restarting by some resonable number of trys > > is a dirty but working way to prevent Xorg lockups. > > And you have audited all callpaths to make sure that they can handle > EINTR? Up until now it was part of the libdrm api that it did not return > EINTR... Speaking strictly no but this code works fine on my Nvidia ION box with nouveau about a 4 monthes without user-visible problems. It also have some logging code that shows that all ioctls which have been restarted more then 5 times are restarting forewer (actually 100 times), but this logging code really unpstreamable. > From my naive pov, we could just fix the root cause of the bug rather > than escalating the bug into a random failure. Yes. This is a dirty trick. But from the user scope, Xorg lockup is a nasty thing. I have some lockups in a day a year ago, then some bugs was fixed and a have some lockups in a week. Better, but not so good. With this patch i have no lockups. And, from the other side, this patch can be a tool for finding real bugs if someone add proper logging to if (i don't know the right way to log problems from libdrm) with ioctl, parameters and restart count. Users will be able to add this informaition to the bugreports without accessing by network to locked box. Regards Anton