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 E79A7CA0EED for ; Thu, 28 Aug 2025 15:42:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AE4EA10EA41; Thu, 28 Aug 2025 15:42:47 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="EAbuUANt"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id B0C5310EA48 for ; Thu, 28 Aug 2025 15:42:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1756395767; x=1787931767; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=qprB/o4Qkb2sysLdY6jjSZz/BY9rfxYAbw4wHDuVqUE=; b=EAbuUANth/A2LEBkVYUPRrhFySkboUl0q/Zo7QQQ/4PVX0PEVIDaMJMA /srlGuSLe4kVPI0MpNKQ1R2FfUNp9HlLAYEcGCZzfriGP/6pJx40b73r3 RUAcQ2J/qnScQs158rHOw25UQMOKVWkSB0JLJGX9J7zsctfJljJDHRKjY 6GhfoVeh8dwiLIw+eTcoIXd0waibvu9uCVd+sL/GtLF1WxAeTk9+3nzjU 98scYBX4qxJpxpTCariXkSSuze4rYEw1lbZTkgezVHa0sqH1gQpBGkqWr pyXrAjLMXhyHkVIX3iFsATmwSlW5glmCu1Tvi38GKd1IKaowGOqosHfSk w==; X-CSE-ConnectionGUID: UFm8E044Sp6P1qjdR+vXuA== X-CSE-MsgGUID: 9B3iPwfHQ/uw4J/3DlLB2g== X-IronPort-AV: E=McAfee;i="6800,10657,11531"; a="58736227" X-IronPort-AV: E=Sophos;i="6.17,312,1747724400"; d="scan'208";a="58736227" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2025 08:42:47 -0700 X-CSE-ConnectionGUID: /+2DW8wZQkytX9+27IPMzw== X-CSE-MsgGUID: szpwvT95Q/qPXASOs5XJAg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,217,1751266800"; d="scan'208";a="207289109" Received: from pgcooper-mobl3.ger.corp.intel.com (HELO fedora) ([10.245.245.28]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2025 08:42:44 -0700 From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= To: intel-xe@lists.freedesktop.org Cc: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Matthew Brost , Matthew Auld , stable@vger.kernel.org Subject: [PATCH] drm/xe: Attempt to bring bos back to VRAM after eviction Date: Thu, 28 Aug 2025 17:42:19 +0200 Message-ID: <20250828154219.4889-1-thomas.hellstrom@linux.intel.com> X-Mailer: git-send-email 2.50.1 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" VRAM+TT bos that are evicted from VRAM to TT may remain in TT also after a revalidation following eviction or suspend. This manifests itself as applications becoming sluggish after buffer objects get evicted or after a resume from suspend or hibernation. If the bo supports placement in both VRAM and TT, and we are on DGFX, mark the TT placement as fallback. This means that it is tried only after VRAM + eviction. This flaw has probably been present since the xe module was upstreamed but use a Fixes: commit below where backporting is likely to be simple. For earlier versions we need to open- code the fallback algorithm in the driver. Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/5995 Fixes: a78a8da51b36 ("drm/ttm: replace busy placement with flags v6") Cc: Matthew Brost Cc: Matthew Auld Cc: # v6.9+ Signed-off-by: Thomas Hellström --- drivers/gpu/drm/xe/xe_bo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c index 4faf15d5fa6d..64dea4e478bd 100644 --- a/drivers/gpu/drm/xe/xe_bo.c +++ b/drivers/gpu/drm/xe/xe_bo.c @@ -188,6 +188,8 @@ static void try_add_system(struct xe_device *xe, struct xe_bo *bo, bo->placements[*c] = (struct ttm_place) { .mem_type = XE_PL_TT, + .flags = (IS_DGFX(xe) && (bo_flags & XE_BO_FLAG_VRAM_MASK)) ? + TTM_PL_FLAG_FALLBACK : 0, }; *c += 1; } -- 2.50.1