Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6CDD6C00528 for ; Thu, 3 Aug 2023 09:49:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B8D0A10E1EC; Thu, 3 Aug 2023 09:49:06 +0000 (UTC) Received: from mgamail.intel.com (unknown [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2C9FC10E0F5 for ; Thu, 3 Aug 2023 09:49:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691056143; x=1722592143; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=DLStnBmLeNixZoWVaOC3V/JqnJFCzEjCSx9yi6N6KgQ=; b=lhLTsOo9P+xM/YWYcsA/lXxRvZlBzfF7VP2SOI5Wew35PkAhmjL0Wv7c 0knUmwW1Jinh0LG2K8Ce3cvWs/Xj/Ttp1lU0dcZWtGuFc057zFqkZ//8u G4ysu5tW/ax02EUckt/ee6vhWjGQKbT9BG2JINLH+KFLrqvtkpmyfjvmE UvE/J9kUImU1elGjz8f4uJid+N6JRhWZ0UP/YRGTDTENC3NwVhL3RSm/D kzJJtz/bn2qJXQbqXOEUWMrSFBeShScpSYfOHaJIEqAn/OOTxTHbEa0nm 24LK+DdYFmVe2CRHCEIOWO1B9oA42iocWc/aDIyIHZtsml9K6RlZJOoBl Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="436137464" X-IronPort-AV: E=Sophos;i="6.01,251,1684825200"; d="scan'208";a="436137464" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2023 02:49:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="723160433" X-IronPort-AV: E=Sophos;i="6.01,251,1684825200"; d="scan'208";a="723160433" Received: from unknown (HELO intel.com) ([10.249.39.40]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2023 02:49:01 -0700 Date: Thu, 3 Aug 2023 11:48:58 +0200 From: Andi Shyti To: Andrzej Hajda Message-ID: References: <20230728075450.1877745-1-andrzej.hajda@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230728075450.1877745-1-andrzej.hajda@intel.com> Subject: Re: [Intel-gfx] [PATCH] drm/i915: Hold reference to intel_context over life of i915_request X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, Chris Wilson , Nirmoy Das Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Hi Andrzej, On Fri, Jul 28, 2023 at 09:54:50AM +0200, Andrzej Hajda wrote: > References to i915_requests may be trapped by userspace inside a > sync_file or dmabuf (dma-resv) and held indefinitely across different > proceses. To counter-act the memory leaks, we try to not to keep nit: lose one of the "to"'s :) > references from the request past their completion. > On the other side on fence release we need to know if rq->engine > is valid and points to hw engine (true for non-virtual requests). > To make it possible extra bit has been added to rq->execution_mask, > for marking virtual engines. > > Fixes: bcb9aa45d5a0 ("Revert "drm/i915: Hold reference to intel_context over life of i915_request"") > Signed-off-by: Chris Wilson > Signed-off-by: Andrzej Hajda Reviewed-by: Andi Shyti Thanks, Andi