From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Hellstrom Subject: Re: GEM - radeon cs ioctl deadlock Date: Mon, 18 Oct 2010 17:16:07 +0200 Message-ID: <4CBC64B7.7000200@shipmail.org> References: <1287008098.4928.9.camel@clockmaker-el6> <1287020839.812.2.camel@nisroch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from smtp-outbound-2.vmware.com (smtp-outbound-2.vmware.com [65.115.85.73]) by gabe.freedesktop.org (Postfix) with ESMTP id 85ABC9E7A9 for ; Mon, 18 Oct 2010 08:16:09 -0700 (PDT) Received: from mailhost2.vmware.com (mailhost2.vmware.com [10.16.67.167]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 37AFE140D3 for ; Mon, 18 Oct 2010 08:16:09 -0700 (PDT) Received: from linlap1.home.shipmail.org (sslvpn-dhcp20.eng.vmware.com [10.20.254.20]) by mailhost2.vmware.com (Postfix) with ESMTP id 31F148E8F2 for ; Mon, 18 Oct 2010 08:16:07 -0700 (PDT) In-Reply-To: <1287020839.812.2.camel@nisroch> 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: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On 10/14/2010 03:47 AM, Ben Skeggs wrote: > On Thu, 2010-10-14 at 08:14 +1000, Dave Airlie wrote: > >> On Wed, 2010-10-13 at 17:57 -0400, Jerome Glisse wrote: >> >>> So we are facing a deadlock with the radeon cs ioctl. When a buffer is given >>> a name (with flink) we could endup with 2 handle pointing to the same >>> object (flink object and open it from same file descriptor). Would it be ok >>> if i change gem open to first look if we already have an handle for the >>> object and to use that handle instead of creating a new one ? Or could >>> this break intel driver ? >>> >> I think r300g worked around this already, maybe we should just avoid >> doing it from userspace if possible. >> > We had this in nouveau at some point. In the end, I prevented the > deadlock from occuring by checking that a process doesn't reserve the > same buffer twice (we store file_priv in a reserved_by field in the bo > as we reserve the buffers), and then just fixed userspace. > > Ben. > >> Hi, Ben, Without knowing the exact details, that sounds a little dangerous? It would be better to use a process identifier rather than a file identifier since multiple threads in a single client can and should use the same file descriptor. /Thomas >> Dave. >> >> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/dri-devel >> > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel >