* [PATCH] drm/ttm: document that ttm_bo_swapout deals with pages
@ 2026-03-09 18:49 Thadeu Lima de Souza Cascardo
2026-03-10 1:58 ` Claude review: " Claude Code Review Bot
2026-03-10 1:58 ` Claude Code Review Bot
0 siblings, 2 replies; 3+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2026-03-09 18:49 UTC (permalink / raw)
To: dri-devel
Cc: Christian Koenig, Huang Rui, Matthew Auld, Matthew Brost,
kernel-dev, Tvrtko Ursulin, Thadeu Lima de Souza Cascardo
Both the target parameter and return value of ttm_bo_swapout deal with
pages, not bytes.
Reported-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
---
drivers/gpu/drm/ttm/ttm_bo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 0765d69423d2f4028bf2effd21af53e117ee7a29..839ceb31135bc8e552f9add1357a64c6774aeee6 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1210,9 +1210,9 @@ const struct ttm_lru_walk_ops ttm_swap_ops = {
* @man: The resource manager whose resources / buffer objects are
* goint to be swapped out.
* @gfp_flags: The gfp flags used for shmem page allocations.
- * @target: The desired number of bytes to swap out.
+ * @target: The desired number of pages to swap out.
*
- * Return: The number of bytes actually swapped out, or negative error code
+ * Return: The number of pages actually swapped out, or negative error code
* on error.
*/
s64 ttm_bo_swapout(struct ttm_device *bdev, struct ttm_operation_ctx *ctx,
---
base-commit: 1f318b96cc84d7c2ab792fcc0bfd42a7ca890681
change-id: 20260309-ttm_bo_swapout_doc-b2cefcd5e62b
Best regards,
--
Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Claude review: drm/ttm: document that ttm_bo_swapout deals with pages
2026-03-09 18:49 [PATCH] drm/ttm: document that ttm_bo_swapout deals with pages Thadeu Lima de Souza Cascardo
2026-03-10 1:58 ` Claude review: " Claude Code Review Bot
@ 2026-03-10 1:58 ` Claude Code Review Bot
1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-03-10 1:58 UTC (permalink / raw)
To: dri-devel-reviews
Overall Series Review
Subject: drm/ttm: document that ttm_bo_swapout deals with pages
Author: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
Patches: 1
Reviewed: 2026-03-10T11:58:56.089304
---
This is a single-patch documentation fix for `ttm_bo_swapout()` in the TTM (Translation Table Manager) subsystem. The fix is correct: the kerneldoc comments incorrectly stated "bytes" when the function actually operates in units of pages. The change is trivial and obviously right.
**Verdict: Looks good.**
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 3+ messages in thread
* Claude review: drm/ttm: document that ttm_bo_swapout deals with pages
2026-03-09 18:49 [PATCH] drm/ttm: document that ttm_bo_swapout deals with pages Thadeu Lima de Souza Cascardo
@ 2026-03-10 1:58 ` Claude Code Review Bot
2026-03-10 1:58 ` Claude Code Review Bot
1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-03-10 1:58 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**Status: Correct, ready to merge.**
The patch fixes two inaccuracies in the kerneldoc for `ttm_bo_swapout()`:
1. `@target` parameter was documented as "bytes" but is actually "pages"
2. Return value was documented as "bytes" but is actually "pages"
This is verifiable by tracing the code:
- `ttm_bo_swapout()` passes `target` directly to `ttm_lru_walk_for_evict()` at `ttm_bo.c:1234`
- The `process_bo` callback (`ttm_bo_swapout_cb`) returns `num_pages` (from `tt->num_pages`) at `ttm_bo.c:1144` for deleted BOs
- `ttm_lru_walk_for_evict()` accumulates these return values as `progress` and compares against `target` at `ttm_bo_util.c:912-913`
So `target` and the return value are unambiguously in pages.
**Minor pre-existing nit (not introduced by this patch):** The `@man` doc at line 1212 has a typo: "goint" should be "going". The author may want to fix that in a follow-up or fold it in if they respin.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-10 1:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 18:49 [PATCH] drm/ttm: document that ttm_bo_swapout deals with pages Thadeu Lima de Souza Cascardo
2026-03-10 1:58 ` Claude review: " Claude Code Review Bot
2026-03-10 1:58 ` Claude Code Review Bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox