From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: Fix leaking of cached Host1x buffer objects
Date: Sat, 16 May 2026 10:12:28 +1000 [thread overview]
Message-ID: <review-overall-20260515-host1x-bocache-leak-v1-0-a0375f68aeab@nvidia.com> (raw)
In-Reply-To: <20260515-host1x-bocache-leak-v1-0-a0375f68aeab@nvidia.com>
Overall Series Review
Subject: Fix leaking of cached Host1x buffer objects
Author: Mikko Perttunen <mperttunen@nvidia.com>
Patches: 3
Reviewed: 2026-05-16T10:12:28.032839
---
This is a well-reasoned 2-patch series from Mikko Perttunen fixing a real memory leak in the Host1x buffer object cache. The core problem is a classic circular reference: cached mappings hold a refcount on the BO, but the only way to release a cached mapping is through the BO's free path — which never runs because the cache keeps the BO alive.
The fix is clean: centralize BO refcounting in the common `host1x_bo_pin()`/`host1x_bo_unpin()` functions rather than in each driver's `.pin`/`.unpin` callbacks, and make the cache's reference to the BO "weak" (no refcount bump). The BO free path is then responsible for tearing down cached mappings via a new `host1x_bo_clear_cached_mappings()` helper.
The series is correct and the approach is sound. I have one concern about the direct invocation of `__host1x_bo_unpin` bypassing `kref_put` in the teardown path, and a minor locking observation, but nothing blocking.
**Verdict: Looks good overall. Two minor observations below, neither blocking.**
---
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-05-16 0:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 2:34 [PATCH 0/2] Fix leaking of cached Host1x buffer objects Mikko Perttunen
2026-05-15 2:34 ` [PATCH 1/2] gpu: host1x: Allow entries in BO caches to be freed Mikko Perttunen
2026-05-16 0:12 ` Claude review: " Claude Code Review Bot
2026-05-15 2:34 ` [PATCH 2/2] crypto: tegra - Don't touch bo refcount in host1x bo pin/unpin Mikko Perttunen
2026-05-16 0:12 ` Claude review: " Claude Code Review Bot
2026-05-16 0:12 ` Claude Code Review Bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-overall-20260515-host1x-bocache-leak-v1-0-a0375f68aeab@nvidia.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox