From mboxrd@z Thu Jan 1 00:00:00 1970 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 035CCC54E58 for ; Thu, 21 Mar 2024 11:38:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A87CC10E7D4; Thu, 21 Mar 2024 11:38:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="kJCvhePC"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id A3E4C10E437 for ; Thu, 21 Mar 2024 11:37:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711021071; x=1742557071; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=THBbiZxacD0jgz9lr8z/10+g5XyzT8usmHBzOA2ZjdU=; b=kJCvhePCLErLdqJ1VLcxO8QDHfe16k4j49KzHkJuhgjPtzq752zQQRXW 76ZIin9OxK0r77ecoL77wfgTOEaR05Kx/wsRDloVwXIUc4hUmHX5kbkG7 u3cDgmDnbjQn5Ow3zfTcgjcQrkpzjAKOS0I+Rm8WtK0HUhFJuJVpT4PJs Ik7xmThIsltyO5E2CLtPHc1NNTcunrAT+MDxuImnHl4b1KsNG2+jp3SCl y7wIVOsMcBQRe0jomiXpEHiC5FWKglr6jRSqTEnnhPE308lgAyZ6R5p6k Obvj77L+KZZZy/RLSQP2B3fJAf167oh6o9oaPRjXxWqgYLo0klwGObfqN Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11019"; a="6127369" X-IronPort-AV: E=Sophos;i="6.07,142,1708416000"; d="scan'208";a="6127369" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2024 04:37:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,142,1708416000"; d="scan'208";a="19053301" Received: from dinieasx-mobl1.gar.corp.intel.com (HELO fedora..) ([10.249.254.100]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2024 04:37:49 -0700 From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= To: intel-xe@lists.freedesktop.org Cc: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Rodrigo Vivi , Matthew Brost , Lucas De Marchi , Oded Gabbay Subject: [PATCH 7/7] drm/xe/bo: Allow eviction of unbound local bos Date: Thu, 21 Mar 2024 12:37:20 +0100 Message-ID: <20240321113720.120865-12-thomas.hellstrom@linux.intel.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240321113720.120865-1-thomas.hellstrom@linux.intel.com> References: <20240321113720.120865-1-thomas.hellstrom@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" Local bos that don't have any gpu_vmas set up are allowed to be evicted. Support that. Fixes: 24f947d58fe5 ("drm/xe: Use DRM GPUVM helpers for external- and evicted objects") Cc: Thomas Hellström Cc: Rodrigo Vivi Cc: Matthew Brost Cc: Lucas De Marchi Cc: Oded Gabbay Signed-off-by: Thomas Hellström --- drivers/gpu/drm/xe/xe_bo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c index db4cd1da8ef3..87e6aff52ca6 100644 --- a/drivers/gpu/drm/xe/xe_bo.c +++ b/drivers/gpu/drm/xe/xe_bo.c @@ -1029,10 +1029,14 @@ static bool xe_bo_eviction_valuable(struct ttm_buffer_object *ttm_bo, if (vm && !drm_gpuvm_is_extobj(&vm->gpuvm, &ttm_bo->base) && vm->is_validating) { xe_vm_assert_held(vm); + /* Not bound to the vm? */ + if (list_empty(&ttm_bo->base.gpuva.list)) + goto allow; return false; } } +allow: return ttm_bo_eviction_valuable(ttm_bo, place); } -- 2.44.0