From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.181 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796439368; b=g1hnY4hq2xD/FpDZryw08yu/n5260RKBR6ndupe6xEBvdLUtZNtTVSDCNREao7D84zKv c7iChIT35v7nOJRGmYsEws0rxRoTP/liErmOWVkrtrsF7CvjfnYxDXqSZz7gP/BRJ+XpW RCDRpuLC7mW1Z9usEnTcRyzkQkeSmK4HY4PFYrZuXy+t4XDKmCV2NULIdueAu5Fid4eWC lpawMZDOCceWBlSifN0A7MuOUXr0dctV0Q/X1n5xEScGeyeyONEOsxPh1wGWkzGPRMbhZ W+u4kdw78XvnnII6+zAzN4y5PBh/nPxFk3XKkQBYVqNcAm6x4ALukSkb5UkjKunjeEg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796439368; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=XFa8mHNfW/QU+OXdsvpqpMN2uZJ9/uvyQYKJ0oHwajU=; b=Q1R4ULPbM7TcSdAy+uYkMIN5MDa6C6qc1qGiieGe44BVnYrZLresWC4N5YPDQUnHcXq+ +XufvHKYTLS2Akki930k3KF5BENzyLR4u+zmW8oMLbGyULgaCwNhVmLBcVXQjfJFmw2iA xIN/vl+63vfyPDEjN/ka3N51fLFQrsDZnSNXmih+xNywl9aXq6BBPp+uNnXaow5GqlMh+ CCVaeL5D9T5ZPQ2Yf7LNPdKmPLvFsHTgB15YIxgQGj51mB88iQkLLbKxtafHjSu5xaB3T deYmCWzaTFjzd5S6nGOtHLERwwMbdkgAL2DDLVWQLUBXA8AwG9A47A4bgaRdcqm4+gA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=bGekIAml; arc=none smtp.remote-ip=74.125.82.181 Received: from mail-dy1-f181.google.com (mail-dy1-f181.google.com [74.125.82.181]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A0FC606A32D for ; Sat, 5 Dec 2026 02:56:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3A0FC606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=bGekIAml Received: by mail-dy1-f181.google.com with SMTP id 5a478bee46e88-33bf40b0c8bso3554040eec.0 for ; Fri, 04 Dec 2026 18:56:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796439367; x=1797044167; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=XFa8mHNfW/QU+OXdsvpqpMN2uZJ9/uvyQYKJ0oHwajU=; b=bGekIAmlUpn1gHZn7ycF3Gdp5iJE9y42HJmcp3mpe54Iq+LpbOGnJXVcPZu8+45HHU RU26vkREzQLoFbymj7EDnABI6c1EIebHPvW0IADB9VgMHX8LKhhxAMBESQfnENy9DfNO 1eSpzG61BOGsLfyueavC0fhpEGAMS4ctlZmsPOHBCH8z/hHX/WjR1Kq8RDoaOZQvNPQN n9v0T9qyN+AgbEvfkSpxEW18MOshwCFJzC562orksg1EcgaMAlpBKIzvy1Hdx0/PTzVh Di38T2Z+R9ZMUucCJmNkCgXWXylNy5sK4DTXPguZ+EhVvc7jbsf/HN8U90QwtxPN8PfP /CWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796439367; x=1797044167; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=XFa8mHNfW/QU+OXdsvpqpMN2uZJ9/uvyQYKJ0oHwajU=; b=kWlGHS75DnbpJsAccX+hsnBxZBxsRnpoIBrZoFoz64mRUP8qoAnFONIwj2yLijwx+F SWC8VSMMoS1MnsGX3+/yQHAUJ/FxGVfgdXIBjS7vTMU217ZbAc6hbpIZngxfc1Te5tt4 Nbpjd2Y4n6z0ldxlmebd6A3Jgme20vZjtUgdFxu0rU7J84dn2wcHxyh4rFcasdRRnWPP +jVZZq3b/ecnxzIFrOp0y6x3SzCNte0mCPFU0WlaHDoq6/86hR6LvHBvkpaVriIA/USD Yl+4kvx92OkgZOGvtWhodMJqzihSIsqMPvKBc0GVCn0kjIc6Vj/FPTD6ZONvo7pGOUaM A2zw== X-Forwarded-Encrypted: i=1; AL+hErGrwu7zlfet4VylFuuE0wVjQW7uKmZv0dNILli4x8df8Dw12SoIN0T7CPeGrt4YGPkeWyZmuO4=@vger.kernel.org X-Gm-Message-State: APuU4Z/Z7pdgbx9v9by4NRrZrGGr+O72xImYcyuPp6NKbnX+o2vaB527 njmiBtFNCyLV8fzZi4tgyYFpbt9qbcwRcSQANSqL/2I3HaJOHXXUpxwcEnOn+BYNHo5I X-Gm-Gg: AZFdTZcpqkdRjlpA2belNauJopEptDgxFRY4SqGwSGK598JfA1RwenlZ9c48QXS4qDl n2gfEYoDSvYd+g55rxf6NQRiECAp673UfOx2i6HnrLKgNMfhq/5P9ppW9WdotWXcEh7Nm/K0tQ4 GFWQTGQwICSJaraH4ZUHWSgrH6B1HFah2JlD7Z0I7Nmb+3okls2d4LDSDsJPex6pAxyFoGFpfy/ tX4m7uk82dHNlUiEotwUzqmdHwvBjlS2e67PdCSAzlpqjJMIppxn6xPujt5iPvQuGS5wdMjwywr yPRM/YZWaq9jh6WmArar2tBX+4rFNOpUnRQaMbVAZD5jS0pVK31MXItEdNjkz1WQsTF38+64LpS 4/ffRf8Z1VozGNh1SOE4pgCoWcjtmXNolzh+K/bveqRbMN0xref2r/4qB62i414ty5gx8ywQ3gZ 7rwlYo2vB4OjjxLM6OVgqY8l8ZM1uUkNptIIC6rLA/Ypbk7OpX5Z0KnXq/AuVQ+WW3hfTMRw3fC ClPBY/b2feqbMR3ltgwgr+dSWAUmti4DrwqSwtiZYarbK3Qo4+RVFJ9/3f8IXQvAGUgg3JOAeeW 0RNI1UFZGSF5ugUv95iOxHtchTlGre4Qn1JoQXRipEKN9exyh/h64k0qwPQpSKCKsGSk X-Received: by 2002:a05:693c:820a:b0:387:48ee:da5 with SMTP id 5a478bee46e88-38752173a51mr4152791eec.34.1796439367186; Fri, 04 Dec 2026 18:56:07 -0800 (PST) Received: from cachyos-x8664 ([179.182.114.114]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3875218bd23sm13276390eec.8.2026.12.04.18.56.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 18:56:06 -0800 (PST) From: Rogerio Lucas To: Natalie Vock , Arun Pravin , Christian Koenig , Matthew Brost Cc: Rogerio Lucas , Huang Rui , Matthew Auld , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Alex Deucher , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, regressions@lists.linux.dev, stable@vger.kernel.org Subject: [PATCH] Revert "drm/ttm/pool: Try harder for beneficial orders" Date: Fri, 4 Dec 2026 23:44:57 -0300 Message-ID: <20261205024457.1581691-2-rogeriolucas@gmail.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261205024457.1581691-1-rogeriolucas@gmail.com> References: <20261205024457.1581691-1-rogeriolucas@gmail.com> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dd8dde5745eaf7509d5565d539d0c0bf4148bfe7. With __GFP_RETRY_MAYFAIL instead of __GFP_NORETRY, an allocation at the beneficial order no longer fails fast when compaction cannot form a block. It enters direct reclaim and the reclaim/compaction retry loops, for every chunk of every new BO. amdgpu sets the beneficial order to 2 MiB, and on APUs most BOs are system memory. On a Radeon 610M with fragmented memory, the compositor enters direct reclaim at order 9 from amdgpu_gem_create_ioctl(), and the cursor and window switching stall. Seen on distribution kernels, with kwin_wayland and plasmashell on 7.3-rc4 and with gnome-shell on 7.3.5: 87 direct reclaims in 15 s, all order 9 with gfp_flags 0x386dc2, the gnome-shell cgroup spending up to 514 ms of each second stalled on memory with its main thread running in reclaim and compaction rather than blocked. With one page pinned per pageblock on 7.3-rc6, 64 order-9 allocations with the TTM flags took 12 ms at the median and up to 321 ms with this commit, against 0.1 ms without it. Each run reclaimed about 280 MiB directly, pushed about 0.4 GiB to swap, and the retries got one 2 MiB page in 128 attempts. Fixes: dd8dde5745ea ("drm/ttm/pool: Try harder for beneficial orders") Cc: stable@vger.kernel.org # v7.3+ Cc: Matthew Brost Cc: Christian Koenig Cc: Huang Rui Cc: Matthew Auld Cc: Thomas Hellström Cc: Alex Deucher Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Rogerio Lucas --- drivers/gpu/drm/ttm/ttm_pool.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c index 1bf37023..48a7d5b6 100644 --- a/drivers/gpu/drm/ttm/ttm_pool.c +++ b/drivers/gpu/drm/ttm/ttm_pool.c @@ -183,11 +183,6 @@ 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) { -- 2.56.1