From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DC3684E0E; Tue, 7 May 2024 22:59:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715122771; cv=none; b=mlObajlIa/qGTdJzzoFwri3eItdi+v8r4RZ7rqCM+D+gbdykULCV5iEwwGQofdaeIlTphNbQ8mXBWlSOzfwNTPTkD4oEFIt27/Ua8QNjCBba/Cv9393sp+ydrXcsYoK7XqDXIUqa8LLVlJ/x5dxRjoQ+4tdWCKEjgxUzn3haYZ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715122771; c=relaxed/simple; bh=HvV+pVVFFLbbX4ltkN3w+EWnX6aqtF6HzprSpkb0SWI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=vF+OsZlQK1f1HsA7pH64XktRJpfCPt9GKqtFRTaoGpyk9THSCQhRoY+fZTZfv8riiO7buiMUFxoFevE5gCfQxWL7BSqiIYZoByI1YW5DSt5qnrcQol5klKg8xtITWYzeENYdSlkLueiqNaOQb6IxUtt9tqsJgrm28ZrUYaJRORQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WS6c5axM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WS6c5axM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3589FC3277B; Tue, 7 May 2024 22:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715122771; bh=HvV+pVVFFLbbX4ltkN3w+EWnX6aqtF6HzprSpkb0SWI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WS6c5axMJEwJVHxWZ5F2+YCcRqsRK7nSFBJC9rCjmld9UucwAarwhNlYOMZB95ltp 5lYHeB5laTChr+Q3QNY67VbUTRZlTZ+846QGoEdne1286u2MqlO8wlsRs6mxXVHjhj fJ1VuQs9MduRjt1DwYrs8epMkzzYRolIE5/XAkLsE0PlNLCeJB2LiZe1qQnKGXa4Hn Pr2F1AlFBuSecC5fc6Xs3JaR1kLnCFMO2Ql487SZ8hhmYKuD/LJWbMkDNDBARYIOsC FJaFCEA7+oLUtNwYNcZRua81DnzJfuLHkGYNi3FqPi8zUB1mfeQOeqSSt36l2Iq2P9 /i8qP+r7LgPkA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Felix Kuehling , Mukul Joshi , =?UTF-8?q?Christian=20K=C3=B6nig?= , Alex Deucher , Sasha Levin , Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, Philip.Yang@amd.com, Arunpravin.PaneerSelvam@amd.com, Hongkun.Zhang@amd.com, pierre-eric.pelloux-prayer@amd.com, Jun.Ma2@amd.com, Wang.Beyond@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.6 08/19] drm/amdgpu: Update BO eviction priorities Date: Tue, 7 May 2024 18:58:30 -0400 Message-ID: <20240507225910.390914-8-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240507225910.390914-1-sashal@kernel.org> References: <20240507225910.390914-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.30 Content-Transfer-Encoding: 8bit From: Felix Kuehling [ Upstream commit b0b13d532105e0e682d95214933bb8483a063184 ] Make SVM BOs more likely to get evicted than other BOs. These BOs opportunistically use available VRAM, but can fall back relatively seamlessly to system memory. It also avoids SVM migrations evicting other, more important BOs as they will evict other SVM allocations first. Signed-off-by: Felix Kuehling Acked-by: Mukul Joshi Tested-by: Mukul Joshi Reviewed-by: Christian König Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 361f2cc94e8e5..1e33e82531f58 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -613,6 +613,8 @@ int amdgpu_bo_create(struct amdgpu_device *adev, else amdgpu_bo_placement_from_domain(bo, bp->domain); if (bp->type == ttm_bo_type_kernel) + bo->tbo.priority = 2; + else if (!(bp->flags & AMDGPU_GEM_CREATE_DISCARDABLE)) bo->tbo.priority = 1; if (!bp->destroy) -- 2.43.0