mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Matthew Brost <matthew.brost@intel.com>,
	intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: "Huang Rui" <ray.huang@amd.com>,
	"Matthew Auld" <matthew.auld@intel.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	linux-kernel@vger.kernel.org,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Subject: Re: [PATCH] drm/ttm/pool: Try harder for beneficial orders
Date: Wed, 17 Jun 2026 10:59:20 +0200	[thread overview]
Message-ID: <d6f260a3-3364-4e2b-811d-881564d133d8@amd.com> (raw)
In-Reply-To: <20260617022248.1165101-1-matthew.brost@intel.com>

On 6/17/26 04:22, Matthew Brost wrote:
> When a driver specifies a beneficial order, TTM should make a reasonable
> effort to allocate pages at that order.
> 
> Use __GFP_RETRY_MAYFAIL instead of __GFP_NORETRY when allocating at the
> beneficial order. This allows reclaim to try harder before falling back to
> smaller orders, at the cost of longer allocation setup time.
> 
> That tradeoff is acceptable for beneficial-order allocations: higher-order
> backing pages can improve TLB hit rates and reduce the number of TLB
> invalidations needed when moving memory.
> 
> Cc: Christian Koenig <christian.koenig@amd.com>
> Cc: Huang Rui <ray.huang@amd.com>
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Simona Vetter <simona@ffwll.ch>
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-kernel@vger.kernel.org
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
> 
> Together with other Xe/core shrinker changes currently under development,
> this change significantly improved performance under memory fragmentation
> on PTL. In 3DMark Wild Life Extreme, performance improved by up to 120%
> compared to the baseline fragmented-memory case. GravityMark also showed
> approximately a 20% improvement under similar conditions.
> ---
>  drivers/gpu/drm/ttm/ttm_pool.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
> index 9f0ab99eb289..682ae4f40424 100644
> --- a/drivers/gpu/drm/ttm/ttm_pool.c
> +++ b/drivers/gpu/drm/ttm/ttm_pool.c
> @@ -168,6 +168,11 @@ static struct page *ttm_pool_alloc_page(struct ttm_pool *pool, gfp_t gfp_flags,
>  	if (order && beneficial_order && order != beneficial_order)
>  		gfp_flags &= ~__GFP_RECLAIM;
>  
> +	if (beneficial_order && order == beneficial_order) {
> +		gfp_flags &= ~__GFP_NORETRY;
> +		gfp_flags |= __GFP_RETRY_MAYFAIL;
> +	}
> +
>  	if (!ttm_pool_uses_dma_alloc(pool)) {
>  		p = alloc_pages_node(pool->nid, gfp_flags, order);
>  		if (p) {


      reply	other threads:[~2026-06-17  8:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-17  2:22 Matthew Brost
2026-06-17  8:59 ` Christian König [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d6f260a3-3364-4e2b-811d-881564d133d8@amd.com \
    --to=christian.koenig@amd.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=mripard@kernel.org \
    --cc=ray.huang@amd.com \
    --cc=simona@ffwll.ch \
    --cc=thomas.hellstrom@linux.intel.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®