From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mga04.intel.com ([192.55.52.120]:56177 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750715AbdI2MeY (ORCPT ); Fri, 29 Sep 2017 08:34:24 -0400 Message-ID: <1506688459.4729.88.camel@linux.intel.com> Subject: Re: [PATCH] dma-fence: fix dma_fence_get_rcu_safe From: Joonas Lahtinen To: Daniel Vetter , Christian =?ISO-8859-1?Q?K=F6nig?= Cc: Chris Wilson , Daniel Vetter , Sumit Semwal , "linux-media@vger.kernel.org" , dri-devel , "linaro-mm-sig@lists.linaro.org" , Maarten Lankhorst , Gustavo Padovan , Tvrtko Ursulin , Chris Wilson Date: Fri, 29 Sep 2017 15:34:19 +0300 In-Reply-To: References: <1504531653-13779-1-git-send-email-deathsimple@vodafone.de> <150453243791.23157.6907537389223890207@mail.alporthouse.com> <67fe7e05-7743-40c8-558b-41b08eb986e9@amd.com> <150512037119.16759.472484663447331384@mail.alporthouse.com> <3c412ee3-854a-292a-e036-7c5fd7888979@amd.com> <150512178199.16759.73667469529688@mail.alporthouse.com> <5ff4b100-b580-a93d-aa5e-c66173ac091d@amd.com> <150512410278.16759.10537429613477592631@mail.alporthouse.com> <79e447f8-f2e3-57e3-b5fe-503e5feb2f82@amd.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-media-owner@vger.kernel.org List-ID: On Wed, 2017-09-20 at 20:20 +0200, Daniel Vetter wrote: > On Mon, Sep 11, 2017 at 01:06:32PM +0200, Christian König wrote: > > Am 11.09.2017 um 12:01 schrieb Chris Wilson: > > > [SNIP] > > > > Yeah, but that is illegal with a fence objects. > > > > > > > > When anybody allocates fences this way it breaks at least > > > > reservation_object_get_fences_rcu(), > > > > reservation_object_wait_timeout_rcu() and > > > > reservation_object_test_signaled_single(). > > > > > > Many, many months ago I sent patches to fix them all. > > > > Found those after a bit a searching. Yeah, those patches where proposed more > > than a year ago, but never pushed upstream. > > > > Not sure if we really should go this way. dma_fence objects are shared > > between drivers and since we can't judge if it's the correct fence based on > > a criteria in the object (only the read counter which is outside) all > > drivers need to be correct for this. > > > > I would rather go the way and change dma_fence_release() to wrap > > fence->ops->release into call_rcu() to keep the whole RCU handling outside > > of the individual drivers. > > Hm, I entirely dropped the ball on this, I kinda assumed that we managed > to get some agreement on this between i915 and dma_fence. Adding a pile > more people. > > Joonas, Tvrtko, I guess we need to fix this one way or the other. I definitely didn't get the memo or notice this before. Tvrtko/Chris? Regars, Joonas -- Joonas Lahtinen Open Source Technology Center Intel Corporation