From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/shmem-helper: Fix Map huge page mapping in fault handler Date: Mon, 16 Mar 2026 11:46:49 +1000 Message-ID: In-Reply-To: <20260316002649.211819-1-pedrodemargomes@gmail.com> References: <20260316002649.211819-1-pedrodemargomes@gmail.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Overall Series Review Subject: drm/shmem-helper: Fix Map huge page mapping in fault handler Author: Pedro Demarchi Gomes Patches: 1 Reviewed: 2026-03-16T11:46:49.216342 --- This is a single-patch fix for a real race condition in the DRM shmem helper's huge page fault handling. The bug occurs when two concurrent page faults in the same PMD range race: one installs a PMD mapping via `vmf_insert_pfn_pmd()`, while the other tries a PTE mapping via `vmf_insert_pfn()`, hitting a BUG in `walk_to_pmd()` because a `pmd_trans_huge` entry is unexpected in the PTE path. The fix is architecturally correct: move PMD mapping to a proper `.huge_fault` callback and keep `.fault` for PTE-only mappings, letting the MM layer coordinate between the two paths. However, the patch does not apply to the current drm-next tree, which has already refactored this code (renaming functions, adding `folio_mark_accessed()`, adding `pfn_mkwrite`). The patch needs to be rebased. **Verdict:** The approach is sound, but needs rebasing against drm-next and has a few issues noted below. --- Generated by Claude Code Patch Reviewer