Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] Build breakage in DRM TTM KUnit tests due to updated `ttm_bo_swapout` 
signature and removed export.
--

commit 67fbda553ce1493a6719acbdcf118e37c03311c8
Author: Natalie Vock <[email protected]>
drm/ttm: switch to ttm_bo_lru_for_each_reserved_guarded for swapout

This commit refactors the TTM BO swapout path to use the guarded LRU foreach
iterator instead of the wrapper walk callback. It simplifies the code and
reduces lines of code by removing the ttm_bo_swapout_walk struct and
ttm_bo_swapout_cb.

> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 1fb8c53da0362..24c52df169ac8 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
[ ... ]
> -s64 ttm_bo_swapout(struct ttm_device *bdev, struct ttm_operation_ctx *ctx,
> -                struct ttm_resource_manager *man, gfp_t gfp_flags,
> -                s64 target)
> -{
> -     struct ttm_bo_swapout_walk swapout_walk = {
> -             .walk = {
> -                     .process_bo = ttm_bo_swapout_cb,
> -                     .arg = {
> -                             .ctx = ctx,
> -                             .trylock_only = true,
> -                     },
> -             },
> -             .gfp_flags = gfp_flags,
> -     };
> -
> -     return ttm_lru_walk_for_evict(&swapout_walk.walk, bdev, man, target);
> -}
> -EXPORT_SYMBOL_FOR_TESTS_ONLY(ttm_bo_swapout);

[Severity: Low]
Will this break the KUnit tests? Looking at ttm_bo_validate_swapout() in
drivers/gpu/drm/ttm/tests/ttm_bo_validate_test.c, it still attempts to call
ttm_bo_swapout() with the old 5-argument signature:

        swapped = ttm_bo_swapout(priv->ttm_dev, &ctx_init, man, GFP_KERNEL,
                                 MANAGER_SIZE / PAGE_SIZE);

With the removal of EXPORT_SYMBOL_FOR_TESTS_ONLY and the signature change,
this appears to cause a build failure when KUnit tests are enabled.

-- 
Sashiko AI review · 
https://sashiko.dev/#/patchset/[email protected]?part=5

Reply via email to