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 3223FC10F1A for ; Tue, 7 May 2024 22:59:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A339F112F9F; Tue, 7 May 2024 22:59:33 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="WS6c5axM"; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 17D8E112F98; Tue, 7 May 2024 22:59:32 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 54A0A619FA; Tue, 7 May 2024 22:59:31 +0000 (UTC) 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> 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 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" 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