From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: mm: Add helper to convert HMM pfn to migrate pfn
Date: Tue, 26 May 2026 07:29:20 +1000 [thread overview]
Message-ID: <review-patch2-20260525084524.139868-3-mpenttil@redhat.com> (raw)
In-Reply-To: <20260525084524.139868-3-mpenttil@redhat.com>
Patch Review
Adds `HMM_PFN_MIGRATE`, `HMM_PFN_COMPOUND`, and `HMM_PFN_REQ_MIGRATE` flags, and the `migrate_hmm_range_setup()` conversion function.
**Issue 1 — `EXPORT_SYMBOL` vs `EXPORT_SYMBOL_GPL`:**
```c
+EXPORT_SYMBOL(migrate_hmm_range_setup);
```
All other `migrate_vma_*` functions in this file use `EXPORT_SYMBOL()`, so this is consistent. However, it's worth noting that device migration is inherently a privileged kernel operation — `EXPORT_SYMBOL_GPL` would be more appropriate and consistent with the broader mm subsystem trend.
**Issue 2 — HMM_PFN_ORDER_SHIFT compression:**
```c
- HMM_PFN_ORDER_SHIFT = (BITS_PER_LONG - 11),
+ HMM_PFN_ORDER_SHIFT = (BITS_PER_LONG - 13),
```
Two new flag bits (`HMM_PFN_MIGRATE` at bit -7, `HMM_PFN_COMPOUND` at bit -8) consume space from the order field, shifting it from bits [53..57] to bits [51..55] on 64-bit. This reduces the maximum representable order from 31 to 31 (5 bits, unchanged width), so no functional impact. But the flags are getting tight in this namespace — 8 of the top 13 bits are now consumed.
**Issue 3 — `migrate_hmm_range_setup` calls static `migrate_vma_unmap`:**
```c
+ if (migrate->cpages)
+ migrate_vma_unmap(migrate);
```
This works because `migrate_hmm_range_setup` is defined in `migrate_device.c` alongside `migrate_vma_unmap` (which is static). Good.
**Minor — extra blank line:**
```c
+ if (migrate->cpages)
+ migrate_vma_unmap(migrate);
+
+}
```
Unnecessary blank line before the closing brace.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-25 21:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-25 8:45 [PATCH v12 0/5] Migrate on fault for device pages mpenttil
2026-05-25 8:45 ` [PATCH v12 1/5] mm/Kconfig: changes for migrate " mpenttil
2026-05-25 21:29 ` Claude review: " Claude Code Review Bot
2026-05-25 8:45 ` [PATCH v12 2/5] mm: Add helper to convert HMM pfn to migrate pfn mpenttil
2026-05-25 21:29 ` Claude Code Review Bot [this message]
2026-05-25 8:45 ` [PATCH v12 3/5] mm/hmm: do the plumbing for HMM to participate in migration mpenttil
2026-05-25 21:29 ` Claude review: " Claude Code Review Bot
2026-05-25 8:45 ` [PATCH v12 4/5] mm: setup device page migration in HMM pagewalk mpenttil
2026-05-25 21:29 ` Claude review: " Claude Code Review Bot
2026-05-25 8:45 ` [PATCH v12 5/5] lib/test_hmm: add a new testcase for the migrate on fault mpenttil
2026-05-25 21:29 ` Claude review: " Claude Code Review Bot
2026-05-25 21:29 ` Claude review: Migrate on fault for device pages Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-05-25 5:08 [PATCH v11 0/5] " mpenttil
2026-05-25 5:08 ` [PATCH v11 2/5] mm: Add helper to convert HMM pfn to migrate pfn mpenttil
2026-05-25 6:46 ` Claude review: " Claude Code Review Bot
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-patch2-20260525084524.139868-3-mpenttil@redhat.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