public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/pagemap: Unlock and put folios when possible
Date: Fri, 13 Mar 2026 13:55:14 +1000	[thread overview]
Message-ID: <review-patch1-20260312192126.2024853-2-francois.dugast@intel.com> (raw)
In-Reply-To: <20260312192126.2024853-2-francois.dugast@intel.com>

Patch Review

**Good:** Clean conversion from page-level to folio-level unlock/put. The loop change from `++i` to stepping by `NR_PAGES(order)` correctly skips tail pages of large folios.

**Concern — uninitialized `order` on zero migrate_pfn path:**

```c
for (i = 0; i < npages;) {
    struct page *page;
    struct folio *folio;
    unsigned int order = 0;

    if (!migrate_pfn[i])
        goto next;
    ...
next:
    i += NR_PAGES(order);
}
```

When `migrate_pfn[i]` is zero, `order` is 0 and `NR_PAGES(0)` is 1, so the loop advances by 1. This is correct. However, it means for null entries interleaved within a large folio's PFN slots, each null entry is iterated individually. This is fine for correctness — the null entries simply indicate pages that weren't migrated — but it's worth noting the semantics are consistent.

**Minor:** The `migrate_pfn[i] = 0` clear on line 273 only clears the head page's entry, not tail entries. This appears correct since `drm_pagemap_migration_unlock_put_pages` is cleaning up after errors and only the head PFN would have been set during setup.

Looks good.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-03-13  3:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-12 19:20 [PATCH v9 0/4] Enable THP support in drm_pagemap Francois Dugast
2026-03-12 19:20 ` [PATCH v9 1/4] drm/pagemap: Unlock and put folios when possible Francois Dugast
2026-03-13  3:55   ` Claude Code Review Bot [this message]
2026-03-12 19:20 ` [PATCH v9 2/4] drm/pagemap: Add helper to access zone_device_data Francois Dugast
2026-03-13  3:55   ` Claude review: " Claude Code Review Bot
2026-03-12 19:20 ` [PATCH v9 3/4] drm/pagemap: Correct cpages calculation for migrate_vma_setup Francois Dugast
2026-03-13  3:55   ` Claude review: " Claude Code Review Bot
2026-03-12 19:20 ` [PATCH v9 4/4] drm/pagemap: Enable THP support for GPU memory migration Francois Dugast
2026-03-13  3:55   ` Claude review: " Claude Code Review Bot
2026-03-13  3:55 ` Claude review: Enable THP support in drm_pagemap Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-03-12 15:16 [PATCH v8 0/4] " Francois Dugast
2026-03-12 15:16 ` [PATCH v8 1/4] drm/pagemap: Unlock and put folios when possible Francois Dugast
2026-03-13  4:02   ` 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-patch1-20260312192126.2024853-2-francois.dugast@intel.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