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 3076DF5A8CA for ; Tue, 21 Apr 2026 01:26:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C2E6910E0E0; Tue, 21 Apr 2026 01:26:16 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="DORkZSuG"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1A04610E1CA; Tue, 21 Apr 2026 01:26:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1776734776; x=1808270776; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Z1Lhf1J4Er8Q+QW4a1sQtAe4AxPSnh9I0g4oWAeZp5k=; b=DORkZSuGz5HSKYgfYPz/3+JcIxMmtl6/wHQA+++bBEfoxC8y/FlTYWys bD6Vba15Xlf8kyIa5o7D0UMCDSpM44jwaOMoW2BZb3AZ0j+If+VCwFKpa nVkiMq69jBfn7VMcfTKETIWZYvPRzgIEhy+5PyBF1ZXE5KOYNl6A3be2p y/CAsINtej/Pyi+HbmCpDjSYlD9mZSJ81WLfPppkKJ3VbqZjImuJ8Ucxx P5qSw5bzhVeCupgPlcqCLyE6Dji6oXxeo8GvrqFBgxbuVIwMbJdiJ4kEa XA6yWBRxpg4mw6Nc+Oe/iE7N5outVI/F7NgWIZuk3jB8po0XGaYVfHW/9 Q==; X-CSE-ConnectionGUID: CcaTriVtQ5yjzdyIk/Qz3w== X-CSE-MsgGUID: +5KyYYquSxWJ4QIr5aL7mg== X-IronPort-AV: E=McAfee;i="6800,10657,11762"; a="88280328" X-IronPort-AV: E=Sophos;i="6.23,190,1770624000"; d="scan'208";a="88280328" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2026 18:26:15 -0700 X-CSE-ConnectionGUID: Xn34o+pPTu6Y3Vl837teJQ== X-CSE-MsgGUID: 4rMvYqJQRXe9/bsDQNap5w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,190,1770624000"; d="scan'208";a="236872340" Received: from gsse-cloud1.jf.intel.com ([10.54.39.91]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2026 18:26:14 -0700 From: Matthew Brost To: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Carlos Santa , Christian Koenig , Huang Rui , Matthew Auld , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Daniel Colascione Subject: [PATCH 1/3] drm/ttm: Issue direct reclaim at beneficial_order Date: Mon, 20 Apr 2026 18:26:06 -0700 Message-Id: <20260421012608.1474950-2-matthew.brost@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260421012608.1474950-1-matthew.brost@intel.com> References: <20260421012608.1474950-1-matthew.brost@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" Triggering kswap at an order higher than beneficial_order makes little sense, as the driver has already indicated the optimal order at which reclaim is effective. Similarly, issuing direct reclaim or triggering kswap at a lower order than beneficial_order is ineffective, since the driver does not benefit from reclaiming lower-order pages. As a result, direct reclaim should only be issued with __GFP_NORETRY at exactly beneficial_order, or as a fallback, direct reclaim without __GFP_NORETRY at order 0 when failure is not an option. Cc: Thomas Hellström Cc: Carlos Santa Cc: Christian Koenig Cc: Huang Rui Cc: Matthew Auld Cc: Matthew Brost Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Simona Vetter CC: dri-devel@lists.freedesktop.org Cc: Daniel Colascione Signed-off-by: Matthew Brost --- drivers/gpu/drm/ttm/ttm_pool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c index 26a3689e5fd9..8425dbcc6c68 100644 --- a/drivers/gpu/drm/ttm/ttm_pool.c +++ b/drivers/gpu/drm/ttm/ttm_pool.c @@ -165,8 +165,8 @@ static struct page *ttm_pool_alloc_page(struct ttm_pool *pool, gfp_t gfp_flags, * Do not add latency to the allocation path for allocations orders * device tolds us do not bring them additional performance gains. */ - if (beneficial_order && order > beneficial_order) - gfp_flags &= ~__GFP_DIRECT_RECLAIM; + if (order && beneficial_order && order != beneficial_order) + gfp_flags &= ~__GFP_RECLAIM; if (!ttm_pool_uses_dma_alloc(pool)) { p = alloc_pages_node(pool->nid, gfp_flags, order); -- 2.34.1