<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/gpu/drm/ttm, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-08-20T16:36:15Z</updated>
<entry>
<title>drm/ttm: Respect the shrinker core free target</title>
<updated>2025-08-20T16:36:15Z</updated>
<author>
<name>Tvrtko Ursulin</name>
</author>
<published>2025-06-03T11:27:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3da583b9f20c5205456774e725d73eee4a8376d3'/>
<id>urn:sha1:3da583b9f20c5205456774e725d73eee4a8376d3</id>
<content type='text'>
[ Upstream commit eac21f8ebeb4f84d703cf41dc3f81d16fa9dc00a ]

Currently the TTM shrinker aborts shrinking as soon as it frees pages from
any of the page order pools and by doing so it can fail to respect the
freeing target which was configured by the shrinker core.

We use the wording "can fail" because the number of freed pages will
depend on the presence of pages in the pools and the order of the pools on
the LRU list. For example if there are no free pages in the high order
pools the shrinker core may require multiple passes over the TTM shrinker
before it will free the default target of 128 pages (assuming there are
free pages in the low order pools). This inefficiency can be compounded by
the pool LRU where multiple further calls into the TTM shrinker are
required to end up looking at the pool with pages.

Improve this by never freeing less than the shrinker core has requested.

At the same time we start reporting the number of scanned pages (freed in
this case), which prevents the core shrinker from giving up on the TTM
shrinker too soon and moving on.

v2:
 * Simplify loop logic. (Christian)
 * Improve commit message.

Signed-off-by: Tvrtko Ursulin &lt;tvrtko.ursulin@igalia.com&gt;
Cc: Christian König &lt;christian.koenig@amd.com&gt;
Cc: Thomas Hellström &lt;thomas.hellstrom@linux.intel.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Tvrtko Ursulin &lt;tursulin@ursulin.net&gt;
Link: https://lore.kernel.org/r/20250603112750.34997-2-tvrtko.ursulin@igalia.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/ttm: Should to return the evict error</title>
<updated>2025-08-20T16:36:14Z</updated>
<author>
<name>Emily Deng</name>
</author>
<published>2025-06-03T09:11:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d12ee9d0d4417db59b36fd52bf9078d96551ec60'/>
<id>urn:sha1:d12ee9d0d4417db59b36fd52bf9078d96551ec60</id>
<content type='text'>
[ Upstream commit 4e16a9a00239db5d819197b9a00f70665951bf50 ]

For the evict fail case, the evict error should be returned.

v2: Consider ENOENT case.

v3: Abort directly when the eviction failed for some reason (except for -ENOENT)
 and not wait for the move to finish

Signed-off-by: Emily Deng &lt;Emily.Deng@amd.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Link: https://lore.kernel.org/r/20250603091154.3472646-1-Emily.Deng@amd.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/ttm: fix error handling in ttm_buffer_object_transfer</title>
<updated>2025-07-17T16:43:49Z</updated>
<author>
<name>Christian König</name>
</author>
<published>2025-06-13T11:16:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5f59b94b91376a2b5b1e2a12b3b5ac14211e0b12'/>
<id>urn:sha1:5f59b94b91376a2b5b1e2a12b3b5ac14211e0b12</id>
<content type='text'>
commit 97e000acf2e20a86a50a0ec8c2739f0846f37509 upstream.

Unlocking the resv object was missing in the error path, additionally to
that we should move over the resource only after the fence slot was
reserved.

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Matthew Brost &lt;matthew.brost@intel.com&gt;
Fixes: c8d4c18bfbc4a ("dma-buf/drivers: make reserving a shared slot mandatory v4")
Cc: &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20250616130726.22863-3-christian.koenig@amd.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/ttm/tests: fix incorrect assert in ttm_bo_unreserve_bulk()</title>
<updated>2025-06-27T10:13:16Z</updated>
<author>
<name>Qasim Ijaz</name>
</author>
<published>2025-03-13T16:14:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3e6c77f9d41a1c45ac333c3aa855e20250258dd3'/>
<id>urn:sha1:3e6c77f9d41a1c45ac333c3aa855e20250258dd3</id>
<content type='text'>
[ Upstream commit 878516a9e62cd220379e511d43dcf58df3a6ca9f ]

In the ttm_bo_unreserve_bulk() test function, resv is allocated using
kunit_kzalloc(), but the subsequent assertion mistakenly verifies the
ttm_dev pointer instead of the resv pointer.

