From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260525084524.139868-3-mpenttil@redhat.com> References: <20260525084524.139868-1-mpenttil@redhat.com> <20260525084524.139868-3-mpenttil@redhat.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 =E2=80=94 `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 inh= erently a privileged kernel operation =E2=80=94 `EXPORT_SYMBOL_GPL` would b= e more appropriate and consistent with the broader mm subsystem trend. **Issue 2 =E2=80=94 HMM_PFN_ORDER_SHIFT compression:** ```c - HMM_PFN_ORDER_SHIFT =3D (BITS_PER_LONG - 11), + HMM_PFN_ORDER_SHIFT =3D (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 bi= ts [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 ar= e getting tight in this namespace =E2=80=94 8 of the top 13 bits are now co= nsumed. **Issue 3 =E2=80=94 `migrate_hmm_range_setup` calls static `migrate_vma_unm= ap`:** ```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 =E2=80=94 extra blank line:** ```c + if (migrate->cpages) + migrate_vma_unmap(migrate); + +} ``` Unnecessary blank line before the closing brace. --- Generated by Claude Code Patch Reviewer