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 B8772378D85 for ; Thu, 30 Apr 2026 23:01:07 +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=1777590067; cv=none; b=ce1f9WDTuE2ZpR9DdZFG9bVmo4vu00nTIViKWBsFYTHTsZxAc0DyP4UIqFr9Ohhjw4GtS53PfNQxl+nXCJ3Mq/Lm+nn8sz1hZW3CY0ztaytT5NcIxGQNJjrYtZQCUZ93TWkZ7OvHDnTqRFLRDYMoCpcYDwMeOQ1c1OorRPxYy1Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777590067; c=relaxed/simple; bh=PTULIpfRpRHkz0qopelU8YTdmvf6BncDc8+Oy6+/FfU=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=pQP4dpYI2hO9suiIYXE3di1bU7RoC2yBeZGFOm7lbZNtNtgG796vW/MLKLQics8PS5T/o0AS3/sUchPvyg8z7G4WWYWHNj5K/YPIbSzBjVT+MvR8RbizDmHabeOYcJLtVByytzlQEzz1TheyE1wNkK8qEqcRyI7R+gvpthKZyxk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=GeiddE3O; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="GeiddE3O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F04EEC2BCB3; Thu, 30 Apr 2026 23:01:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1777590067; bh=PTULIpfRpRHkz0qopelU8YTdmvf6BncDc8+Oy6+/FfU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GeiddE3O5PYXm17s8GY+whOzMH+r8aSqPUcTTBGpfl5yEsELOtc1RBsuQmCU4XAAv G2xQ2oifD6lJM0tEBXagW1Yy5u8RbsAOaeRTgyhKNydcQaSZIu8uBQJ2fbrPzhoFlz u4ekfPkgl811pE2YyrckBnbbyWZMzpKVOwggUM/A= Date: Thu, 30 Apr 2026 16:01:05 -0700 From: Andrew Morton To: Matthew Brost Cc: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Dave Chinner , Qi Zheng , Roman Gushchin , Johannes Weiner , Shakeel Butt , Kairui Song , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Tvrtko Ursulin , Thomas =?UTF-8?B?SGVsbHN0csO2bQ==?= , Carlos Santa , Christian Koenig , Huang Rui , Matthew Auld , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Daniel Colascione , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 0/6] mm, drm/ttm, drm/xe: Avoid reclaim/eviction loops under fragmentation Message-Id: <20260430160105.a3b74ec3bb316bbfbf8f9808@linux-foundation.org> In-Reply-To: <20260430191809.2142544-1-matthew.brost@intel.com> References: <20260430191809.2142544-1-matthew.brost@intel.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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 Content-Transfer-Encoding: 8bit On Thu, 30 Apr 2026 12:18:03 -0700 Matthew Brost wrote: > TTM allocations at higher orders can drive Xe into a pathological > reclaim loop when memory is fragmented: > > kswapd → shrinker → eviction → rebind (exec ioctl) → repeat > > In this state, reclaim is triggered despite substantial free memory, > but fails to produce contiguous higher-order pages. The Xe shrinker then > evicts active buffer objects, increasing faulting and rebind activity > and further feeding the loop. The result is high CPU overhead and poor > GPU forward progress. > > ... > > This series addresses the issue in two ways: > > TTM: Restrict direct reclaim to beneficial_order. Larger allocations > use __GFP_NORETRY to fail quickly rather than triggering reclaim. > > Xe: Introduce a heuristic in the shrinker to avoid eviction when > running under kswapd and the system appears memory-rich but > fragmented. Please cc everyone on all the patches? It's kind of annoying to have to hunt around to find out how these proposed changes will be used. Personal preference, anyway. AI review flagged a few possible issues: https://sashiko.dev/#/patchset/20260430191809.2142544-1-matthew.brost@intel.com