Fix the assertion to properly verify the resv pointer.

Signed-off-by: Qasim Ijaz &lt;qasdev00@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250313161424.10688-1-qasdev00@gmail.com
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/ttm: Remove the struct ttm_backup abstraction</title>
<updated>2025-05-06T08:57:27Z</updated>
<author>
<name>Thomas Hellström</name>
</author>
<published>2025-05-02T13:00:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d4ad53adfe21df1464bae5ed916085a69d6ffb3d'/>
<id>urn:sha1:d4ad53adfe21df1464bae5ed916085a69d6ffb3d</id>
<content type='text'>
The abstraction was previously added to support separate
ttm_backup implementations.

However with the current implementation casting from a
struct file to a struct ttm_backup, we run into trouble since
struct file may have randomized the layout and gcc complains.

Remove the struct ttm_backup abstraction

Cc: dri-devel@lists.freedesktop.org
Cc: Matthew Brost &lt;matthew.brost@intel.com&gt;
Cc: Dave Airlie &lt;airlied@redhat.com&gt;
Cc: Christian König &lt;christian.koenig@amd.com&gt;
Cc: Matthew Auld &lt;matthew.auld@intel.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Reported-by: Kees Cook &lt;kees@kernel.org&gt;
Closes: https://lore.kernel.org/dri-devel/9c8dbbafdaf9f3f089da2cde5a772d69579b3795.camel@linux.intel.com/T/#mb153ab9216cb813b92bdeb36f391ad4808c2ba29
Suggested-by: Christian König &lt;christian.koenig@amd.com&gt;
Fixes: 70d645deac98 ("drm/ttm: Add helpers for shrinking")
Signed-off-by: Thomas Hellström &lt;thomas.hellstrom@linux.intel.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Link: https://lore.kernel.org/r/20250502130014.3156-1-thomas.hellstrom@linux.intel.com
</content>
</entry>
<entry>
<title>drm/ttm: Fix ttm_backup kerneldoc</title>
<updated>2025-05-06T08:57:11Z</updated>
<author>
<name>Thomas Hellström</name>
</author>
<published>2025-05-02T13:01:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2bb04ea9e5b7a2ef583c042ed5f8111804606e9d'/>
<id>urn:sha1:2bb04ea9e5b7a2ef583c042ed5f8111804606e9d</id>
<content type='text'>
The docs were not properly updated from an earlier version of the code.

Fixes: e7b5d23e5d47 ("drm/ttm: Provide a shmem backup implementation")
Cc: Christian König &lt;christian.koenig@amd.com&gt;
Cc: Matthew Brost &lt;matthew.brost@intel.com&gt;
Cc: Matthew Auld &lt;matthew.auld@intel.com&gt;
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Thomas Hellström &lt;thomas.hellstrom@linux.intel.com&gt;
Reviewed-by: Matthew Brost &lt;matthew.brost@intel.com&gt;
Link: https://lore.kernel.org/r/20250502130101.3185-1-thomas.hellstrom@linux.intel.com
</content>
</entry>
<entry>
<title>drm/ttm: fix the warning for hit_low and evict_low</title>
<updated>2025-04-28T08:01:03Z</updated>
<author>
<name>Sunil Khatri</name>
</author>
<published>2025-04-23T04:24:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=76047483fe94414edf409dc498498abf346e22f1'/>
<id>urn:sha1:76047483fe94414edf409dc498498abf346e22f1</id>
<content type='text'>
fix the below warning messages:
ttm/ttm_bo.c:1098: warning: Function parameter or struct member 'hit_low' not described in 'ttm_bo_swapout_walk'
ttm/ttm_bo.c:1098: warning: Function parameter or struct member 'evict_low' not described in 'ttm_bo_swapout_walk'

Cc: Maarten Lankhorst &lt;dev@lankhorst.se&gt;
Cc: Tvrtko Ursulin &lt;tvrtko.ursulin@igalia.com&gt;
Signed-off-by: Sunil Khatri &lt;sunil.khatri@amd.com&gt;
Reviewed-by: Maarten Lankhorst &lt;dev@lankhorst.se&gt;
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Link: https://lore.kernel.org/r/20250423042442.762108-1-sunil.khatri@amd.com
</content>
</entry>
<entry>
<title>drm/ttm: Add helpers for shrinking</title>
<updated>2025-03-05T16:08:59Z</updated>
<author>
<name>Thomas Hellström</name>
</author>
<published>2025-03-05T09:22:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=70d645deac98303d1bf9ab08a4e68da52bf8c1e1'/>
<id>urn:sha1:70d645deac98303d1bf9ab08a4e68da52bf8c1e1</id>
<content type='text'>
Add a number of helpers for shrinking that access core TTM and
core MM functionality in a way that make them unsuitable for
driver open-coding.

v11:
- New patch (split off from previous) and additional helpers.
v13:
- Adapt to ttm_backup interface change.
- Take resource off LRU when backed up.

Signed-off-by: Thomas Hellström &lt;thomas.hellstrom@linux.intel.com&gt;
Reviewed-by: Matthew Brost &lt;matthew.brost@intel.com&gt;
Acked-by: Dave Airlie &lt;airlied@redhat.com&gt;
Acked-by: Christian König &lt;christian.koenig@amd.com&gt;
Link: https://lore.kernel.org/intel-xe/20250305092220.123405-6-thomas.hellstrom@linux.intel.com
</content>
</entry>
<entry>
<title>drm/ttm: Add a macro to perform LRU iteration</title>
<updated>2025-03-05T16:08:59Z</updated>
<author>
<name>Thomas Hellström</name>
</author>
<published>2025-03-05T09:22:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f3bcfd04a52fb1b1702349bed2bccc1126b97f89'/>
<id>urn:sha1:f3bcfd04a52fb1b1702349bed2bccc1126b97f89</id>
<content type='text'>
Following the design direction communicated here:

https://lore.kernel.org/linux-mm/b7491378-defd-4f1c-31e2-29e4c77e2d67@amd.com/T/#ma918844aa8a6efe8768fdcda0c6590d5c93850c9

Export a LRU walker for driver shrinker use. The walker
initially supports only trylocking, since that's the
method used by shrinkes. The walker makes use of
scoped_guard() to allow exiting from the LRU walk loop
without performing any explicit unlocking or
cleanup.

v8:
- Split out from another patch.
- Use a struct for bool arguments to increase readability (Matt Brost).
- Unmap user-space cpu-mappings before shrinking pages.
- Explain non-fatal error codes (Matt Brost)

v10:
- Instead of using the existing helper, Wrap the interface inside out and
  provide a loop to de-midlayer things the LRU iteration (Christian König).
- Removing the R-B by Matt Brost since the patch was significantly changed.

v11:
- Split the patch up to include just the LRU walk helper.

v12:
- Indent after scoped_guard() (Matt Brost)

v15:
- Adapt to new definition of scoped_guard()

Signed-off-by: Thomas Hellström &lt;thomas.hellstrom@linux.intel.com&gt;
Reviewed-by: Matthew Brost &lt;matthew.brost@intel.com&gt;
Acked-by: Dave Airlie &lt;airlied@redhat.com&gt;
Acked-by: Christian König &lt;christian.koenig@amd.com&gt;
Link: https://lore.kernel.org/intel-xe/20250305092220.123405-5-thomas.hellstrom@linux.intel.com
</content>
</entry>
<entry>
<title>drm/ttm: Use fault-injection to test error paths</title>
<updated>2025-03-05T16:08:59Z</updated>
<author>
<name>Thomas Hellström</name>
</author>
<published>2025-03-05T09:22:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8ae875f641188be338126cc76c76c82d256364dd'/>
<id>urn:sha1:8ae875f641188be338126cc76c76c82d256364dd</id>
<content type='text'>
Use fault-injection to test partial TTM swapout and interrupted swapin.
Return -EINTR for swapin to test the callers ability to handle and
restart the swapin, and on swapout perform a partial swapout to test that
the swapin and release_shrunken functionality.

v8:
- Use the core fault-injection system.
v9:
- Fix compliation failure for !CONFIG_FAULT_INJECTION

Cc: Christian König &lt;christian.koenig@amd.com&gt;
Cc: Somalapuram Amaranath &lt;Amaranath.Somalapuram@amd.com&gt;
Cc: Matthew Brost &lt;matthew.brost@intel.com&gt;
Cc: &lt;dri-devel@lists.freedesktop.org&gt;
Signed-off-by: Thomas Hellström &lt;thomas.hellstrom@linux.intel.com&gt;
Reviewed-by: Matthew Brost &lt;matthew.brost@intel.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Link: https://lore.kernel.org/intel-xe/20250305092220.123405-4-thomas.hellstrom@linux.intel.com
</content>
</entry>
</feed>
